Lines Matching +full:port +full:- +full:base

2  * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
3 * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
27 #include "util-internal.h"
35 #include "event2/event-config.h"
64 #include "log-internal.h"
65 #include "http-internal.h"
71 /* set if a test needs to call loopexit on a base */
95 int port; in http_bind() local
106 return -1; in http_bind()
111 port = regress_get_socket_port(evhttp_bound_socket_get_fd(sock)); in http_bind()
112 if (port < 0) in http_bind()
113 return -1; in http_bind()
114 *pport = (ev_uint16_t) port; in http_bind()
121 https_bev(struct event_base *base, void *arg) in https_bev() argument
129 base, -1, ssl, BUFFEREVENT_SSL_ACCEPTING, in https_bev()
134 http_setup_gencb(ev_uint16_t *pport, struct event_base *base, int mask, in http_setup_gencb() argument
140 myhttp = evhttp_new(base); in http_setup_gencb()
157 evhttp_set_cb(myhttp, "/large", http_large_cb, base); in http_setup_gencb()
158 evhttp_set_cb(myhttp, "/chunked", http_chunked_cb, base); in http_setup_gencb()
159 evhttp_set_cb(myhttp, "/streamed", http_chunked_cb, base); in http_setup_gencb()
160 evhttp_set_cb(myhttp, "/postit", http_post_cb, base); in http_setup_gencb()
161 evhttp_set_cb(myhttp, "/putit", http_put_cb, base); in http_setup_gencb()
162 evhttp_set_cb(myhttp, "/deleteit", http_delete_cb, base); in http_setup_gencb()
163 evhttp_set_cb(myhttp, "/delay", http_delay_cb, base); in http_setup_gencb()
164 evhttp_set_cb(myhttp, "/largedelay", http_large_delay_cb, base); in http_setup_gencb()
165 evhttp_set_cb(myhttp, "/badrequest", http_badreq_cb, base); in http_setup_gencb()
166 evhttp_set_cb(myhttp, "/oncomplete", http_on_complete_cb, base); in http_setup_gencb()
167 evhttp_set_cb(myhttp, "/", http_dispatcher_cb, base); in http_setup_gencb()
171 http_setup(ev_uint16_t *pport, struct event_base *base, int mask) in http_setup() argument
172 { return http_setup_gencb(pport, base, mask, NULL, NULL); } in http_setup()
179 http_connect(const char *address, ev_uint16_t port) in http_connect() argument
192 evutil_snprintf(strport, sizeof(strport), "%d", port); in http_connect()
195 return (-1); in http_connect()
197 sa = aitop->ai_addr; in http_connect()
198 slen = aitop->ai_addrlen; in http_connect()
201 if (fd == -1) in http_connect()
205 if (connect(fd, sa, slen) == -1) { in http_connect()
232 return -1; in evbuffer_datacmp()
252 return ptr.pos != -1; in evbuffer_contains()
265 /* req->kind = EVHTTP_RESPONSE; */ in http_readcb()
276 "Content-Type") != NULL) in http_readcb()
309 test_ok = -2; in http_errorcb()
336 if (sa->sa_family == AF_INET) { in http_basic_cb()
339 } else if (sa->sa_family == AF_INET6) { in http_basic_cb()
347 /* For multi-line headers test */ in http_basic_cb()
350 evhttp_find_header(evhttp_request_get_input_headers(req),"X-Multi"); in http_basic_cb()
353 if (strcmp("END", multi + strlen(multi) - 3) == 0) in http_basic_cb()
355 if (evhttp_find_header(evhttp_request_get_input_headers(req), "X-Last")) in http_basic_cb()
361 evhttp_find_header(evhttp_request_get_input_headers(req),"X-Multi-Extra-WS"); in http_basic_cb()
368 /* injecting a bad content-length */ in http_basic_cb()
369 if (evhttp_find_header(evhttp_request_get_input_headers(req), "X-Negative")) in http_basic_cb()
371 "Content-Length", "-100"); in http_basic_cb()
391 event_base_once(exit_base, -1, EV_TIMEOUT, in http_timeout_cb()
415 struct event_base *base; member
427 evbuffer_add_printf(evb, "%s", CHUNKS[state->i]); in http_chunked_trickle_cb()
428 evhttp_send_reply_chunk(state->req, evb); in http_chunked_trickle_cb()
431 if (++state->i < (int) (sizeof(CHUNKS)/sizeof(CHUNKS[0]))) { in http_chunked_trickle_cb()
432 event_base_once(state->base, -1, EV_TIMEOUT, in http_chunked_trickle_cb()
435 evhttp_send_reply_end(state->req); in http_chunked_trickle_cb()
448 state->req = req; in http_chunked_cb()
449 state->base = arg; in http_chunked_cb()
452 evhttp_add_header(evhttp_request_get_output_headers(req), "Content-Length", "39"); in http_chunked_cb()
460 event_base_once(arg, -1, EV_TIMEOUT, http_chunked_trickle_cb, state, &when); in http_chunked_cb()
464 create_bev(struct event_base *base, evutil_socket_t fd, int ssl_mask, int flags_) in create_bev() argument
470 bev = bufferevent_socket_new(base, fd, flags); in create_bev()
476 bufferevent_socket_new(base, fd, flags); in create_bev()
478 base, underlying, ssl, BUFFEREVENT_SSL_CONNECTING, flags); in create_bev()
481 base, fd, ssl, BUFFEREVENT_SSL_CONNECTING, flags); in create_bev()
513 ev_uint16_t port = 0, port2 = 0; in http_basic_test_impl() local
515 struct evhttp *http = http_setup(&port, data->base, server_flags); in http_basic_test_impl()
518 exit_base = data->base; in http_basic_test_impl()
521 if (http_bind(http, &port2, server_flags) == -1) { in http_basic_test_impl()
526 fd = http_connect("127.0.0.1", port); in http_basic_test_impl()
529 bev = create_bev(data->base, fd, ssl, BEV_OPT_CLOSE_ON_FREE); in http_basic_test_impl()
531 http_errorcb, data->base); in http_basic_test_impl()
540 event_base_dispatch(data->base); in http_basic_test_impl()
543 /* connect to the second port */ in http_basic_test_impl()
549 bev = create_bev(data->base, fd, ssl, BEV_OPT_CLOSE_ON_FREE); in http_basic_test_impl()
551 http_errorcb, data->base); in http_basic_test_impl()
561 event_base_dispatch(data->base); in http_basic_test_impl()
564 /* Connect to the second port again. This time, send an absolute uri. */ in http_basic_test_impl()
570 bev = create_bev(data->base, fd, ssl, BEV_OPT_CLOSE_ON_FREE); in http_basic_test_impl()
572 http_errorcb, data->base); in http_basic_test_impl()
583 event_base_dispatch(data->base); in http_basic_test_impl()
615 event_base_once(arg, -1, EV_TIMEOUT, http_delay_reply, req, &tv); in http_delay_cb()
623 …evhttp_add_header(evhttp_request_get_output_headers(req), "Content-Type", "text/xml; charset=UTF-8… in http_badreq_cb()
654 /* req->kind = EVHTTP_RESPONSE; */ in http_badreq_readcb()
665 "Content-Type") != NULL) in http_badreq_readcb()
691 ev_uint16_t port=0, port2=0; in http_bad_request_test() local
692 struct evhttp *http = http_setup(&port, data->base, 0); in http_bad_request_test()
695 exit_base = data->base; in http_bad_request_test()
698 if (http_bind(http, &port2, 0) == -1) in http_bad_request_test()
702 fd = http_connect("127.0.0.1", port); in http_bad_request_test()
706 bev = bufferevent_socket_new(data->base, fd, 0); in http_bad_request_test()
708 http_badreq_errorcb, data->base); in http_bad_request_test()
719 event_base_once(data->base, -1, EV_TIMEOUT, http_badreq_successcb, bev, &tv); in http_bad_request_test()
721 event_base_dispatch(data->base); in http_bad_request_test()
733 /* connect to the second port */ in http_bad_request_test()
738 bev = bufferevent_socket_new(data->base, fd, 0); in http_bad_request_test()
740 http_badreq_errorcb, data->base); in http_bad_request_test()
746 "Connection: Keep-Alive\r\n" \ in http_bad_request_test()
753 event_base_once(data->base, -1, EV_TIMEOUT, http_badreq_successcb, bev, &tv); in http_bad_request_test()
755 event_base_dispatch(data->base); in http_bad_request_test()
776 event_base_once(arg, -1, EV_TIMEOUT, http_delay_reply, req, &tv); in http_large_delay_cb()
813 ev_uint16_t port = 0; in http_delete_test() local
814 struct evhttp *http = http_setup(&port, data->base, 0); in http_delete_test()
816 exit_base = data->base; in http_delete_test()
820 fd = http_connect("127.0.0.1", port); in http_delete_test()
824 bev = bufferevent_socket_new(data->base, fd, 0); in http_delete_test()
826 http_errorcb, data->base); in http_delete_test()
836 event_base_dispatch(data->base); in http_delete_test()
897 ev_uint16_t port = 0; in http_on_complete_test() local
898 struct evhttp *http = http_setup(&port, data->base, 0); in http_on_complete_test()
900 exit_base = data->base; in http_on_complete_test()
903 fd = http_connect("127.0.0.1", port); in http_on_complete_test()
907 bev = bufferevent_socket_new(data->base, fd, 0); in http_on_complete_test()
909 http_errorcb, data->base); in http_on_complete_test()
919 event_base_dispatch(data->base); in http_on_complete_test()
939 sizeof(buf)-1); in http_allowed_methods_eventcb()
955 evutil_socket_t fd1=-1, fd2=-1, fd3=-1; in http_allowed_methods_test()
958 ev_uint16_t port = 0; in http_allowed_methods_test() local
959 struct evhttp *http = http_setup(&port, data->base, 0); in http_allowed_methods_test()
961 exit_base = data->base; in http_allowed_methods_test()
964 fd1 = http_connect("127.0.0.1", port); in http_allowed_methods_test()
971 bev1 = bufferevent_socket_new(data->base, fd1, 0); in http_allowed_methods_test()
984 event_base_dispatch(data->base); in http_allowed_methods_test()
986 fd2 = http_connect("127.0.0.1", port); in http_allowed_methods_test()
989 bev2 = bufferevent_socket_new(data->base, fd2, 0); in http_allowed_methods_test()
1002 event_base_dispatch(data->base); in http_allowed_methods_test()
1004 fd3 = http_connect("127.0.0.1", port); in http_allowed_methods_test()
1007 bev3 = bufferevent_socket_new(data->base, fd3, 0); in http_allowed_methods_test()
1020 event_base_dispatch(data->base); in http_allowed_methods_test()
1064 ev_uint16_t port = 0; in http_connection_test_() local
1075 http = http_setup(&port, data->base, mask); in http_connection_test_()
1087 data->base, -1, ssl, in http_connection_test_()
1091 evcon = evhttp_connection_base_bufferevent_new(data->base, dnsbase, bev, address, port); in http_connection_test_()
1096 evcon = evhttp_connection_base_new(data->base, dnsbase, address, port); in http_connection_test_()
1101 tt_assert(evhttp_connection_get_base(evcon) == data->base); in http_connection_test_()
1103 exit_base = data->base; in http_connection_test_()
1117 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in http_connection_test_()
1122 event_base_dispatch(data->base); in http_connection_test_()
1142 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in http_connection_test_()
1146 event_base_dispatch(data->base); in http_connection_test_()
1151 req = evhttp_request_new(http_request_empty_done, data->base); in http_connection_test_()
1157 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in http_connection_test_()
1161 event_base_dispatch(data->base); in http_connection_test_()
1190 ev_uint16_t port = 0; in http_connection_async_test() local
1196 struct evhttp *http = http_setup(&port, data->base, 0); in http_connection_async_test()
1198 exit_base = data->base; in http_connection_async_test()
1199 tt_assert(regress_dnsserver(data->base, &portnum, search_table)); in http_connection_async_test()
1201 dns_base = evdns_base_new(data->base, 0/* init name servers */); in http_connection_async_test()
1211 evcon = evhttp_connection_base_new(data->base, dns_base, "127.0.0.1", port); in http_connection_async_test()
1225 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in http_connection_async_test()
1230 event_base_dispatch(data->base); in http_connection_async_test()
1249 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in http_connection_async_test()
1253 event_base_dispatch(data->base); in http_connection_async_test()
1258 req = evhttp_request_new(http_request_empty_done, data->base); in http_connection_async_test()
1264 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in http_connection_async_test()
1268 event_base_dispatch(data->base); in http_connection_async_test()
1284 ev_uint16_t port = 0; in http_autofree_connection_test() local
1287 struct evhttp *http = http_setup(&port, data->base, 0); in http_autofree_connection_test()
1292 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_autofree_connection_test()
1299 req[0] = evhttp_request_new(http_request_empty_done, data->base); in http_autofree_connection_test()
1300 req[1] = evhttp_request_new(http_request_empty_done, data->base); in http_autofree_connection_test()
1308 if (evhttp_make_request(evcon, req[i], EVHTTP_REQ_GET, "/test") == -1) { in http_autofree_connection_test()
1322 event_base_dispatch(data->base); in http_autofree_connection_test()
1325 tt_assert(TAILQ_FIRST(&http->connections) == NULL); in http_autofree_connection_test()
1403 http_fill_backlog(struct event_base *base, int port) in http_fill_backlog() argument
1412 evcon[i] = evhttp_connection_base_new(base, NULL, "127.0.0.1", port); in http_fill_backlog()
1418 tt_int_op(evhttp_make_request(evcon[i], req, EVHTTP_REQ_GET, "/delay"), !=, -1); in http_fill_backlog()
1438 struct event_base *base) in http_cancel_test_bad_request_new() argument
1442 return evhttp_request_new(http_timed_out_request_done, base); in http_cancel_test_bad_request_new()
1446 return evhttp_request_new(http_failed_request_done, base); in http_cancel_test_bad_request_new()
1454 ev_uint16_t port = 0; in http_cancel_test() local
1465 struct event_base *base_to_fill = data->base; in http_cancel_test()
1468 (enum http_cancel_test_type)data->setup_data; in http_cancel_test()
1469 struct evhttp *http = http_setup(&port, data->base, 0); in http_cancel_test()
1474 tt_assert(regress_dnsserver(data->base, &portnum, search_table)); in http_cancel_test()
1476 dns_base = evdns_base_new(data->base, 0/* init name servers */); in http_cancel_test()
1479 /** XXX: Hack the port to make timeout after resolving */ in http_cancel_test()
1487 evdns_base_set_option(dns_base, "initial-probe-timeout:", timeout); in http_cancel_test()
1491 exit_base = data->base; in http_cancel_test()
1496 port = 0; in http_cancel_test()
1498 inactive_http = http_setup(&port, inactive_base, 0); in http_cancel_test()
1504 evcons = http_fill_backlog(base_to_fill, port); in http_cancel_test()
1507 data->base, dns_base, in http_cancel_test()
1509 port); in http_cancel_test()
1533 !=, -1); in http_cancel_test()
1539 event_base_once(data->base, -1, EV_TIMEOUT, http_do_cancel, req, &tv); in http_cancel_test()
1541 event_base_dispatch(data->base); in http_cancel_test()
1553 evcons = http_fill_backlog(base_to_fill, port); in http_cancel_test()
1555 req = http_cancel_test_bad_request_new(type, data->base); in http_cancel_test()
1564 !=, -1); in http_cancel_test()
1566 event_base_dispatch(data->base); in http_cancel_test()
1573 evcons = http_fill_backlog(base_to_fill, port); in http_cancel_test()
1575 req = http_cancel_test_bad_request_new(type, data->base); in http_cancel_test()
1577 req = evhttp_request_new(http_request_empty_done, data->base); in http_cancel_test()
1584 !=, -1); in http_cancel_test()
1586 event_base_dispatch(data->base); in http_cancel_test()
1627 if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) { in http_request_done()
1665 ev_uint16_t port = 0; in http_virtual_host_test() local
1672 struct evhttp *http = http_setup(&port, data->base, 0); in http_virtual_host_test()
1674 exit_base = data->base; in http_virtual_host_test()
1682 if (evhttp_add_virtual_host(http, "foo.com", second) == -1) { in http_virtual_host_test()
1686 if (evhttp_add_virtual_host(http, "bar.*.foo.com", third) == -1) { in http_virtual_host_test()
1694 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_virtual_host_test()
1698 req = evhttp_request_new(http_request_expect_error, data->base); in http_virtual_host_test()
1705 "/funnybunny") == -1) { in http_virtual_host_test()
1709 event_base_dispatch(data->base); in http_virtual_host_test()
1723 "/funnybunny") == -1) { in http_virtual_host_test()
1728 event_base_dispatch(data->base); in http_virtual_host_test()
1742 "/blackcoffee") == -1) { in http_virtual_host_test()
1746 event_base_dispatch(data->base); in http_virtual_host_test()
1760 "/funnybunny") == -1) { in http_virtual_host_test()
1764 event_base_dispatch(data->base); in http_virtual_host_test()
1773 /* Add the Host header. This time with the optional port. */ in http_virtual_host_test()
1778 "/blackcoffee") == -1) { in http_virtual_host_test()
1782 event_base_dispatch(data->base); in http_virtual_host_test()
1789 fd = http_connect("127.0.0.1", port); in http_virtual_host_test()
1793 bev = bufferevent_socket_new(data->base, fd, 0); in http_virtual_host_test()
1806 event_base_dispatch(data->base); in http_virtual_host_test()
1842 if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Length") == NULL) { in http_request_empty_done()
1847 if (strcmp(evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Length"), in http_request_empty_done()
1883 struct event_base *base = arg; in http_dispatcher_test_done() local
1896 if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) { in http_dispatcher_test_done()
1913 event_base_loopexit(base, NULL); in http_dispatcher_test_done()
1920 ev_uint16_t port = 0; in http_dispatcher_test() local
1923 struct evhttp *http = http_setup(&port, data->base, 0); in http_dispatcher_test()
1927 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_dispatcher_test()
1938 req = evhttp_request_new(http_dispatcher_test_done, data->base); in http_dispatcher_test()
1944 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/?arg=val") == -1) { in http_dispatcher_test()
1948 event_base_dispatch(data->base); in http_dispatcher_test()
1969 ev_uint16_t port = 0; in http_post_test() local
1972 struct evhttp *http = http_setup(&port, data->base, 0); in http_post_test()
1976 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_post_test()
1984 req = evhttp_request_new(http_postrequest_done, data->base); in http_post_test()
1991 if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/postit") == -1) { in http_post_test()
1995 event_base_dispatch(data->base); in http_post_test()
2001 req = evhttp_request_new(http_postrequest_done, data->base); in http_post_test()
2004 /* Now try with 100-continue. */ in http_post_test()
2008 evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "100-continue"); in http_post_test()
2011 if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/postit") == -1) { in http_post_test()
2015 event_base_dispatch(data->base); in http_post_test()
2046 fprintf(stdout, "Got :%s\n", evbuffer_pullup(evhttp_request_get_input_buffer(req),-1)); in http_post_cb()
2063 struct event_base *base = arg; in http_postrequest_done() local
2076 if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) { in http_postrequest_done()
2093 event_base_loopexit(base, NULL); in http_postrequest_done()
2108 ev_uint16_t port = 0; in http_put_test() local
2111 struct evhttp *http = http_setup(&port, data->base, 0); in http_put_test()
2115 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_put_test()
2122 req = evhttp_request_new(http_putrequest_done, data->base); in http_put_test()
2129 if (evhttp_make_request(evcon, req, EVHTTP_REQ_PUT, "/putit") == -1) { in http_put_test()
2133 event_base_dispatch(data->base); in http_put_test()
2163 fprintf(stdout, "Got :%s\n", evbuffer_pullup(evhttp_request_get_input_buffer(req),-1)); in http_put_cb()
2179 struct event_base *base = arg; in http_putrequest_done() local
2193 if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) { in http_putrequest_done()
2211 event_base_loopexit(base, NULL); in http_putrequest_done()
2235 ev_uint16_t port = 0; in http_failure_test() local
2236 struct evhttp *http = http_setup(&port, data->base, 0); in http_failure_test()
2240 fd = http_connect("127.0.0.1", port); in http_failure_test()
2244 bev = bufferevent_socket_new(data->base, fd, 0); in http_failure_test()
2246 http_errorcb, data->base); in http_failure_test()
2252 event_base_dispatch(data->base); in http_failure_test()
2283 struct event_base *base = evhttp_connection_get_base(evcon); in close_detect_launch() local
2286 req = evhttp_request_new(close_detect_done, base); in close_detect_launch()
2292 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in close_detect_launch()
2301 struct event_base *base = evhttp_connection_get_base(evcon); in close_detect_cb() local
2313 event_base_once(base, -1, EV_TIMEOUT, close_detect_launch, evcon, &tv); in close_detect_cb()
2322 ev_uint16_t port = 0; in http_close_detection_() local
2326 struct evhttp *http = http_setup(&port, data->base, 0); in http_close_detection_()
2333 evcon = evhttp_connection_base_new(data->base, NULL, in http_close_detection_()
2334 "127.0.0.1", port); in http_close_detection_()
2354 req, EVHTTP_REQ_GET, with_delay ? "/largedelay" : "/test") == -1) { in http_close_detection_()
2358 event_base_dispatch(data->base); in http_close_detection_()
2361 tt_assert(TAILQ_FIRST(&http->connections) == NULL); in http_close_detection_()
2384 int i = -1; in http_highport_test()
2389 myhttp = evhttp_new(data->base); in http_highport_test()
2390 if (evhttp_bind_socket(myhttp, "127.0.0.1", 65535 - i) == 0) { in http_highport_test()
2398 tt_fail_msg("Couldn't get a high port"); in http_highport_test()
2410 tt_want(evhttp_add_header(&headers, "One\r", "Two") == -1); in http_bad_header_test()
2411 tt_want(evhttp_add_header(&headers, "One\n", "Two") == -1); in http_bad_header_test()
2412 tt_want(evhttp_add_header(&headers, "One", "Two\r") == -1); in http_bad_header_test()
2413 tt_want(evhttp_add_header(&headers, "One", "Two\n") == -1); in http_bad_header_test()
2464 tt_int_op(r, ==, -1); in http_parse_query_test()
2479 tt_int_op(r, ==, -1); in http_parse_query_test()
2483 tt_int_op(r, ==, -1); in http_parse_query_test()
2487 tt_int_op(r, ==, -1); in http_parse_query_test()
2567 NCF("http://www.test.com/why-hello\x01"); in http_parse_uri_test()
2568 NCF("http://www.test.com/why-hello?\x01"); in http_parse_uri_test()
2569 NCF("http://www.test.com/why-hello#\x01"); in http_parse_uri_test()
2570 BAD("http://www.\x01.test.com/why-hello"); in http_parse_uri_test()
2571 BAD("http://www.%7test.com/why-hello"); in http_parse_uri_test()
2572 NCF("http://www.test.com/why-hell%7o"); in http_parse_uri_test()
2573 BAD("h%3ttp://www.test.com/why-hello"); in http_parse_uri_test()
2574 NCF("http://www.test.com/why-hello%7"); in http_parse_uri_test()
2575 NCF("http://www.test.com/why-hell%7o"); in http_parse_uri_test()
2581 BAD("http://[hello-there]/"); in http_parse_uri_test()
2617 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2627 tt_want(-1 == evhttp_uri_set_scheme(uri,"")); in http_parse_uri_test()
2628 tt_want(-1 == evhttp_uri_set_scheme(uri,"33")); in http_parse_uri_test()
2629 tt_want(-1 == evhttp_uri_set_scheme(uri,"hi!")); in http_parse_uri_test()
2630 tt_want(-1 == evhttp_uri_set_userinfo(uri,"hello@")); in http_parse_uri_test()
2631 tt_want(-1 == evhttp_uri_set_host(uri,"[1.2.3.4]")); in http_parse_uri_test()
2632 tt_want(-1 == evhttp_uri_set_host(uri,"[")); in http_parse_uri_test()
2633 tt_want(-1 == evhttp_uri_set_host(uri,"www.[foo].com")); in http_parse_uri_test()
2634 tt_want(-1 == evhttp_uri_set_port(uri,-3)); in http_parse_uri_test()
2635 tt_want(-1 == evhttp_uri_set_path(uri,"hello?world")); in http_parse_uri_test()
2636 tt_want(-1 == evhttp_uri_set_query(uri,"hello#world")); in http_parse_uri_test()
2637 tt_want(-1 == evhttp_uri_set_fragment(uri,"hello#world")); in http_parse_uri_test()
2649 tt_want(0 == evhttp_uri_set_port(uri, -1)); in http_parse_uri_test()
2671 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2682 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2693 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2704 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2715 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2731 uri = URI_PARSE("http://www.test.com:/"); /* empty port */ in http_parse_uri_test()
2737 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2742 uri = URI_PARSE("http://www.test.com:"); /* empty port 2 */ in http_parse_uri_test()
2748 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2759 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2781 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2792 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2812 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2823 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2834 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2841 uri = URI_PARSE("///some/path/to/the-file"); in http_parse_uri_test()
2846 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2847 tt_want(strcmp(evhttp_uri_get_path(uri), "/some/path/to/the-file") == 0); in http_parse_uri_test()
2850 TT_URI("///some/path/to/the-file"); in http_parse_uri_test()
2853 uri = URI_PARSE("/s:ome/path/to/the-file?q=99#fred"); in http_parse_uri_test()
2858 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2859 tt_want(strcmp(evhttp_uri_get_path(uri), "/s:ome/path/to/the-file") == 0); in http_parse_uri_test()
2862 TT_URI("/s:ome/path/to/the-file?q=99#fred"); in http_parse_uri_test()
2870 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2882 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2894 tt_want(evhttp_uri_get_port(uri) == -1); in http_parse_uri_test()
2913 s = evhttp_uriencode((from), -1, (plus)); \ in http_uriencode_test()
2916 sz = -1; \ in http_uriencode_test()
2948 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789-.~_", in http_uriencode_test()
2949 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789-.~_",0); in http_uriencode_test()
3018 struct event_base *base = NULL; in http_base_test() local
3022 ev_uint16_t port = 0; in http_base_test() local
3026 base = event_base_new(); in http_base_test()
3027 tt_assert(base); in http_base_test()
3028 http = http_setup(&port, base, 0); in http_base_test()
3030 fd = http_connect("127.0.0.1", port); in http_base_test()
3034 bev = bufferevent_socket_new(base, fd, 0); in http_base_test()
3036 http_errorcb, base); in http_base_test()
3037 bufferevent_base_set(base, bev); in http_base_test()
3047 event_base_dispatch(base); in http_base_test()
3057 if (base) in http_base_test()
3058 event_base_free(base); in http_base_test()
3069 test_ok = -1; in http_incomplete_readcb()
3083 test_ok = -2; in http_incomplete_errorcb()
3108 ev_uint16_t port = 0; in http_incomplete_test_() local
3110 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_incomplete_test_()
3112 exit_base = data->base; in http_incomplete_test_()
3117 fd = http_connect("127.0.0.1", port); in http_incomplete_test_()
3121 bev = create_bev(data->base, fd, ssl, 0); in http_incomplete_test_()
3134 event_base_dispatch(data->base); in http_incomplete_test_()
3187 test_ok = -1; in http_chunked_errorcb()
3194 /* req->kind = EVHTTP_RESPONSE; */ in http_chunked_errorcb()
3203 header = evhttp_find_header(evhttp_request_get_input_headers(req), "Transfer-Encoding"); in http_chunked_errorcb()
3296 "Transfer-Encoding") == NULL) { in http_chunked_request_done()
3324 ev_uint16_t port = 0; in http_chunk_out_test_impl() local
3329 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_chunk_out_test_impl()
3331 exit_base = data->base; in http_chunk_out_test_impl()
3334 fd = http_connect("127.0.0.1", port); in http_chunk_out_test_impl()
3338 bev = create_bev(data->base, fd, ssl, BEV_OPT_CLOSE_ON_FREE); in http_chunk_out_test_impl()
3341 http_chunked_errorcb, data->base); in http_chunk_out_test_impl()
3353 event_base_dispatch(data->base); in http_chunk_out_test_impl()
3366 bev = create_bev(data->base, -1, ssl, BEV_OPT_CLOSE_ON_FREE); in http_chunk_out_test_impl()
3368 data->base, NULL, bev, "127.0.0.1", port); in http_chunk_out_test_impl()
3374 req = evhttp_request_new(http_chunked_request_done, data->base); in http_chunk_out_test_impl()
3380 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/chunked") == -1) { in http_chunk_out_test_impl()
3384 event_base_dispatch(data->base); in http_chunk_out_test_impl()
3402 ev_uint16_t port = 0; in http_stream_out_test_impl() local
3406 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_stream_out_test_impl()
3409 exit_base = data->base; in http_stream_out_test_impl()
3411 bev = create_bev(data->base, -1, ssl, 0); in http_stream_out_test_impl()
3413 data->base, NULL, bev, "127.0.0.1", port); in http_stream_out_test_impl()
3429 == -1) { in http_stream_out_test_impl()
3433 event_base_dispatch(data->base); in http_stream_out_test_impl()
3478 ev_uint16_t port = 0; in http_stream_in_test_() local
3479 struct evhttp *http = http_setup(&port, data->base, 0); in http_stream_in_test_()
3481 exit_base = data->base; in http_stream_in_test_()
3483 evcon = evhttp_connection_base_new(data->base, NULL,"127.0.0.1", port); in http_stream_in_test_()
3490 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, url) == -1) { in http_stream_in_test_()
3494 event_base_dispatch(data->base); in http_stream_in_test_()
3500 (char*)evbuffer_pullup(reply, -1))); in http_stream_in_test_()
3503 if (memcmp(evbuffer_pullup(reply, -1), expected, expected_len) != 0) { in http_stream_in_test_()
3550 ev_uint16_t port = 0; in http_stream_in_cancel_test() local
3551 struct evhttp *http = http_setup(&port, data->base, 0); in http_stream_in_cancel_test()
3553 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_stream_in_cancel_test()
3556 req = evhttp_request_new(http_stream_in_cancel_done, data->base); in http_stream_in_cancel_test()
3560 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/chunked") == -1) { in http_stream_in_cancel_test()
3564 event_base_dispatch(data->base); in http_stream_in_cancel_test()
3577 struct event_base *base = evhttp_connection_get_base(evcon); in http_connection_fail_done() local
3590 event_base_loopexit(base, NULL); in http_connection_fail_done()
3599 ev_uint16_t port = 0; in http_connection_fail_test_impl() local
3603 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_connection_fail_test_impl()
3605 exit_base = data->base; in http_connection_fail_test_impl()
3608 /* auto detect a port */ in http_connection_fail_test_impl()
3611 bev = create_bev(data->base, -1, ssl, 0); in http_connection_fail_test_impl()
3615 data->base, NULL, bev, "239.10.20.30", 80); in http_connection_fail_test_impl()
3626 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/") == -1) { in http_connection_fail_test_impl()
3630 event_base_dispatch(data->base); in http_connection_fail_test_impl()
3645 if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") != NULL) { in http_connection_retry_done()
3658 ev_uint16_t port; member
3667 hs->http = http_setup(&hs->port, http_make_web_server_base, hs->ssl ? HTTP_BIND_SSL : 0); in http_make_web_server()
3678 struct evhttp *http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_simple_test_impl()
3680 exit_base = data->base; in http_simple_test_impl()
3683 bev = create_bev(data->base, -1, ssl, 0); in http_simple_test_impl()
3689 data->base, NULL, bev, "127.0.0.1", hs.port); in http_simple_test_impl()
3696 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, uri) == -1) in http_simple_test_impl()
3699 event_base_dispatch(data->base); in http_simple_test_impl()
3722 struct evhttp *http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_connection_retry_test_basic()
3724 exit_base = data->base; in http_connection_retry_test_basic()
3727 /* auto detect a port */ in http_connection_retry_test_basic()
3730 bev = create_bev(data->base, -1, ssl, 0); in http_connection_retry_test_basic()
3731 evcon = evhttp_connection_base_bufferevent_new(data->base, dns_base, bev, addr, hs.port); in http_connection_retry_test_basic()
3745 req = evhttp_request_new(http_connection_retry_done, data->base); in http_connection_retry_test_basic()
3752 "/?arg=val") == -1) { in http_connection_retry_test_basic()
3757 event_base_dispatch(data->base); in http_connection_retry_test_basic()
3780 req = evhttp_request_new(http_connection_retry_done, data->base); in http_connection_retry_test_basic()
3787 "/?arg=val") == -1) { in http_connection_retry_test_basic()
3792 event_base_dispatch(data->base); in http_connection_retry_test_basic()
3809 req = evhttp_request_new(http_dispatcher_test_done, data->base); in http_connection_retry_test_basic()
3816 "/?arg=val") == -1) { in http_connection_retry_test_basic()
3825 http_make_web_server_base = data->base; in http_connection_retry_test_basic()
3826 event_base_once(data->base, -1, EV_TIMEOUT, http_make_web_server, &hs, &tv); in http_connection_retry_test_basic()
3829 event_base_dispatch(data->base); in http_connection_retry_test_basic()
3851 tt_assert(regress_dnsserver(data->base, &portnum, search_table)); in http_connection_retry_conn_address_test_impl()
3852 dns_base = evdns_base_new(data->base, 0/* init name servers */); in http_connection_retry_conn_address_test_impl()
3897 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, -1); in http_primitives()
3899 tt_int_op(evhttp_del_cb(http, "/test"), ==, -1); in http_primitives()
3916 ev_uint16_t port = 0; in http_multi_line_header_test() local
3917 struct evhttp *http = http_setup(&port, data->base, 0); in http_multi_line_header_test()
3919 exit_base = data->base; in http_multi_line_header_test()
3924 fd = http_connect("127.0.0.1", port); in http_multi_line_header_test()
3928 bev = bufferevent_socket_new(data->base, fd, 0); in http_multi_line_header_test()
3931 http_errorcb, data->base); in http_multi_line_header_test()
3937 "X-Multi-Extra-WS: libevent \r\n" in http_multi_line_header_test()
3939 "X-Multi: aaaaaaaa\r\n" in http_multi_line_header_test()
3942 "X-Last: last\r\n" in http_multi_line_header_test()
3948 event_base_dispatch(data->base); in http_multi_line_header_test()
3978 ev_uint16_t port = 0; in http_negative_content_length_test() local
3981 struct evhttp *http = http_setup(&port, data->base, 0); in http_negative_content_length_test()
3985 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_negative_content_length_test()
3993 req = evhttp_request_new(http_request_bad, data->base); in http_negative_content_length_test()
3995 /* Cause the response to have a negative content-length */ in http_negative_content_length_test()
3996 evhttp_add_header(evhttp_request_get_output_headers(req), "X-Negative", "makeitso"); in http_negative_content_length_test()
3999 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in http_negative_content_length_test()
4003 event_base_dispatch(data->base); in http_negative_content_length_test()
4042 ev_uint16_t port = 0; in http_data_length_constraints_test_impl() local
4049 struct evhttp *http = http_setup(&port, data->base, 0); in http_data_length_constraints_test_impl()
4060 long_str[size - 1] = '\0'; in http_data_length_constraints_test_impl()
4062 TT_BLATHER(("Creating connection to :%i", port)); in http_data_length_constraints_test_impl()
4063 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_data_length_constraints_test_impl()
4071 evhttp_set_max_headers_size(http, size - 1); in http_data_length_constraints_test_impl()
4072 TT_BLATHER(("Set max header size %zu", size - 1)); in http_data_length_constraints_test_impl()
4074 req = evhttp_request_new(http_data_length_constraints_test_done, data->base); in http_data_length_constraints_test_impl()
4079 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/?arg=val") == -1) { in http_data_length_constraints_test_impl()
4082 event_base_dispatch(data->base); in http_data_length_constraints_test_impl()
4084 req = evhttp_request_new(http_data_length_constraints_test_done, data->base); in http_data_length_constraints_test_impl()
4089 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, long_str) == -1) { in http_data_length_constraints_test_impl()
4092 event_base_dispatch(data->base); in http_data_length_constraints_test_impl()
4094 evhttp_set_max_body_size(http, size - 2); in http_data_length_constraints_test_impl()
4095 TT_BLATHER(("Set body header size %zu", size - 2)); in http_data_length_constraints_test_impl()
4099 req = evhttp_request_new(cb, data->base); in http_data_length_constraints_test_impl()
4103 if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/") == -1) { in http_data_length_constraints_test_impl()
4106 event_base_dispatch(data->base); in http_data_length_constraints_test_impl()
4108 req = evhttp_request_new(http_large_entity_test_done, data->base); in http_data_length_constraints_test_impl()
4110 evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "100-continue"); in http_data_length_constraints_test_impl()
4112 TT_BLATHER(("POST / (Expect: 100-continue, http_large_entity_test_done)")); in http_data_length_constraints_test_impl()
4113 if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/") == -1) { in http_data_length_constraints_test_impl()
4116 event_base_dispatch(data->base); in http_data_length_constraints_test_impl()
4120 req = evhttp_request_new(http_dispatcher_test_done, data->base); in http_data_length_constraints_test_impl()
4122 evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "100-continue"); in http_data_length_constraints_test_impl()
4124 TT_BLATHER(("POST / (Expect: 100-continue, http_dispatcher_test_done)")); in http_data_length_constraints_test_impl()
4125 if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/") == -1) { in http_data_length_constraints_test_impl()
4128 event_base_dispatch(data->base); in http_data_length_constraints_test_impl()
4132 req = evhttp_request_new(cb, data->base); in http_data_length_constraints_test_impl()
4134 evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "101-continue"); in http_data_length_constraints_test_impl()
4136 TT_BLATHER(("POST / (Expect: 101-continue)")); in http_data_length_constraints_test_impl()
4137 if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/") == -1) { in http_data_length_constraints_test_impl()
4140 event_base_dispatch(data->base); in http_data_length_constraints_test_impl()
4160 ev_uint16_t port = 0; in http_lingering_close_test_impl() local
4166 struct evhttp *http = http_setup(&port, data->base, 0); in http_lingering_close_test_impl()
4174 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_lingering_close_test_impl()
4185 long_str[size - 1] = '\0'; in http_lingering_close_test_impl()
4191 req = evhttp_request_new(cb, data->base); in http_lingering_close_test_impl()
4195 if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/") == -1) { in http_lingering_close_test_impl()
4198 event_base_dispatch(data->base); in http_lingering_close_test_impl()
4219 struct event_base *base; member
4233 if (!state->req) { in terminate_chunked_trickle_cb()
4237 if (evhttp_request_get_connection(state->req) == NULL) { in terminate_chunked_trickle_cb()
4239 evhttp_request_free(state->req); in terminate_chunked_trickle_cb()
4240 event_base_loopexit(state->base,NULL); in terminate_chunked_trickle_cb()
4246 evhttp_send_reply_chunk(state->req, evb); in terminate_chunked_trickle_cb()
4249 if (!state->oneshot) { in terminate_chunked_trickle_cb()
4254 EVUTIL_ASSERT(state->base); in terminate_chunked_trickle_cb()
4255 event_base_once(state->base, -1, EV_TIMEOUT, terminate_chunked_trickle_cb, arg, &tv); in terminate_chunked_trickle_cb()
4263 state->gotclosecb = 1; in terminate_chunked_close_cb()
4266 if (state->oneshot) { in terminate_chunked_close_cb()
4267 evhttp_request_free(state->req); in terminate_chunked_close_cb()
4268 state->req = NULL; in terminate_chunked_close_cb()
4269 event_base_loopexit(state->base,NULL); in terminate_chunked_close_cb()
4284 state->req = req; in terminate_chunked_cb()
4290 event_base_once(state->base, -1, EV_TIMEOUT, terminate_chunked_trickle_cb, arg, &tv); in terminate_chunked_cb()
4297 bufferevent_free(state->bev); in terminate_chunked_client()
4298 evutil_closesocket(state->fd); in terminate_chunked_client()
4305 evbuffer_drain(bufferevent_get_input(bev), -1); in terminate_readcb()
4316 ev_uint16_t port = 0; in http_terminate_chunked_test_impl() local
4319 struct evhttp *http = http_setup(&port, data->base, 0); in http_terminate_chunked_test_impl()
4327 fd = http_connect("127.0.0.1", port); in http_terminate_chunked_test_impl()
4331 bev = bufferevent_socket_new(data->base, fd, 0); in http_terminate_chunked_test_impl()
4333 http_errorcb, data->base); in http_terminate_chunked_test_impl()
4336 terminate_state.base = data->base; in http_terminate_chunked_test_impl()
4350 event_base_once(data->base, -1, EV_TIMEOUT, terminate_chunked_client, &terminate_state, in http_terminate_chunked_test_impl()
4353 event_base_dispatch(data->base); in http_terminate_chunked_test_impl()
4388 tt_assert(regress_dnsserver(data->base, &portnum, ipv6_search_table)); in http_ipv6_for_domain_test_impl()
4390 dns_base = evdns_base_new(data->base, 0/* init name servers */); in http_ipv6_for_domain_test_impl()
4426 tt_assert(!strncmp(addrbuf, local, sizeof(local) - 1)); in http_request_get_addr_on_close()
4439 ev_uint16_t port = 0; in http_get_addr_test() local
4442 struct evhttp *http = http_setup(&port, data->base, 0); in http_get_addr_test()
4445 exit_base = data->base; in http_get_addr_test()
4447 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_get_addr_test()
4459 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in http_get_addr_test()
4463 event_base_dispatch(data->base); in http_get_addr_test()
4506 ev_uint16_t port = 0; in http_write_during_read_test_impl() local
4511 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_write_during_read_test_impl()
4514 exit_base = data->base; in http_write_during_read_test_impl()
4516 fd = http_connect("127.0.0.1", port); in http_write_during_read_test_impl()
4518 bev = create_bev(data->base, fd, 0, 0); in http_write_during_read_test_impl()
4519 bufferevent_setcb(bev, NULL, NULL, NULL, data->base); in http_write_during_read_test_impl()
4530 event_base_once(data->base, -1, EV_TIMEOUT, http_write_during_read, bev, &tv); in http_write_during_read_test_impl()
4532 event_base_dispatch(data->base); in http_write_during_read_test_impl()
4547 ev_uint16_t port = 0; in http_request_own_test() local
4550 struct evhttp *http = http_setup(&port, data->base, 0); in http_request_own_test()
4553 exit_base = data->base; in http_request_own_test()
4557 evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port); in http_request_own_test()
4562 if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) { in http_request_own_test()
4567 event_base_dispatch(data->base); in http_request_own_test()
4578 static void http_run_bev_request(struct event_base *base, int port, in http_run_bev_request() argument
4586 fd = http_connect("127.0.0.1", port); in http_run_bev_request()
4590 bev = create_bev(base, fd, 0, 0); in http_run_bev_request()
4592 http_errorcb, base); in http_run_bev_request()
4599 event_base_dispatch(base); in http_run_bev_request()
4610 ev_uint16_t port = 0; in http_request_extra_body_test() local
4613 http_setup_gencb(&port, data->base, 0, http_timeout_cb, NULL); in http_request_extra_body_test()
4616 exit_base = data->base; in http_request_extra_body_test()
4623 http_run_bev_request(data->base, port, in http_request_extra_body_test()
4627 "Content-Length: %i\r\n" in http_request_extra_body_test()
4630 evbuffer_pullup(body, -1) in http_request_extra_body_test()
4632 tt_assert(test_ok == -2); in http_request_extra_body_test()
4634 http_run_bev_request(data->base, port, in http_request_extra_body_test()
4638 "Content-Length: %i\r\n" in http_request_extra_body_test()
4641 evbuffer_pullup(body, -1) in http_request_extra_body_test()
4643 tt_assert(test_ok == -2); in http_request_extra_body_test()
4703 { "base", http_base_test, TT_FORK, NULL, NULL },