From 7643626bcf38aee7cb9f44d518401047d1c34c76 Mon Sep 17 00:00:00 2001 From: Aleksei Solovev Date: Sun, 8 Dec 2024 15:54:13 +0300 Subject: fixes #1959 Occasional SIGSEGV in nng_recv_aio() on a respondent socket --- src/sp/protocol/survey0/respond.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sp/protocol') diff --git a/src/sp/protocol/survey0/respond.c b/src/sp/protocol/survey0/respond.c index 8a8c134b..c8733e32 100644 --- a/src/sp/protocol/survey0/respond.c +++ b/src/sp/protocol/survey0/respond.c @@ -334,6 +334,10 @@ resp0_pipe_close(void *arg) nni_mtx_lock(&s->mtx); p->closed = true; + if (nni_list_active(&s->recvpipes, p)) { + // We are no longer "receivable". + nni_list_remove(&s->recvpipes, p); + } while ((ctx = nni_list_first(&p->sendq)) != NULL) { nni_aio *aio; nni_msg *msg; -- cgit v1.2.3-70-g09d2