mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 04:19:10 -04:00
make regression test work for poll and select
svn:r265
This commit is contained in:
parent
1a64c982eb
commit
31ba30abfe
3
http.c
3
http.c
@ -1190,6 +1190,9 @@ evhttp_send_error(struct evhttp_request *req, int error, const char *reason)
|
||||
|
||||
struct evbuffer *buf = evbuffer_new();
|
||||
|
||||
/* close the connection on error */
|
||||
evhttp_add_header(req->output_headers, "Connection", "close");
|
||||
|
||||
evhttp_response_code(req, error, reason);
|
||||
|
||||
evbuffer_add_printf(buf, fmt, error, reason);
|
||||
|
@ -163,7 +163,7 @@ http_errorcb(struct bufferevent *bev, short what, void *arg)
|
||||
void
|
||||
http_basic_cb(struct evhttp_request *req, void *arg)
|
||||
{
|
||||
event_debug((stderr, "%s: called\n", __func__));
|
||||
event_debug(("%s: called\n", __func__));
|
||||
|
||||
struct evbuffer *evb = evbuffer_new();
|
||||
evbuffer_add_printf(evb, "This is funny");
|
||||
@ -380,7 +380,7 @@ http_post_test(void)
|
||||
void
|
||||
http_post_cb(struct evhttp_request *req, void *arg)
|
||||
{
|
||||
event_debug((stderr, "%s: called\n", __func__));
|
||||
event_debug(("%s: called\n", __func__));
|
||||
|
||||
/* Yes, we are expecting a post request */
|
||||
if (req->type != EVHTTP_REQ_POST) {
|
||||
@ -447,6 +447,7 @@ http_failure_readcb(struct bufferevent *bev, void *arg)
|
||||
const char *what = "400 Bad Request";
|
||||
if (evbuffer_find(bev->input, what, strlen(what)) != NULL) {
|
||||
test_ok = 2;
|
||||
bufferevent_disable(bev, EV_READ);
|
||||
event_loopexit(NULL);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user