apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r584635 - /apr/apr/branches/1.2.x/test/testsockets.c
Date Sun, 14 Oct 2007 23:08:27 GMT
Author: wrowe
Date: Sun Oct 14 16:08:27 2007
New Revision: 584635

URL: http://svn.apache.org/viewvc?rev=584635&view=rev
Log:
Copy this test to live, we should be certain things are
healthy on the released branch too.

Modified:
    apr/apr/branches/1.2.x/test/testsockets.c

Modified: apr/apr/branches/1.2.x/test/testsockets.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/testsockets.c?rev=584635&r1=584634&r2=584635&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/test/testsockets.c (original)
+++ apr/apr/branches/1.2.x/test/testsockets.c Sun Oct 14 16:08:27 2007
@@ -103,7 +103,8 @@
 #endif
 }
 
-static void sendto_receivefrom_helper(abts_case *tc, const char *addr, int family)
+static void sendto_receivefrom_helper(abts_case *tc, const char *addr, 
+                                      const char *junkaddr, int family)
 {
     apr_status_t rv;
     apr_socket_t *sock = NULL;
@@ -150,6 +151,11 @@
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_SIZE_EQUAL(tc, STRLEN, len);
 
+    /* fill the "from" sockaddr with a random address to ensure that
+     * recvfrom sets it up properly. */
+    rv = apr_sockaddr_info_get(&from, junkaddr, family, 4242, 0, p);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+
     len = 80;
     rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
@@ -167,10 +173,10 @@
 
 static void sendto_receivefrom(abts_case *tc, void *data)
 {
+    sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
 #if APR_HAVE_IPV6
-    sendto_receivefrom_helper(tc, "::1", APR_INET6);
+    sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
 #endif
-    sendto_receivefrom_helper(tc, "127.0.0.1", APR_INET);
 }
 
 static void socket_userdata(abts_case *tc, void *data)



Mime
View raw message