You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2005/06/14 12:35:33 UTC

svn commit: r190572 - /apr/apr/branches/1.0.x/network_io/unix/sockopt.c

Author: trawick
Date: Tue Jun 14 03:35:30 2005
New Revision: 190572

URL: http://svn.apache.org/viewcvs?rev=190572&view=rev
Log:
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

Modified:
    apr/apr/branches/1.0.x/network_io/unix/sockopt.c

Modified: apr/apr/branches/1.0.x/network_io/unix/sockopt.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.0.x/network_io/unix/sockopt.c?rev=190572&r1=190571&r2=190572&view=diff
==============================================================================
--- apr/apr/branches/1.0.x/network_io/unix/sockopt.c (original)
+++ apr/apr/branches/1.0.x/network_io/unix/sockopt.c Tue Jun 14 03:35:30 2005
@@ -149,11 +149,8 @@
         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 @@
         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;