summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-04-01 03:43:42 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-04-01 03:43:42 +0200
commit9c1a2e4d393f56872f8c7ed5ad14aee5e4863e92 (patch)
tree2824e9bcf14f6d34e0b331dd55eb371326c7bfd9 /src
parent2155d07a3e720db7e8642941ea97090e606e4aa4 (diff)
downloadfastd-9c1a2e4d393f56872f8c7ed5ad14aee5e4863e92.tar
fastd-9c1a2e4d393f56872f8c7ed5ad14aee5e4863e92.zip
Fix handshakes occuring twice after unexpected data receive
Diffstat (limited to 'src')
-rw-r--r--src/peer.c3
-rw-r--r--src/task.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/peer.c b/src/peer.c
index 74f5649..dd73584 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -153,8 +153,6 @@ fastd_peer* fastd_peer_set_established_merge(fastd_context *ctx, fastd_peer *per
ctx->conf->protocol->free_peer_state(ctx, perm_peer);
- fastd_task_delete_peer_handshakes(ctx, perm_peer);
-
perm_peer->address = temp_peer->address;
perm_peer->state = STATE_ESTABLISHED;
perm_peer->seen = temp_peer->seen;
@@ -170,6 +168,7 @@ fastd_peer* fastd_peer_set_established_merge(fastd_context *ctx, fastd_peer *per
}
fastd_task_replace_peer(ctx, temp_peer, perm_peer);
+ fastd_task_delete_peer_handshakes(ctx, perm_peer);
fastd_peer_reset(ctx, temp_peer);
diff --git a/src/task.c b/src/task.c
index 9526508..c45bbcc 100644
--- a/src/task.c
+++ b/src/task.c
@@ -76,6 +76,8 @@ void fastd_task_schedule_handshake(fastd_context *ctx, fastd_peer *peer, int tim
return;
}
+ pr_debug(ctx, "scheduling handshake with %P", peer);
+
fastd_task *task = malloc(sizeof(fastd_task));
task->type = TASK_HANDSHAKE;