aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-03 08:07:29 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-03 08:38:19 -0800
commitfb03061dfd20f0d85f73d22380acf5b8f88cf6b3 (patch)
treef961de7cfb564adb13732265c0617b978b74a992 /src/sp/transport
parent960e96723f6cfe64c370b7c1168c664f4c49deae (diff)
downloadnng-fb03061dfd20f0d85f73d22380acf5b8f88cf6b3.tar.gz
nng-fb03061dfd20f0d85f73d22380acf5b8f88cf6b3.tar.bz2
nng-fb03061dfd20f0d85f73d22380acf5b8f88cf6b3.zip
ipc: minor adjustments for ECLOSED and logging
Diffstat (limited to 'src/sp/transport')
-rw-r--r--src/sp/transport/ipc/ipc.c10
1 files changed, 7 insertions, 3 deletions
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);