apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r190574 - /apr/apr/branches/0.9.x/network_io/unix/sockopt.c
Date Tue, 14 Jun 2005 10:41:21 GMT
Author: trawick
Date: Tue Jun 14 03:41:20 2005
New Revision: 190574

URL: http://svn.apache.org/viewcvs?rev=190574&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/0.9.x/network_io/unix/sockopt.c

Modified: apr/apr/branches/0.9.x/network_io/unix/sockopt.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/network_io/unix/sockopt.c?rev=190574&r1=190573&r2=190574&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/network_io/unix/sockopt.c (original)
+++ apr/apr/branches/0.9.x/network_io/unix/sockopt.c Tue Jun 14 03:41:20 2005
@@ -151,11 +151,8 @@
         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 @@
         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;



Mime
View raw message