summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/task.c23
-rw-r--r--src/task.h3
2 files changed, 1 insertions, 25 deletions
diff --git a/src/task.c b/src/task.c
index 729094d..9ed17f7 100644
--- a/src/task.c
+++ b/src/task.c
@@ -79,29 +79,6 @@ void fastd_task_schedule_keepalive(fastd_context_t *ctx, fastd_peer_t *peer, int
fastd_queue_put(ctx, &ctx->task_queue, &task->entry, timeout);
}
-typedef struct replace_peer_extra {
- fastd_peer_t *old_peer;
- fastd_peer_t *new_peer;
-} replace_peer_extra_t;
-
-
-static bool replace_peer(fastd_queue_entry_t *data, void *extra) {
- replace_peer_extra_t *e = extra;
- fastd_task_t *task = container_of(data, fastd_task_t, entry);
- fastd_peer_t *old_peer = e->old_peer;
- fastd_peer_t *new_peer = e->new_peer;
-
- if (task->peer == old_peer)
- task->peer = new_peer;
-
- return true;
-}
-
-void fastd_task_replace_peer(fastd_context_t *ctx, fastd_peer_t *old_peer, fastd_peer_t *new_peer) {
- replace_peer_extra_t extra = {old_peer, new_peer};
- fastd_queue_filter(ctx, &ctx->task_queue, replace_peer, &extra);
-}
-
typedef struct delete_task_extra {
fastd_peer_t *peer;
bool handshake_only;
diff --git a/src/task.h b/src/task.h
index 7f2f005..d80ddd6 100644
--- a/src/task.h
+++ b/src/task.h
@@ -46,7 +46,7 @@ typedef struct fastd_task {
} fastd_task_t;
-static inline int fastd_task_timeout(fastd_context_t *ctx) {
+static inline int fastd_task_timeout(fastd_context_t *ctx) {
return fastd_queue_timeout(ctx, &ctx->task_queue);
}
@@ -56,7 +56,6 @@ fastd_task_t* fastd_task_get(fastd_context_t *ctx);
void fastd_task_schedule_handshake(fastd_context_t *ctx, fastd_peer_t *peer, int timeout);
void fastd_task_schedule_keepalive(fastd_context_t *ctx, fastd_peer_t *peer, int timeout);
-void fastd_task_replace_peer(fastd_context_t *ctx, fastd_peer_t *old_peer, fastd_peer_t *new_peer);
void fastd_task_delete_peer(fastd_context_t *ctx, fastd_peer_t *peer);
void fastd_task_delete_peer_handshakes(fastd_context_t *ctx, fastd_peer_t *peer);
void fastd_task_delete_peer_keepalives(fastd_context_t *ctx, fastd_peer_t *peer);