apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r397344 - in /apr/apr/trunk: CHANGES network_io/beos/sendrecv.c network_io/unix/sendrecv.c network_io/win32/sendrecv.c test/testsockets.c
Date Thu, 27 Apr 2006 00:01:54 GMT
Author: rooneg
Date: Wed Apr 26 17:01:52 2006
New Revision: 397344

URL: http://svn.apache.org/viewcvs?rev=397344&view=rev
Log:
Make apr_socket_recvfrom set the port in the from sockaddr.

Submitted by: Anthony Minessale <anthmct@yahoo.com>
PR: 39325

* network_io/win32/sendrecv.c
  (apr_socket_recvfrom): Fill in from->port.

* network_io/unix/sendrecv.c
  (apr_socket_recvfrom): Ditto.

* network_io/beos/sendrecv.c
  (apr_socket_recvfrom): Ditto.

* test/testsockets.c
  (sendto_recievefrom): Zero out the port before calling recvfrom, to
   confirm that it's filled in.

* CHANGES: Note change.

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/network_io/beos/sendrecv.c
    apr/apr/trunk/network_io/unix/sendrecv.c
    apr/apr/trunk/network_io/win32/sendrecv.c
    apr/apr/trunk/test/testsockets.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/CHANGES?rev=397344&r1=397343&r2=397344&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES (original)
+++ apr/apr/trunk/CHANGES Wed Apr 26 17:01:52 2006
@@ -1,5 +1,8 @@
 Changes for APR 1.3.0
 
+  *) Make apr_socket_recvfrom initialize the port field in the from
+     sockaddr.  PR 39325 [Anthony Minessale <anthmct yahoo.com>]
+
   *) NetBSD: Avoid leaving zombie process when using apr_signal() 
      to ignore SIGCHLD.  PR 36750.  [Todd Vierling <tv pobox.com>]
 

Modified: apr/apr/trunk/network_io/beos/sendrecv.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/network_io/beos/sendrecv.c?rev=397344&r1=397343&r2=397344&view=diff
==============================================================================
--- apr/apr/trunk/network_io/beos/sendrecv.c (original)
+++ apr/apr/trunk/network_io/beos/sendrecv.c Wed Apr 26 17:01:52 2006
@@ -203,7 +203,9 @@
         (*len) = 0;
         return errno;
     }
-
+	
+    from->port = ntohs(from->sa.sin.sin_port);
+	
     (*len) = rv;
     if (rv == 0)
         return APR_EOF;

Modified: apr/apr/trunk/network_io/unix/sendrecv.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/network_io/unix/sendrecv.c?rev=397344&r1=397343&r2=397344&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sendrecv.c (original)
+++ apr/apr/trunk/network_io/unix/sendrecv.c Wed Apr 26 17:01:52 2006
@@ -172,6 +172,8 @@
         return errno;
     }
 
+    from->port = ntohs(from->sa.sin.sin_port);
+
     (*len) = rv;
     if (rv == 0 && sock->type == SOCK_STREAM) {
         return APR_EOF;

Modified: apr/apr/trunk/network_io/win32/sendrecv.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/network_io/win32/sendrecv.c?rev=397344&r1=397343&r2=397344&view=diff
==============================================================================
--- apr/apr/trunk/network_io/win32/sendrecv.c (original)
+++ apr/apr/trunk/network_io/win32/sendrecv.c Wed Apr 26 17:01:52 2006
@@ -196,6 +196,9 @@
         (*len) = 0;
         return apr_get_netos_error();
     }
+
+    from->port = ntohs(from->sa.sin.sin_port);
+
     (*len) = rv;
     if (rv == 0 && sock->type == SOCK_STREAM)
         return APR_EOF;

Modified: apr/apr/trunk/test/testsockets.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/test/testsockets.c?rev=397344&r1=397343&r2=397344&view=diff
==============================================================================
--- apr/apr/trunk/test/testsockets.c (original)
+++ apr/apr/trunk/test/testsockets.c Wed Apr 26 17:01:52 2006
@@ -159,6 +159,9 @@
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_INT_EQUAL(tc, STRLEN, len);
 
+    /* Zero out the port so we can be sure it's been set by recvfrom. */
+    from->port = 0;
+
     len = 80;
     rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);



Mime
View raw message