aboutsummaryrefslogtreecommitdiff
path: root/src/transport/tcp/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/tcp/tcp.c')
-rw-r--r--src/transport/tcp/tcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/transport/tcp/tcp.c b/src/transport/tcp/tcp.c
index 419774e1..be0dd2b5 100644
--- a/src/transport/tcp/tcp.c
+++ b/src/transport/tcp/tcp.c
@@ -836,7 +836,9 @@ nni_tcp_ep_setopt_recvmaxsz(void *arg, const void *v, size_t sz, int typ)
int rv;
rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, typ);
if ((rv == 0) && (ep != NULL)) {
+ nni_mtx_lock(&ep->mtx);
ep->rcvmax = val;
+ nni_mtx_unlock(&ep->mtx);
}
return (rv);
}
@@ -849,7 +851,9 @@ nni_tcp_ep_setopt_nodelay(void *arg, const void *v, size_t sz, int typ)
int rv;
rv = nni_copyin_bool(&val, v, sz, typ);
if ((rv == 0) && (ep != NULL)) {
+ nni_mtx_lock(&ep->mtx);
ep->nodelay = val;
+ nni_mtx_unlock(&ep->mtx);
}
return (rv);
}
@@ -869,7 +873,9 @@ nni_tcp_ep_setopt_keepalive(void *arg, const void *v, size_t sz, int typ)
int rv;
rv = nni_copyin_bool(&val, v, sz, typ);
if ((rv == 0) && (ep != NULL)) {
+ nni_mtx_lock(&ep->mtx);
ep->keepalive = val;
+ nni_mtx_unlock(&ep->mtx);
}
return (rv);
}