diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2005-06-14 10:28:28 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2005-06-14 10:28:28 +0000 |
commit | 131d77a627b55fa9ed2f21ff43c4003d5360ee63 (patch) | |
tree | 2805e361d60166860e780746084d0f0bf657ab47 /network_io | |
parent | 583c615094b9ec40a53881d202fe314c0c6081bf (diff) | |
download | libapr-131d77a627b55fa9ed2f21ff43c4003d5360ee63.tar.gz |
send and receive buffer sizes are not flags, and caller
may pass different values on different calls; so don't
try to optimize this setsockopt()
SO_LINGER is an odd one; the real setsockopt provides
a configurable value for the timeout; but with APR, this
is a flag and the timeout; so the optimization stays
for this one
Reviewed by: Joe Orton
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.1.x@190570 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/unix/sockopt.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 35eade085..1d069e51e 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -149,11 +149,8 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_SO_SNDBUF: #ifdef SO_SNDBUF - if (apr_is_option_set(sock, APR_SO_SNDBUF) != on) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { - return errno; - } - apr_set_option(sock, APR_SO_SNDBUF, on); + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { + return errno; } #else return APR_ENOTIMPL; @@ -161,11 +158,8 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_SO_RCVBUF: #ifdef SO_RCVBUF - if (apr_is_option_set(sock, APR_SO_RCVBUF) != on) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (void *)&on, sizeof(int)) == -1) { - return errno; - } - apr_set_option(sock, APR_SO_RCVBUF, on); + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (void *)&on, sizeof(int)) == -1) { + return errno; } #else return APR_ENOTIMPL; |