summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-04-02 01:28:34 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-04-02 01:28:34 +0200
commit3c83faaa1660a70932c14b0fb1f9175b531cdf10 (patch)
tree920f34939c1cabafed056bbd6f51898991616e85 /src/fastd.c
parent9e45032bd53d07e78c2ec41f1ae9d0d75e4910ce (diff)
downloadfastd-3c83faaa1660a70932c14b0fb1f9175b531cdf10.tar
fastd-3c83faaa1660a70932c14b0fb1f9175b531cdf10.zip
Add sending of keep-alive packets
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c7
1 files changed, 6 insertions, 1 deletions
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");
}