apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r377330 - /apr/apr/trunk/test/testsock.c
Date Mon, 13 Feb 2006 10:02:08 GMT
Author: jorton
Date: Mon Feb 13 02:02:07 2006
New Revision: 377330

URL: http://svn.apache.org/viewcvs?rev=377330&view=rev
Log:
* test/testsock.c (test_get_addr): Fix error handling.

Modified:
    apr/apr/trunk/test/testsock.c

Modified: apr/apr/trunk/test/testsock.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/test/testsock.c?rev=377330&r1=377329&r2=377330&view=diff
==============================================================================
--- apr/apr/trunk/test/testsock.c (original)
+++ apr/apr/trunk/test/testsock.c Mon Feb 13 02:02:07 2006
@@ -254,10 +254,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);
-    ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EINPROGRESS(rv));
-    if (rv && ! APR_STATUS_IS_EINPROGRESS(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