summaryrefslogtreecommitdiffhomepage
path: root/send.go
diff options
context:
space:
mode:
Diffstat (limited to 'send.go')
-rw-r--r--send.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/send.go b/send.go
index f99bdcd..7423e3b 100644
--- a/send.go
+++ b/send.go
@@ -222,6 +222,9 @@ func (peer *Peer) RoutineNonce() {
// wait for key pair
for {
+
+ peer.event.newKeyPair.Clear()
+
keyPair = peer.keyPairs.Current()
if keyPair != nil && keyPair.sendNonce < RejectAfterMessages {
if time.Now().Sub(keyPair.created) < RejectAfterTime {
@@ -229,12 +232,12 @@ func (peer *Peer) RoutineNonce() {
}
}
- peer.signal.handshakeBegin.Send()
+ peer.event.handshakeBegin.Fire()
logDebug.Println(peer, ": Awaiting key-pair")
select {
- case <-peer.signal.newKeyPair.Wait():
+ case <-peer.event.newKeyPair.C:
logDebug.Println(peer, ": Obtained awaited key-pair")
case <-peer.signal.flushNonceQueue:
goto NextPacket
@@ -392,9 +395,9 @@ func (peer *Peer) RoutineSequentialSender() {
// update timers
- peer.TimerAnyAuthenticatedPacketTraversal()
+ peer.event.anyAuthenticatedPacketTraversal.Fire()
if len(elem.packet) != MessageKeepaliveSize {
- peer.TimerDataSent()
+ peer.event.dataSent.Fire()
}
peer.KeepKeyFreshSending()
}