summaryrefslogtreecommitdiffstats
path: root/src/protocol_null.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol_null.c')
-rw-r--r--src/protocol_null.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/protocol_null.c b/src/protocol_null.c
index 163d164..cc08877 100644
--- a/src/protocol_null.c
+++ b/src/protocol_null.c
@@ -71,6 +71,8 @@ static void establish(fastd_context *ctx, fastd_peer *peer) {
else {
fastd_peer_set_established(ctx, peer);
}
+
+ fastd_task_schedule_keepalive(ctx, peer, ctx->conf->keepalive_interval*1000);
}
static void protocol_handshake_handle(fastd_context *ctx, fastd_peer *peer, const fastd_handshake *handshake) {
@@ -101,10 +103,13 @@ static void protocol_handshake_handle(fastd_context *ctx, fastd_peer *peer, cons
static void protocol_handle_recv(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer) {
if (fastd_peer_is_established(peer) && buffer.len) {
/* this could be optimized a bit */
- fastd_peer_clean_handshakes(ctx, peer);
+ fastd_task_delete_peer_handshakes(ctx, peer);
fastd_peer_seen(ctx, peer);
fastd_task_put_handle_recv(ctx, peer, buffer);
+
+ fastd_task_delete_peer_keepalives(ctx, peer);
+ fastd_task_schedule_keepalive(ctx, peer, ctx->conf->keepalive_interval*1000);
}
else {
fastd_buffer_free(buffer);