void
test_evbuffer(void) {
- setup_test("Evbuffer: ");
struct evbuffer *evb = evbuffer_new();
+ setup_test("Evbuffer: ");
evbuffer_add_printf(evb, "%s/%d", "hello", 1);
if (evbuffer_find(bev->input, (const unsigned char*) what, strlen(what)) != NULL) {
struct evhttp_request *req = evhttp_request_new(NULL, NULL);
+ int done;
+
req->kind = EVHTTP_RESPONSE;
- int done = evhttp_parse_lines(req, bev->input);
+ done = evhttp_parse_lines(req, bev->input);
if (done == 1 &&
evhttp_find_header(req->input_headers,
void
http_basic_cb(struct evhttp_request *req, void *arg)
{
- event_debug(("%s: called\n", __func__));
struct evbuffer *evb = evbuffer_new();
+ event_debug(("%s: called\n", __func__));
evbuffer_add_printf(evb, "This is funny");
evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
void
http_post_cb(struct evhttp_request *req, void *arg)
{
+ struct evbuffer *evb;
event_debug(("%s: called\n", __func__));
/* Yes, we are expecting a post request */
exit(1);
}
- struct evbuffer *evb = evbuffer_new();
+ evb = evbuffer_new();
evbuffer_add_printf(evb, "This is funny");
evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);