summaryrefslogtreecommitdiffstats
path: root/src/protocols
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-11-17 01:27:47 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-11-17 01:27:47 +0100
commit5082b5a4d2ec52b90e6d7ed178e462a6f0ff6f3e (patch)
treeb3a4e5197bde749bcb7f3dd5354743854325847e /src/protocols
parentcca293a6d474b2bd02a5fbfb1f2fae6179c395d6 (diff)
downloadfastd-5082b5a4d2ec52b90e6d7ed178e462a6f0ff6f3e.tar
fastd-5082b5a4d2ec52b90e6d7ed178e462a6f0ff6f3e.zip
Use task queue for peer resets and keepalives
This makes it unnecessary to iterate over all peers for maintenance, and desynchronizes different peers' keepalives.
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c2
-rw-r--r--src/protocols/ec25519_fhmqvc/handshake.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
index 0696bf0..7f9abe5 100644
--- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
+++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
@@ -192,7 +192,7 @@ static void session_send(fastd_peer_t *peer, fastd_buffer_t buffer, protocol_ses
}
fastd_send(peer->sock, &peer->local_address, &peer->address, peer, send_buffer, stat_size);
- peer->keepalive_timeout = ctx.now + KEEPALIVE_TIMEOUT;
+ fastd_peer_clear_keepalive(peer);
}
/** Encrypts and sends a packet to a peer */
diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c
index 0609355..245b6f4 100644
--- a/src/protocols/ec25519_fhmqvc/handshake.c
+++ b/src/protocols/ec25519_fhmqvc/handshake.c
@@ -163,7 +163,6 @@ static bool establish(fastd_peer_t *peer, const fastd_method_info_t *method, fas
}
peer->establish_handshake_timeout = ctx.now + MIN_HANDSHAKE_INTERVAL;
- fastd_peer_seen(peer);
pr_verbose("new session with %P established using method `%s'%s.", peer, method->name, salt ? "" : " (compat mode)");
@@ -586,6 +585,7 @@ static fastd_peer_t * add_dynamic(fastd_socket_t *sock, const fastd_peer_address
/* Ugly hack */
peer->protocol_state->last_serial--;
+ /* Performs further peer initialization */
fastd_peer_reset(peer);
return peer;