mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-15 07:15:03 -04:00
Update unit test to make sure that the callback happens after the output data is written
This commit is contained in:
parent
da86dda951
commit
b85f398704
@ -742,12 +742,19 @@ static void
|
|||||||
http_sent_cb(struct evhttp_request *req, void *arg)
|
http_sent_cb(struct evhttp_request *req, void *arg)
|
||||||
{
|
{
|
||||||
unsigned int val = (unsigned int)arg;
|
unsigned int val = (unsigned int)arg;
|
||||||
|
struct evbuffer *b;
|
||||||
|
|
||||||
if (val != 0xDEADBEEF) {
|
if (val != 0xDEADBEEF) {
|
||||||
fprintf(stdout, "FAILED on_complete_cb argument\n");
|
fprintf(stdout, "FAILED on_complete_cb argument\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
b = evhttp_request_get_output_buffer(req);
|
||||||
|
if (evbuffer_get_length(b) != 0) {
|
||||||
|
fprintf(stdout, "FAILED on_complete_cb output buffer not written\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
event_debug(("%s: called\n", __func__));
|
event_debug(("%s: called\n", __func__));
|
||||||
|
|
||||||
++test_ok;
|
++test_ok;
|
||||||
@ -792,7 +799,7 @@ http_on_complete_test(void *arg)
|
|||||||
http_errorcb, data->base);
|
http_errorcb, data->base);
|
||||||
|
|
||||||
http_request =
|
http_request =
|
||||||
"DELETE /oncomplete HTTP/1.1\r\n"
|
"GET /oncomplete HTTP/1.1\r\n"
|
||||||
"Host: somehost\r\n"
|
"Host: somehost\r\n"
|
||||||
"Connection: close\r\n"
|
"Connection: close\r\n"
|
||||||
"\r\n";
|
"\r\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user