diff --git a/src/algo_naive.c b/src/algo_naive.c index d704fec..1957230 100644 --- a/src/algo_naive.c +++ b/src/algo_naive.c @@ -166,7 +166,11 @@ void on_tcp_read(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { // 3. A whole packet has been read, we will find someone to write it sprintf(url, "udp:write:127.0.0.1:%d", bp->ip.ap.str.port); to_fdinfo = evt_core_get_from_url (ctx, url); - if (to_fdinfo == NULL) goto co_error; + if (to_fdinfo == NULL) { + fprintf(stderr, "No fd for URL %s in tcp-read. Dropping packet :( \n", url); + mv_buffer_wtor (app_ctx, fdinfo, bp); + return; + } // 4. We move the buffer and notify the target mv_buffer_rtow (app_ctx, fdinfo, to_fdinfo, bp); @@ -223,7 +227,11 @@ void on_udp_read(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { // 3. A whole packet has been read, we will find someone to write it sprintf(url, "tcp:write:127.0.0.1:7500"); to_fdinfo = evt_core_get_from_url (ctx, url); - if (to_fdinfo == NULL) goto co_error; + if (to_fdinfo == NULL) { + fprintf(stderr, "No fd for URL %s in udp-read. Dropping packet :( \n", url); + mv_buffer_wtor (app_ctx, fdinfo, bp); + return; + } // 4. We move the buffer and notify the target mv_buffer_rtow (app_ctx, fdinfo, to_fdinfo, bp);