From 3c83faaa1660a70932c14b0fb1f9175b531cdf10 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Apr 2012 01:28:34 +0200 Subject: Add sending of keep-alive packets --- src/fastd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/fastd.c') diff --git a/src/fastd.c b/src/fastd.c index 311af08..373277d 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -207,7 +207,7 @@ static void handle_tasks(fastd_context *ctx) { break; case TASK_HANDSHAKE: - pr_debug(ctx, "Sending handshake to %P...", task->peer); + pr_debug(ctx, "sending handshake to %P...", task->peer); ctx->conf->protocol->handshake_init(ctx, task->peer); if (fastd_peer_is_established(task->peer)) @@ -216,6 +216,11 @@ static void handle_tasks(fastd_context *ctx) { fastd_task_schedule_handshake(ctx, task->peer, 20000); break; + case TASK_KEEPALIVE: + pr_debug(ctx, "sending keepalive to %P", task->peer); + ctx->conf->protocol->send(ctx, task->peer, fastd_buffer_alloc(0, ctx->conf->protocol->min_encrypt_head_space(ctx), 0)); + break; + default: exit_bug(ctx, "invalid task type"); } -- cgit v1.2.3