You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rp...@apache.org on 2010/08/20 17:05:30 UTC

svn commit: r987536 - in /apr/apr/branches/1.3.x: ./ network_io/unix/sockets.c test/NWGNUaprtest test/NWGNUglobalmutexchild test/NWGNUmod_test test/NWGNUproc_child test/NWGNUreadchild test/NWGNUsockchild test/NWGNUtestatmc test/NWGNUtryread

Author: rpluem
Date: Fri Aug 20 15:05:30 2010
New Revision: 987536

URL: http://svn.apache.org/viewvc?rev=987536&view=rev
Log:
Merge r793193 from trunk:

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.

Submitted by: striker
Reviewed by: rpluem

Modified:
    apr/apr/branches/1.3.x/   (props changed)
    apr/apr/branches/1.3.x/network_io/unix/sockets.c
    apr/apr/branches/1.3.x/test/NWGNUaprtest   (props changed)
    apr/apr/branches/1.3.x/test/NWGNUglobalmutexchild   (props changed)
    apr/apr/branches/1.3.x/test/NWGNUmod_test   (props changed)
    apr/apr/branches/1.3.x/test/NWGNUproc_child   (props changed)
    apr/apr/branches/1.3.x/test/NWGNUreadchild   (props changed)
    apr/apr/branches/1.3.x/test/NWGNUsockchild   (props changed)
    apr/apr/branches/1.3.x/test/NWGNUtestatmc   (props changed)
    apr/apr/branches/1.3.x/test/NWGNUtryread   (props changed)

Propchange: apr/apr/branches/1.3.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 15:05:30 2010
@@ -1,2 +1,2 @@
 /apr/apr/branches/1.4.x:783970
-/apr/apr/trunk:712674,733052,742752,747990,748361,748371,748565,748902,748988,749810,760443,782838,783398,783958,788588,794485,795267,799497,800627,809854,829490,831641,835607,905040,908427,910419
+/apr/apr/trunk:712674,733052,742752,747990,748361,748371,748565,748902,748988,749810,760443,782838,783398,783958,788588,793193,794485,795267,799497,800627,809854,829490,831641,835607,905040,908427,910419

Modified: apr/apr/branches/1.3.x/network_io/unix/sockets.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/network_io/unix/sockets.c?rev=987536&r1=987535&r2=987536&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/network_io/unix/sockets.c (original)
+++ apr/apr/branches/1.3.x/network_io/unix/sockets.c Fri Aug 20 15:05:30 2010
@@ -338,9 +338,6 @@ apr_status_t apr_socket_connect(apr_sock
 #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
@@ -364,6 +361,11 @@ apr_status_t apr_socket_connect(apr_sock
          */
         sock->local_interface_unknown = 1;
     }
+
+    if (rc == -1 && errno != EISCONN) {
+        return errno;
+    }
+
 #ifndef HAVE_POLL
     sock->connected=1;
 #endif

Propchange: apr/apr/branches/1.3.x/test/NWGNUaprtest
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 15:05:30 2010
@@ -1,3 +1,3 @@
 /apr/apr/branches/1.4.x/test/nwgnuaprtest:783970
-/apr/apr/trunk/test/NWGNUaprtest:794485,795267,799497,800627,809854,829490,831641,908427,910419
+/apr/apr/trunk/test/NWGNUaprtest:793193,794485,795267,799497,800627,809854,829490,831641,908427,910419
 /apr/apr/trunk/test/nwgnuaprtest:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588

Propchange: apr/apr/branches/1.3.x/test/NWGNUglobalmutexchild
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 15:05:30 2010
@@ -1,3 +1,3 @@
 /apr/apr/branches/1.4.x/test/nwgnuglobalmutexchild:783970
-/apr/apr/trunk/test/NWGNUglobalmutexchild:794485,795267,799497,800627,809854,829490,831641,908427,910419
+/apr/apr/trunk/test/NWGNUglobalmutexchild:793193,794485,795267,799497,800627,809854,829490,831641,908427,910419
 /apr/apr/trunk/test/nwgnuglobalmutexchild:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588

Propchange: apr/apr/branches/1.3.x/test/NWGNUmod_test
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 15:05:30 2010
@@ -1,3 +1,3 @@
 /apr/apr/branches/1.4.x/test/nwgnumod_test:783970
-/apr/apr/trunk/test/NWGNUmod_test:794485,795267,799497,800627,809854,829490,831641,908427,910419
+/apr/apr/trunk/test/NWGNUmod_test:793193,794485,795267,799497,800627,809854,829490,831641,908427,910419
 /apr/apr/trunk/test/nwgnumod_test:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588

Propchange: apr/apr/branches/1.3.x/test/NWGNUproc_child
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 15:05:30 2010
@@ -1,3 +1,3 @@
 /apr/apr/branches/1.4.x/test/nwgnuproc_child:783970
-/apr/apr/trunk/test/NWGNUproc_child:794485,795267,799497,800627,809854,829490,831641,908427,910419
+/apr/apr/trunk/test/NWGNUproc_child:793193,794485,795267,799497,800627,809854,829490,831641,908427,910419
 /apr/apr/trunk/test/nwgnuproc_child:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588

Propchange: apr/apr/branches/1.3.x/test/NWGNUreadchild
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 15:05:30 2010
@@ -1,3 +1,3 @@
 /apr/apr/branches/1.4.x/test/nwgnureadchild:783970
-/apr/apr/trunk/test/NWGNUreadchild:794485,795267,799497,800627,809854,829490,831641,908427,910419
+/apr/apr/trunk/test/NWGNUreadchild:793193,794485,795267,799497,800627,809854,829490,831641,908427,910419
 /apr/apr/trunk/test/nwgnureadchild:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588

Propchange: apr/apr/branches/1.3.x/test/NWGNUsockchild
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 15:05:30 2010
@@ -1,3 +1,3 @@
 /apr/apr/branches/1.4.x/test/nwgnusockchild:783970
-/apr/apr/trunk/test/NWGNUsockchild:794485,795267,799497,800627,809854,829490,831641,908427,910419
+/apr/apr/trunk/test/NWGNUsockchild:793193,794485,795267,799497,800627,809854,829490,831641,908427,910419
 /apr/apr/trunk/test/nwgnusockchild:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588

Propchange: apr/apr/branches/1.3.x/test/NWGNUtestatmc
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 15:05:30 2010
@@ -1,3 +1,3 @@
 /apr/apr/branches/1.4.x/test/nwgnutestatmc:783970
-/apr/apr/trunk/test/NWGNUtestatmc:794485,795267,799497,800627,809854,829490,831641,908427,910419
+/apr/apr/trunk/test/NWGNUtestatmc:793193,794485,795267,799497,800627,809854,829490,831641,908427,910419
 /apr/apr/trunk/test/nwgnutestatmc:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588

Propchange: apr/apr/branches/1.3.x/test/NWGNUtryread
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 15:05:30 2010
@@ -1,3 +1,3 @@
 /apr/apr/branches/1.4.x/test/nwgnutryread:783970
-/apr/apr/trunk/test/NWGNUtryread:794485,795267,799497,800627,809854,829490,831641,908427,910419
+/apr/apr/trunk/test/NWGNUtryread:793193,794485,795267,799497,800627,809854,829490,831641,908427,910419
 /apr/apr/trunk/test/nwgnutryread:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588