apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject svn commit: r793193 - /apr/apr/trunk/network_io/unix/sockets.c
Date Sat, 11 Jul 2009 16:12:29 GMT
Author: striker
Date: Sat Jul 11 16:12:29 2009
New Revision: 793193

URL: http://svn.apache.org/viewvc?rev=793193&view=rev
Log:
Fix apr_socket_addr_get() in combination with async connects, for the APR_LOCAL
case.  Before it would return 0.0.0.0:0, instead of the actual local address/port.

TODO: Fix win32 in a similar fashion; though maybe it's better to assume the
  local address is unknown by default...

* network_io/unix/sockets.c
  (apr_socket_connect): Move address determination, or rather
   determining that the local address is unknown, to before returning
   because of e.g. EINPROGRESS.

Modified:
    apr/apr/trunk/network_io/unix/sockets.c

Modified: apr/apr/trunk/network_io/unix/sockets.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockets.c?rev=793193&r1=793192&r2=793193&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sockets.c (original)
+++ apr/apr/trunk/network_io/unix/sockets.c Sat Jul 11 16:12:29 2009
@@ -375,9 +375,6 @@
 #endif /* SO_ERROR */
     }
 
-    if (rc == -1 && errno != EISCONN) {
-        return errno;
-    }
     if (memcmp(sa->ipaddr_ptr, generic_inaddr_any, sa->ipaddr_len)) {
         /* A real remote address was passed in.  If the unspecified
          * address was used, the actual remote addr will have to be
@@ -407,6 +404,11 @@
          */
         sock->local_interface_unknown = 1;
     }
+
+    if (rc == -1 && errno != EISCONN) {
+        return errno;
+    }
+
 #ifndef HAVE_POLL
     sock->connected=1;
 #endif



Mime
View raw message