From 174e0191ff2cfeeaf434d9119603b675de6807f6 Mon Sep 17 00:00:00 2001 From: Cody Piersall Date: Sun, 16 Dec 2018 10:56:46 -0600 Subject: Allow recv_maxsize to be set after calling listen() on listener. (#747) fixes #724 set recvmaxsize after listen for tcp. --- src/transport/ipc/ipc.c | 4 ++++ src/transport/tcp/tcp.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/transport/ipc/ipc.c b/src/transport/ipc/ipc.c index 030d6bfe..d6280a69 100644 --- a/src/transport/ipc/ipc.c +++ b/src/transport/ipc/ipc.c @@ -872,8 +872,12 @@ ipctran_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_opt_type t) size_t val; int rv; if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == 0) { + ipctran_pipe *p; nni_mtx_lock(&ep->mtx); ep->rcvmax = val; + NNI_LIST_FOREACH (&ep->pipes, p) { + p->rcvmax = val; + } nni_mtx_unlock(&ep->mtx); } return (rv); diff --git a/src/transport/tcp/tcp.c b/src/transport/tcp/tcp.c index fed8872c..be8f6bc3 100644 --- a/src/transport/tcp/tcp.c +++ b/src/transport/tcp/tcp.c @@ -997,8 +997,12 @@ tcptran_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_opt_type t) size_t val; int rv; if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == 0) { + tcptran_pipe *p; nni_mtx_lock(&ep->mtx); ep->rcvmax = val; + NNI_LIST_FOREACH (&ep->pipes, p) { + p->rcvmax = val; + } nni_mtx_unlock(&ep->mtx); } return (rv); -- cgit v1.2.3-70-g09d2