From 8d6ada3f3337d8f1d47920a24dce88df285de309 Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:04:01 +0100 Subject: [PATCH] simplify threaded dispatcher error path --- src/thread.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/thread.c b/src/thread.c index d66d45128..32bda01bd 100644 --- a/src/thread.c +++ b/src/thread.c @@ -637,13 +637,8 @@ static void rnng_dispatch_thread(void *args) { nng_ctx_send(ctx[i], saio[i]->aio); nng_ctx_recv(ctx[i], raio[i]->aio); } else { - nng_msg_alloc(&msg, 0); - nng_msg_append(msg, (unsigned char *) &xc, sizeof(int)); - if ((xc = nng_ctx_sendmsg(rctx[i], msg, 0))) - nng_msg_free(msg); - nng_ctx_close(rctx[i]); - nng_ctx_open(&rctx[i], hsock); - nng_ctx_recv(rctx[i], haio[i]->aio); + // should never reach here + goto exitlevel2; } break; }