Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 77642 invoked from network); 14 Oct 2007 23:08:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Oct 2007 23:08:48 -0000 Received: (qmail 13072 invoked by uid 500); 14 Oct 2007 23:08:36 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 13033 invoked by uid 500); 14 Oct 2007 23:08:36 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 13022 invoked by uid 99); 14 Oct 2007 23:08:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Oct 2007 16:08:36 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Oct 2007 23:08:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2CD001A9832; Sun, 14 Oct 2007 16:08:28 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r584635 - /apr/apr/branches/1.2.x/test/testsockets.c Date: Sun, 14 Oct 2007 23:08:27 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071014230828.2CD001A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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)