]> granicus.if.org Git - libevent/commitdiff
regress_http: disable http/read_on_write_error under win32
authorAzat Khuzhin <a3at.mail@gmail.com>
Mon, 5 Nov 2018 18:33:54 +0000 (21:33 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Mon, 5 Nov 2018 18:37:07 +0000 (21:37 +0300)
EVHTTP_CON_READ_ON_WRITE_ERROR works only if an error already read from
the socket, but if we already got EPIPE on write we cannot read from the
socket anymore, and win32 does not guarantee that read will happens
before (although it happens from time to time).

In the referenced patch I just replaced callback with not expecting 417,
but like I already wrote, this is not always true (i.e. it is flacky).

Fixes: 3b581693ac1967f7f8d98491cb772a1b415eb4cd ("test/http:
read_on_write_error: fix it for win32")

test/regress_http.c
test/regress_main.c

index eb39a5bb27759915530632940e083f47268b5840..4cc0dc067dda63097ab972d914472474c56800c4 100644 (file)
@@ -4081,7 +4081,6 @@ http_large_entity_test_done(struct evhttp_request *req, void *arg)
 end:
        event_base_loopexit(arg, NULL);
 }
-#ifndef WIN32
 static void
 http_expectation_failed_done(struct evhttp_request *req, void *arg)
 {
@@ -4090,7 +4089,6 @@ http_expectation_failed_done(struct evhttp_request *req, void *arg)
 end:
        event_base_loopexit(arg, NULL);
 }
-#endif
 
 static void
 http_data_length_constraints_test_impl(void *arg, int read_on_write_error)
@@ -4107,10 +4105,8 @@ http_data_length_constraints_test_impl(void *arg, int read_on_write_error)
 
        test_ok = 0;
        cb = http_failed_request_done;
-#ifndef WIN32
        if (read_on_write_error)
                cb = http_data_length_constraints_test_done;
-#endif
 
        tt_assert(continue_size < size);
 
@@ -4154,10 +4150,8 @@ http_data_length_constraints_test_impl(void *arg, int read_on_write_error)
        }
        event_base_dispatch(data->base);
 
-#ifndef WIN32
        if (read_on_write_error)
                cb = http_large_entity_test_done;
-#endif
        evhttp_set_max_body_size(http, size - 2);
        req = evhttp_request_new(cb, data->base);
        evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
@@ -4186,10 +4180,8 @@ http_data_length_constraints_test_impl(void *arg, int read_on_write_error)
        }
        event_base_dispatch(data->base);
 
-#ifndef WIN32
        if (read_on_write_error)
                cb = http_expectation_failed_done;
-#endif
        req = evhttp_request_new(cb, data->base);
        evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
        evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "101-continue");
index 094ff23ba2a227cdf9610ccc28cd3795475e2596..a5fda7c5f50c0b73e0d98bdb6f8b24ffd53a8518 100644 (file)
@@ -435,6 +435,7 @@ main(int argc, const char **argv)
 #ifdef _WIN32
        tinytest_skip(testgroups, "http/connection_retry");
        tinytest_skip(testgroups, "http/https_connection_retry");
+       tinytest_skip(testgroups, "http/read_on_write_error");
 #endif
 
 #ifndef EVENT__DISABLE_THREAD_SUPPORT