diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2005-06-14 10:41:20 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2005-06-14 10:41:20 +0000 |
commit | 6fbd505ff041096d4f20b88ad78c023f2ea6e561 (patch) | |
tree | ce358d6231ccdbb2bd641ea7c483ed8c285d65c5 | |
parent | 7330fecd42c4b4d711f48fb777eb28480d0a599e (diff) | |
download | libapr-6fbd505ff041096d4f20b88ad78c023f2ea6e561.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 is hardcoded; so the optimization
stays for this one
Reviewed by: Joe Orton
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x@190574 13f79535-47bb-0310-9956-ffa450edef68
-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 458097390..cb66667d8 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -151,11 +151,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->netmask, APR_SO_SNDBUF) != on) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { - return errno; - } - apr_set_option(&sock->netmask, APR_SO_SNDBUF, on); + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { + return errno; } #else return APR_ENOTIMPL; @@ -163,11 +160,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->netmask, APR_SO_RCVBUF) != on) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (void *)&on, sizeof(int)) == -1) { - return errno; - } - apr_set_option(&sock->netmask, APR_SO_RCVBUF, on); + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (void *)&on, sizeof(int)) == -1) { + return errno; } #else return APR_ENOTIMPL; |