Add comments
This commit is contained in:
parent
efc1195ba2
commit
5b0c895e09
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue