mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 04:50:37 -04:00
test/http: read_on_write_error: fix it for win32
Fixes: https://ci.appveyor.com/project/nmathewson/libevent/build/2.1.5.216#L499 (win32)
This commit is contained in:
parent
7c8999956f
commit
3b581693ac
@ -3783,6 +3783,7 @@ http_failed_request_done(struct evhttp_request *req, void *arg)
|
|||||||
end:
|
end:
|
||||||
event_base_loopexit(arg, NULL);
|
event_base_loopexit(arg, NULL);
|
||||||
}
|
}
|
||||||
|
#ifndef WIN32
|
||||||
static void
|
static void
|
||||||
http_expectation_failed_done(struct evhttp_request *req, void *arg)
|
http_expectation_failed_done(struct evhttp_request *req, void *arg)
|
||||||
{
|
{
|
||||||
@ -3791,6 +3792,7 @@ http_expectation_failed_done(struct evhttp_request *req, void *arg)
|
|||||||
end:
|
end:
|
||||||
event_base_loopexit(arg, NULL);
|
event_base_loopexit(arg, NULL);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
http_data_length_constraints_test_impl(void *arg, int read_on_write_error)
|
http_data_length_constraints_test_impl(void *arg, int read_on_write_error)
|
||||||
@ -3806,8 +3808,10 @@ http_data_length_constraints_test_impl(void *arg, int read_on_write_error)
|
|||||||
|
|
||||||
test_ok = 0;
|
test_ok = 0;
|
||||||
cb = http_failed_request_done;
|
cb = http_failed_request_done;
|
||||||
|
#ifndef WIN32
|
||||||
if (read_on_write_error)
|
if (read_on_write_error)
|
||||||
cb = http_data_length_constraints_test_done;
|
cb = http_data_length_constraints_test_done;
|
||||||
|
#endif
|
||||||
|
|
||||||
http = http_setup(&port, data->base, 0);
|
http = http_setup(&port, data->base, 0);
|
||||||
|
|
||||||
@ -3853,8 +3857,10 @@ http_data_length_constraints_test_impl(void *arg, int read_on_write_error)
|
|||||||
}
|
}
|
||||||
event_base_dispatch(data->base);
|
event_base_dispatch(data->base);
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
if (read_on_write_error)
|
if (read_on_write_error)
|
||||||
cb = http_large_entity_test_done;
|
cb = http_large_entity_test_done;
|
||||||
|
#endif
|
||||||
evhttp_set_max_body_size(http, size - 2);
|
evhttp_set_max_body_size(http, size - 2);
|
||||||
req = evhttp_request_new(cb, data->base);
|
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), "Host", "somehost");
|
||||||
@ -3883,8 +3889,10 @@ http_data_length_constraints_test_impl(void *arg, int read_on_write_error)
|
|||||||
}
|
}
|
||||||
event_base_dispatch(data->base);
|
event_base_dispatch(data->base);
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
if (read_on_write_error)
|
if (read_on_write_error)
|
||||||
cb = http_expectation_failed_done;
|
cb = http_expectation_failed_done;
|
||||||
|
#endif
|
||||||
req = evhttp_request_new(cb, data->base);
|
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), "Host", "somehost");
|
||||||
evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "101-continue");
|
evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "101-continue");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user