connection.go | 4 ++-- peer_protocol/msg.go | 2 ++ diff --git a/connection.go b/connection.go index f063054f3549fcddd239384e83031da7d5e6ced8..289d20a80bd18c6dba13c0bc096a402d468adaaf 100644 --- a/connection.go +++ b/connection.go @@ -1065,8 +1065,8 @@ c.tickleWriter() return nil } -// Processes incoming bittorrent messages. The client lock is held upon entry -// and exit. Returning will end the connection. +// Processes incoming BitTorrent wire-protocol messages. The client lock is held upon entry and +// exit. Returning will end the connection. func (c *connection) mainReadLoop() (err error) { defer func() { if err != nil { diff --git a/peer_protocol/msg.go b/peer_protocol/msg.go index d7e5f5a77482a7dffab3996da84ca7077f33f717..c0d94e3727bb7f1f6b1739d5f634b760f3a31505 100644 --- a/peer_protocol/msg.go +++ b/peer_protocol/msg.go @@ -6,6 +6,8 @@ "encoding/binary" "fmt" ) +// This is a lazy union representing all the possible fields for messages. Go doesn't have ADTs, and +// I didn't choose to use type-assertions. type Message struct { Keepalive bool Type MessageType