Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test tcp #12

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Test tcp #12

wants to merge 10 commits into from

Conversation

ed2k
Copy link

@ed2k ed2k commented Jan 3, 2015

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 241b2b9 on ed2k:test_tcp into 2e686dd on getlantern:master.

@@ -82,7 +82,11 @@ func (p *peer) answer(wm *waddell.MessageIn) {
}

log.Printf("Got five tuple: %s", ft)
go readUDP(p.id, traversalId, ft)
if ft.Proto == "tcp" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check indentation. Also, please run gofmt on this.

@oxtoacart
Copy link
Contributor

@ed2k Have you found a situation in which natty returns a TCP 5-tuple?

@oxtoacart
Copy link
Contributor

@ed2k Did a little digging, looks like it's theoretically possible to get a TCP 5-tuple.

@@ -107,11 +111,38 @@ func readUDP(peerId waddell.PeerId, traversalId uint32, ft *natty.FiveTuple) {
if err != nil {
log.Fatalf("Unable to read from UDP: %s", err)
}
msg := string(b[:n])
log.Printf("Got UDP message from %s: '%s'", addr, msg)
msg := hex.Dump(b[:n])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? The message being sent is a UTF-8 string, why hex encode it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw case that it affected the terminal display.

@oxtoacart
Copy link
Contributor

@ed2k Thanks for submitting this! Please see my comments inline with the code.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling f3099b0 on ed2k:test_tcp into 2e686dd on getlantern:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.33%) when pulling f89bb1a on ed2k:test_tcp into 2e686dd on getlantern:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.33%) when pulling ed3dfe7 on ed2k:test_tcp into 2e686dd on getlantern:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.33%) when pulling bdd4320 on ed2k:test_tcp into 2e686dd on getlantern:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants