]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Add comments
authorMatt Joiner <anacrolix@gmail.com>
Tue, 1 Oct 2019 08:13:55 +0000 (18:13 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 1 Oct 2019 08:13:55 +0000 (18:13 +1000)
connection.go
peer_protocol/msg.go

index f063054f3549fcddd239384e83031da7d5e6ced8..289d20a80bd18c6dba13c0bc096a402d468adaaf 100644 (file)
@@ -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 {
index d7e5f5a77482a7dffab3996da84ca7077f33f717..c0d94e3727bb7f1f6b1739d5f634b760f3a31505 100644 (file)
@@ -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