]> granicus.if.org Git - apache/commitdiff
update pollset to reflect changed connection state before closing the socket;
authorJeff Trawick <trawick@apache.org>
Fri, 6 Nov 2009 22:33:37 +0000 (22:33 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 6 Nov 2009 22:33:37 +0000 (22:33 +0000)
otherwise the pollset-remove can crash (at least with select-based poll, since
fd is now -1)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@833583 13f79535-47bb-0310-9956-ffa450edef68

support/ab.c

index 0baf8ce7aab83fd73e77692c9488965099bca1e0..d818d23d9afc3858677906bca80fe6872d5dc3fd 100644 (file)
@@ -1784,6 +1784,7 @@ static void test(void)
                 if (c->state == STATE_CONNECTING) {
                     rv = apr_socket_connect(c->aprsock, destsa);
                     if (rv != APR_SUCCESS) {
+                        set_conn_state(c, STATE_UNCONNECTED);
                         apr_socket_close(c->aprsock);
                         err_conn++;
                         if (bad++ > 10) {
@@ -1791,7 +1792,6 @@ static void test(void)
                                     "\nTest aborted after 10 failures\n\n");
                             apr_err("apr_socket_connect()", rv);
                         }
-                        set_conn_state(c, STATE_UNCONNECTED);
                         start_connect(c);
                         continue;
                     }