Skip to content

Commit

Permalink
tcp and tls: setting recv max on endpoint does not change pipes
Browse files Browse the repository at this point in the history
Again, this was racy code, and not well tested.  Set this option
before starting the endpoint if you need to be sure.
  • Loading branch information
gdamore committed Dec 29, 2023
1 parent 0c6f6b8 commit 58fd88a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
10 changes: 0 additions & 10 deletions src/sp/transport/tcp/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 0 additions & 10 deletions src/sp/transport/tls/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 58fd88a

Please sign in to comment.