summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-06-14 13:59:50 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-06-14 13:59:50 +0200
commit223066fe2495b85e958d992108f59047c0cc4928 (patch)
tree2c74725711904ad72278e2ffb5dacf22f95b299c
parent781538295ff7c056ffb5c19c283cfbacd91b243d (diff)
downloadfastd-223066fe2495b85e958d992108f59047c0cc4928.tar
fastd-223066fe2495b85e958d992108f59047c0cc4928.zip
Ensure that peers get their place in the handshake queue even when the async queue is full
When the first resolve return for a newly reset peer is lost, init_handshake() would never be called, and the peer would never get handshakes again. This probably won't ever happen in practice, but since it's easy to fix, better be correct here.
-rw-r--r--src/peer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/peer.c b/src/peer.c
index 5de7831..fc675a9 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -399,6 +399,7 @@ static void setup_peer(fastd_peer_t *peer) {
if (fastd_remote_is_dynamic(next_remote)) {
peer->state = STATE_RESOLVING;
fastd_resolve_peer(peer, next_remote);
+ fastd_peer_schedule_handshake_default(peer);
}
else {
init_handshake(peer);
@@ -818,6 +819,8 @@ void fastd_peer_handle_handshake_queue(void) {
if (fastd_peer_is_established(peer))
return;
+ peer->state = STATE_HANDSHAKE;
+
if (++next_remote->current_address < next_remote->n_addresses)
return;