mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 04:50:37 -04:00
test/http: fix SERVER_TIMEOUT tests under win32
Seems that the hack with filling BACKLOG didn't work on win32, and hence we stuck in write() waiting, not in connect() And: $ time regress http/cancel_server_timeout - on linux: 10secs - on win32: 2-5secs I tried to debug this but you can't sniff TCP packages (wireshark/rawpcap) on localhost in windows xp (according to [RAWPCAP] and my testing). RAWPCAP: http://www.netresec.com/?page=RawCap
This commit is contained in:
parent
376f107318
commit
d49a65879f
@ -1275,6 +1275,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_timed_out_request_done(struct evhttp_request *req, void *arg)
|
http_timed_out_request_done(struct evhttp_request *req, void *arg)
|
||||||
{
|
{
|
||||||
@ -1283,6 +1284,7 @@ http_timed_out_request_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_request_error_cb_with_cancel(enum evhttp_request_error error, void *arg)
|
http_request_error_cb_with_cancel(enum evhttp_request_error error, void *arg)
|
||||||
@ -1366,9 +1368,12 @@ static struct evhttp_request *
|
|||||||
http_cancel_test_bad_request_new(enum http_cancel_test_type type,
|
http_cancel_test_bad_request_new(enum http_cancel_test_type type,
|
||||||
struct event_base *base)
|
struct event_base *base)
|
||||||
{
|
{
|
||||||
|
#ifndef _WIN32
|
||||||
if (!(type & NO_NS) && (type & SERVER_TIMEOUT))
|
if (!(type & NO_NS) && (type & SERVER_TIMEOUT))
|
||||||
return evhttp_request_new(http_timed_out_request_done, base);
|
return evhttp_request_new(http_timed_out_request_done, base);
|
||||||
else if ((type & INACTIVE_SERVER) || (type & NO_NS))
|
else
|
||||||
|
#endif
|
||||||
|
if ((type & INACTIVE_SERVER) || (type & NO_NS))
|
||||||
return evhttp_request_new(http_failed_request_done, base);
|
return evhttp_request_new(http_failed_request_done, base);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user