make regression test work for poll and select

svn:r265
This commit is contained in:
Niels Provos 2006-11-18 08:51:12 +00:00
parent 1a64c982eb
commit 31ba30abfe
2 changed files with 6 additions and 2 deletions

3
http.c
View File

@ -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);

View File

@ -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);
}
}