apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r377332 - /apr/apr/branches/1.2.x/test/testsock.c
Date Mon, 13 Feb 2006 10:04:23 GMT
Author: jorton
Date: Mon Feb 13 02:04:22 2006
New Revision: 377332

URL: http://svn.apache.org/viewcvs?rev=377332&view=rev
Log:
Merge r377330 from trunk:

* test/testsock.c (test_get_addr): Fix error handling.

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

Modified: apr/apr/branches/1.2.x/test/testsock.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/test/testsock.c?rev=377332&r1=377331&r2=377332&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/test/testsock.c (original)
+++ apr/apr/branches/1.2.x/test/testsock.c Mon Feb 13 02:04:22 2006
@@ -227,10 +227,19 @@
     APR_ASSERT_SUCCESS(tc, "enable non-block mode",
                        apr_socket_opt_set(cd, APR_SO_NONBLOCK, 1));
 
+    /* It is valid for a connect() on a socket with NONBLOCK set to
+     * succeed (if the connection can be established synchronously),
+     * but if it does, this test cannot proceed.  */
     rv = apr_socket_connect(cd, sa);
-    APR_ASSERT_SUCCESS(tc, "make the connection", rv);
-    if (rv)
+    if (rv == APR_SUCCESS) {
+        apr_socket_close(ld);
+        apr_socket_close(cd);
+        ABTS_NOT_IMPL(tc, "Cannot test if connect completes "
+                      "synchronously");
         return;
+    }
+
+    ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EINPROGRESS(rv));
 
     APR_ASSERT_SUCCESS(tc, "accept connection",
                        apr_socket_accept(&sd, ld, p));



Mime
View raw message