-
-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ReceiveEncryptedHandshakeSkeys callback
- Loading branch information
Showing
3 changed files
with
27 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
package torrent | ||
|
||
import ( | ||
"github.com/anacrolix/torrent/mse" | ||
pp "github.com/anacrolix/torrent/peer_protocol" | ||
) | ||
|
||
// These are called synchronously, and do not pass ownership. The Client and other locks may still | ||
// be held. nil functions are not called. | ||
// These are called synchronously, and do not pass ownership of arguments (do not expect to retain | ||
// data after returning from the callback). The Client and other locks may still be held. nil | ||
// functions are not called. | ||
type Callbacks struct { | ||
CompletedHandshake func(_ *PeerConn, infoHash InfoHash) | ||
// Called after a peer connection completes the BitTorrent handshake. The Client lock is not | ||
// held. | ||
CompletedHandshake func(*PeerConn, InfoHash) | ||
ReadMessage func(*PeerConn, *pp.Message) | ||
ReadExtendedHandshake func(*PeerConn, *pp.ExtendedHandshakeMessage) | ||
PeerConnClosed func(*PeerConn) | ||
|
||
// Provides secret keys to be tried against incoming encrypted connections. | ||
ReceiveEncryptedHandshakeSkeys mse.SecretKeyIter | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters