From 58fd88a2237438cb7931cdd6d17de6f1f3c73f2e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 29 Dec 2023 15:40:46 -0800 Subject: tcp and tls: setting recv max on endpoint does not change pipes Again, this was racy code, and not well tested. Set this option before starting the endpoint if you need to be sure. --- src/sp/transport/tcp/tcp.c | 10 ---------- src/sp/transport/tls/tls.c | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/src/sp/transport/tcp/tcp.c b/src/sp/transport/tcp/tcp.c index ba6c546c..1b2a380c 100644 --- a/src/sp/transport/tcp/tcp.c +++ b/src/sp/transport/tcp/tcp.c @@ -1065,18 +1065,8 @@ 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->waitpipes, p) { - p->rcvmax = val; - } - NNI_LIST_FOREACH (&ep->negopipes, p) { - p->rcvmax = val; - } - NNI_LIST_FOREACH (&ep->busypipes, p) { - p->rcvmax = val; - } nni_mtx_unlock(&ep->mtx); #ifdef NNG_ENABLE_STATS nni_stat_set_value(&ep->st_rcv_max, val); diff --git a/src/sp/transport/tls/tls.c b/src/sp/transport/tls/tls.c index e34a3ab2..c6ef90de 100644 --- a/src/sp/transport/tls/tls.c +++ b/src/sp/transport/tls/tls.c @@ -1086,18 +1086,8 @@ tlstran_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_type t) size_t val; int rv; if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == 0) { - tlstran_pipe *p; nni_mtx_lock(&ep->mtx); ep->rcvmax = val; - NNI_LIST_FOREACH (&ep->waitpipes, p) { - p->rcvmax = val; - } - NNI_LIST_FOREACH (&ep->negopipes, p) { - p->rcvmax = val; - } - NNI_LIST_FOREACH (&ep->busypipes, p) { - p->rcvmax = val; - } nni_mtx_unlock(&ep->mtx); #ifdef NNG_ENABLE_STATS nni_stat_set_value(&ep->st_rcv_max, val); -- cgit v1.2.3-70-g09d2