aboutsummaryrefslogtreecommitdiff
path: root/src
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
parent960e96723f6cfe64c370b7c1168c664f4c49deae (diff)
downloadnng-fb03061dfd20f0d85f73d22380acf5b8f88cf6b3.tar.gz
nng-fb03061dfd20f0d85f73d22380acf5b8f88cf6b3.tar.bz2
nng-fb03061dfd20f0d85f73d22380acf5b8f88cf6b3.zip
ipc: minor adjustments for ECLOSED and logging
Diffstat (limited to 'src')
-rw-r--r--src/nng.c6
-rw-r--r--src/sp/transport/ipc/ipc.c10
2 files changed, 7 insertions, 9 deletions
diff --git a/src/nng.c b/src/nng.c
index 7cd06b77..363d4d28 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -1360,12 +1360,6 @@ nng_pipe_get_size(nng_pipe id, const char *n, size_t *v)
}
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)
{
return (pipe_get(id, n, v, NULL, NNI_TYPE_STRING));
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);