apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r480212 - in /apr/apr/trunk/network_io: os2/sockets.c win32/sockets.c
Date Tue, 28 Nov 2006 21:24:41 GMT
Author: wrowe
Date: Tue Nov 28 13:24:40 2006
New Revision: 480212

URL: http://svn.apache.org/viewvc?view=rev&rev=480212
Log:
Sync Win32/OS2 unknown remote_addr and local_port flags to unix src.

Reviewed by wrowe and jorton

Modified:
    apr/apr/trunk/network_io/os2/sockets.c
    apr/apr/trunk/network_io/win32/sockets.c

Modified: apr/apr/trunk/network_io/os2/sockets.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/os2/sockets.c?view=diff&rev=480212&r1=480211&r2=480212
==============================================================================
--- apr/apr/trunk/network_io/os2/sockets.c (original)
+++ apr/apr/trunk/network_io/os2/sockets.c Tue Nov 28 13:24:40 2006
@@ -62,9 +62,11 @@
     (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool,
                                                        sizeof(apr_sockaddr_t));
     (*new)->local_addr->pool = p;
+
     (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool,
                                                         sizeof(apr_sockaddr_t));
     (*new)->remote_addr->pool = p;
+    (*new)->remote_addr_unknown = 1;
 
     /* Create a pollset with room for one descriptor. */
     /* ### check return codes */
@@ -140,6 +142,10 @@
         return APR_OS2_STATUS(sock_errno());
     else {
         sock->local_addr = sa;
+        /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */
+        if (sock->local_addr->sa.sin.sin_port == 0) { /* no need for ntohs() when comparing
w/ 0 */
+            sock->local_port_unknown = 1; /* kernel got us an ephemeral port */
+        }
         return APR_SUCCESS;
     }
 }

Modified: apr/apr/trunk/network_io/win32/sockets.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/win32/sockets.c?view=diff&rev=480212&r1=480211&r2=480212
==============================================================================
--- apr/apr/trunk/network_io/win32/sockets.c (original)
+++ apr/apr/trunk/network_io/win32/sockets.c Tue Nov 28 13:24:40 2006
@@ -59,9 +59,11 @@
     (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool,
                                                        sizeof(apr_sockaddr_t));
     (*new)->local_addr->pool = p;
+    
     (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool,
                                                         sizeof(apr_sockaddr_t));
     (*new)->remote_addr->pool = p;
+    (*new)->remote_addr_unknown = 1;
 
     /* Create a pollset with room for one descriptor. */
     /* ### check return codes */



Mime
View raw message