From fb03061dfd20f0d85f73d22380acf5b8f88cf6b3 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 3 Jan 2025 08:07:29 -0800 Subject: ipc: minor adjustments for ECLOSED and logging --- src/nng.c | 6 ------ src/sp/transport/ipc/ipc.c | 10 +++++++--- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/nng.c b/src/nng.c index 7cd06b77..363d4d28 100644 --- a/src/nng.c +++ b/src/nng.c @@ -1359,12 +1359,6 @@ nng_pipe_get_size(nng_pipe id, const char *n, size_t *v) return (pipe_get(id, n, v, NULL, NNI_TYPE_SIZE)); } -int -nng_pipe_get_uint64(nng_pipe id, const char *n, uint64_t *v) -{ - return (pipe_get(id, n, v, NULL, NNI_TYPE_UINT64)); -} - int nng_pipe_get_string(nng_pipe id, const char *n, char **v) { diff --git a/src/sp/transport/ipc/ipc.c b/src/sp/transport/ipc/ipc.c index 997e1712..a7b816a6 100644 --- a/src/sp/transport/ipc/ipc.c +++ b/src/sp/transport/ipc/ipc.c @@ -172,6 +172,10 @@ ipc_pipe_nego_cb(void *arg) int rv; nni_mtx_lock(&ep->mtx); + if (ep->closed) { + rv = NNG_ECLOSED; + goto error; + } if ((rv = nni_aio_result(aio)) != 0) { goto error; } @@ -337,9 +341,9 @@ ipc_pipe_recv_cb(void *arg) // Make sure the message payload is not too big. If it is // the caller will shut down the pipe. if ((len > p->rcv_max) && (p->rcv_max > 0)) { - uint64_t pid; - char peer[64] = ""; - if (nng_stream_get_uint64( + int pid; + char peer[64] = ""; + if (nng_stream_get_int( p->conn, NNG_OPT_PEER_PID, &pid) == 0) { snprintf(peer, sizeof(peer), " from PID %lu", (unsigned long) pid); -- cgit v1.2.3-70-g09d2