From: Matt Joiner Date: Tue, 1 Oct 2019 08:13:55 +0000 (+1000) Subject: Add comments X-Git-Tag: v1.8.0~7 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5b0c895e09be3cc026c13bccdb140a20bb77e670;p=btrtrc.git Add comments --- diff --git a/connection.go b/connection.go index f063054f..289d20a8 100644 --- a/connection.go +++ b/connection.go @@ -1065,8 +1065,8 @@ func (c *connection) onReadRequest(r request) error { 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 d7e5f5a7..c0d94e37 100644 --- a/peer_protocol/msg.go +++ b/peer_protocol/msg.go @@ -6,6 +6,8 @@ import ( "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