From df4e56775d2b804db0a2a0a296253fc44e17c945 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 6 May 2019 15:01:42 +0200 Subject: [PATCH] Let be a bit more clever :D --- src/algo_dup2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/algo_dup2.c b/src/algo_dup2.c index 5c4d3d1..076b108 100644 --- a/src/algo_dup2.c +++ b/src/algo_dup2.c @@ -53,9 +53,11 @@ int algo_dup2_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdin bp->ip.ap.str.id = dup2c->emit_id; dup2c->emit_id = dup2c->emit_id + 1; + struct evt_core_cat* cat = evt_core_get_from_cat (ctx, "tcp-write"); + for (int i = 0; i < 2; i++) { // 1. A whole packet has been read, we will find someone to write it - to_fdinfo = evt_core_get_from_url (ctx, url[i]); + to_fdinfo = g_array_index(cat->socklist, struct evt_core_fdinfo*, i); if (to_fdinfo == NULL) { fprintf(stderr, "No fd for URL %s in udp-read.\n", url[i]); continue;