Lines Matching full:http
58 #include "event2/http.h"
65 #include "http-internal.h"
515 struct evhttp *http = http_setup(&port, data->base, server_flags); in http_basic_test_impl() local
521 if (http_bind(http, &port2, server_flags) == -1) { in http_basic_test_impl()
534 /* first half of the http request */ in http_basic_test_impl()
575 "GET http://somehost.net/test HTTP/1.1\r\n" in http_basic_test_impl()
586 evhttp_free(http); in http_basic_test_impl()
592 { http_basic_test_impl(arg, 0, "GET /test HTTP/1.1"); } in http_basic_test()
594 { http_basic_test_impl(arg, 0, "GET /test HTTP/1.1 "); } in http_basic_trailing_space_test()
692 struct evhttp *http = http_setup(&port, data->base, 0); in http_bad_request_test() local
698 if (http_bind(http, &port2, 0) == -1) in http_bad_request_test()
743 /* first half of the http request */ in http_bad_request_test()
745 "GET /badrequest HTTP/1.0\r\n" \ in http_bad_request_test()
760 evhttp_free(http); in http_bad_request_test()
781 * HTTP DELETE test, just piggyback on the basic test
814 struct evhttp *http = http_setup(&port, data->base, 0); in http_delete_test() local
819 tt_assert(http); in http_delete_test()
829 "DELETE /deleteit HTTP/1.1\r\n" in http_delete_test()
842 evhttp_free(http); in http_delete_test()
898 struct evhttp *http = http_setup(&port, data->base, 0); in http_on_complete_test() local
912 "GET /oncomplete HTTP/1.1\r\n" in http_on_complete_test()
923 evhttp_free(http); in http_on_complete_test()
959 struct evhttp *http = http_setup(&port, data->base, 0); in http_allowed_methods_test() local
968 evhttp_set_allowed_methods(http, EVHTTP_REQ_PATCH); in http_allowed_methods_test()
977 "GET /index.html HTTP/1.1\r\n" in http_allowed_methods_test()
995 "PATCH /test HTTP/1.1\r\n" in http_allowed_methods_test()
1013 "FLOOP /test HTTP/1.1\r\n" in http_allowed_methods_test()
1026 evhttp_free(http); in http_allowed_methods_test()
1030 tt_assert(!strncmp(result1, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 "))); in http_allowed_methods_test()
1034 tt_assert(!strncmp(result2, "HTTP/1.1 200 ", strlen("HTTP/1.1 200 "))); in http_allowed_methods_test()
1038 tt_assert(!strncmp(result3, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 "))); in http_allowed_methods_test()
1067 struct evhttp *http; in http_connection_test_() local
1075 http = http_setup(&port, data->base, mask); in http_connection_test_()
1078 if (!http && ipv6) { in http_connection_test_()
1081 tt_assert(http); in http_connection_test_()
1108 * At this point, we want to schedule a request to the HTTP in http_connection_test_()
1166 if (http) in http_connection_test_()
1167 evhttp_free(http); in http_connection_test_()
1196 struct evhttp *http = http_setup(&port, data->base, 0); in http_connection_async_test() local
1215 * At this point, we want to schedule a request to the HTTP in http_connection_async_test()
1273 if (http) in http_connection_async_test()
1274 evhttp_free(http); in http_connection_async_test()
1287 struct evhttp *http = http_setup(&port, data->base, 0); in http_autofree_connection_test() local
1296 * At this point, we want to schedule two request to the HTTP in http_autofree_connection_test()
1324 /* at this point, the http server should have no connection */ in http_autofree_connection_test()
1325 tt_assert(TAILQ_FIRST(&http->connections) == NULL); in http_autofree_connection_test()
1330 if (http) in http_autofree_connection_test()
1331 evhttp_free(http); in http_autofree_connection_test()
1469 struct evhttp *http = http_setup(&port, data->base, 0); in http_cancel_test() local
1521 * At this point, we want to schedule a request to the HTTP in http_cancel_test()
1594 if (http) in http_cancel_test()
1595 evhttp_free(http); in http_cancel_test()
1672 struct evhttp *http = http_setup(&port, data->base, 0); in http_virtual_host_test() local
1678 evhttp_set_cb(second, "/funnybunny", http_basic_cb, http); in http_virtual_host_test()
1680 evhttp_set_cb(third, "/blackcoffee", http_basic_cb, http); 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()
1799 "GET http://manolito.info/funnybunny HTTP/1.1\r\n" in http_virtual_host_test()
1816 if (http) in http_virtual_host_test()
1817 evhttp_free(http); in http_virtual_host_test()
1864 * HTTP DISPATCHER test
1923 struct evhttp *http = http_setup(&port, data->base, 0); in http_dispatcher_test() local
1934 * At this point, we want to schedule an HTTP GET request in http_dispatcher_test()
1953 if (http) in http_dispatcher_test()
1954 evhttp_free(http); in http_dispatcher_test()
1958 * HTTP POST test.
1972 struct evhttp *http = http_setup(&port, data->base, 0); in http_post_test() local
1980 * At this point, we want to schedule an HTTP POST request in http_post_test()
2020 evhttp_free(http); in http_post_test()
2097 * HTTP PUT test, basically just like POST, but ...
2111 struct evhttp *http = http_setup(&port, data->base, 0); in http_put_test() local
2119 * Schedule the HTTP PUT request in http_put_test()
2136 evhttp_free(http); in http_put_test()
2226 * Testing that the HTTP server can deal with a malformed request.
2236 struct evhttp *http = http_setup(&port, data->base, 0); in http_failure_test() local
2256 evhttp_free(http); in http_failure_test()
2309 tv.tv_sec = 0; /* longer than the http time out */ in close_detect_cb()
2310 tv.tv_usec = 600000; /* longer than the http time out */ in close_detect_cb()
2326 struct evhttp *http = http_setup(&port, data->base, 0); in http_close_detection_() local
2331 evhttp_set_timeout_tv(http, &sec_tenth); in http_close_detection_()
2343 * At this point, we want to schedule a request to the HTTP in http_close_detection_()
2360 /* at this point, the http server should have no connection */ in http_close_detection_()
2361 tt_assert(TAILQ_FIRST(&http->connections) == NULL); in http_close_detection_()
2366 if (http) in http_close_detection_()
2367 evhttp_free(http); in http_close_detection_()
2437 r = evhttp_parse_query("http://www.test.com/?q=test", &headers); in http_parse_query_test()
2442 r = evhttp_parse_query("http://www.test.com/?q=test&foo=bar", &headers); in http_parse_query_test()
2448 r = evhttp_parse_query("http://www.test.com/?q=test+foo", &headers); in http_parse_query_test()
2453 r = evhttp_parse_query("http://www.test.com/?q=test%0Afoo", &headers); in http_parse_query_test()
2458 r = evhttp_parse_query("http://www.test.com/?q=test%0Dfoo", &headers); in http_parse_query_test()
2463 r = evhttp_parse_query("http://www.test.com/?q=test&&q2", &headers); in http_parse_query_test()
2467 r = evhttp_parse_query("http://www.test.com/?q=test+this", &headers); in http_parse_query_test()
2472 r = evhttp_parse_query("http://www.test.com/?q=test&q2=foo", &headers); in http_parse_query_test()
2478 r = evhttp_parse_query("http://www.test.com/?q&q2=foo", &headers); in http_parse_query_test()
2482 r = evhttp_parse_query("http://www.test.com/?q=foo&q2", &headers); in http_parse_query_test()
2486 r = evhttp_parse_query("http://www.test.com/?q=foo&q2&q3=x", &headers); in http_parse_query_test()
2490 r = evhttp_parse_query("http://www.test.com/?q=&q2=&q3=", &headers); in http_parse_query_test()
2508 r = evhttp_parse_query_str("http://www.test.com/?q=test", &headers); in http_parse_query_str_test()
2566 NCF("http://www.test.com/ why hello"); in http_parse_uri_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()
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()
2576 NCF("http://www.test.com/foo?ba%r"); in http_parse_uri_test()
2577 NCF("http://www.test.com/foo#ba%r"); in http_parse_uri_test()
2579 BAD("http://www.test.com:999x/"); in http_parse_uri_test()
2580 BAD("http://www.test.com:x/"); in http_parse_uri_test()
2581 BAD("http://[hello-there]/"); in http_parse_uri_test()
2582 BAD("http://[::1]]/"); in http_parse_uri_test()
2583 BAD("http://[::1/"); in http_parse_uri_test()
2584 BAD("http://[foob/"); in http_parse_uri_test()
2585 BAD("http://[/"); in http_parse_uri_test()
2586 BAD("http://[ffff:ffff:ffff:ffff:Ffff:ffff:ffff:" in http_parse_uri_test()
2588 BAD("http://[vX.foo]/"); in http_parse_uri_test()
2589 BAD("http://[vX.foo]/"); in http_parse_uri_test()
2590 BAD("http://[v.foo]/"); in http_parse_uri_test()
2591 BAD("http://[v5.fo%o]/"); in http_parse_uri_test()
2592 BAD("http://[v5X]/"); in http_parse_uri_test()
2593 BAD("http://[v5]/"); in http_parse_uri_test()
2594 BAD("http://[]/"); in http_parse_uri_test()
2595 BAD("http://f\x01red@www.example.com/"); in http_parse_uri_test()
2596 BAD("http://f%0red@www.example.com/"); in http_parse_uri_test()
2597 BAD("http://www.example.com:9999999999999999999999999999999999999/"); in http_parse_uri_test()
2598 BAD("http://www.example.com:hihi/"); in http_parse_uri_test()
2639 tt_want(0 == evhttp_uri_set_scheme(uri,"http")); in http_parse_uri_test()
2665 uri = URI_PARSE("http://www.test.com/?q=t%33est"); in http_parse_uri_test()
2666 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0); in http_parse_uri_test()
2673 TT_URI("http://www.test.com/?q=t%33est"); in http_parse_uri_test()
2676 uri = URI_PARSE("http://%77ww.test.com"); in http_parse_uri_test()
2677 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0); in http_parse_uri_test()
2684 TT_URI("http://%77ww.test.com"); in http_parse_uri_test()
2687 uri = URI_PARSE("http://www.test.com?q=test"); in http_parse_uri_test()
2688 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0); in http_parse_uri_test()
2695 TT_URI("http://www.test.com?q=test"); in http_parse_uri_test()
2698 uri = URI_PARSE("http://www.test.com#fragment"); in http_parse_uri_test()
2699 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0); in http_parse_uri_test()
2706 TT_URI("http://www.test.com#fragment"); in http_parse_uri_test()
2709 uri = URI_PARSE("http://8000/"); in http_parse_uri_test()
2710 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0); in http_parse_uri_test()
2717 TT_URI("http://8000/"); in http_parse_uri_test()
2720 uri = URI_PARSE("http://:8000/"); in http_parse_uri_test()
2721 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0); in http_parse_uri_test()
2728 TT_URI("http://:8000/"); in http_parse_uri_test()
2731 uri = URI_PARSE("http://www.test.com:/"); /* empty port */ in http_parse_uri_test()
2732 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0); in http_parse_uri_test()
2739 TT_URI("http://www.test.com/"); in http_parse_uri_test()
2742 uri = URI_PARSE("http://www.test.com:"); /* empty port 2 */ in http_parse_uri_test()
2743 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0); in http_parse_uri_test()
2750 TT_URI("http://www.test.com"); in http_parse_uri_test()
2954 ENC("http://www.ietf.org/rfc/rfc3986.txt", in http_uriencode_test()
2955 "http%3A%2F%2Fwww.ietf.org%2Frfc%2Frfc3986.txt",1); in http_uriencode_test()
3002 OLD_DEC("http://example.com/normal+path/?key=val+with+spaces", in http_uriencode_test()
3003 "http://example.com/normal+path/?key=val with spaces"); in http_uriencode_test()
3023 struct evhttp *http; in http_base_test() local
3028 http = http_setup(&port, base, 0); in http_base_test()
3040 "GET /test HTTP/1.1\r\n" in http_base_test()
3052 evhttp_free(http); in http_base_test()
3110 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_incomplete_test_() local
3115 evhttp_set_timeout(http, 1); in http_incomplete_test_()
3127 "GET /test HTTP/1.1\r\n" in http_incomplete_test_()
3145 evhttp_free(http); in http_incomplete_test_()
3329 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_chunk_out_test_impl() local
3344 "GET /chunked HTTP/1.1\r\n" in http_chunk_out_test_impl()
3392 if (http) in http_chunk_out_test_impl()
3393 evhttp_free(http); in http_chunk_out_test_impl()
3406 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_stream_out_test_impl() local
3417 * At this point, we want to schedule a request to the HTTP in http_stream_out_test_impl()
3438 if (http) in http_stream_out_test_impl()
3439 evhttp_free(http); in http_stream_out_test_impl()
3479 struct evhttp *http = http_setup(&port, data->base, 0); in http_stream_in_test_() local
3513 if (http) in http_stream_in_test_()
3514 evhttp_free(http); in http_stream_in_test_()
3551 struct evhttp *http = http_setup(&port, data->base, 0); in http_stream_in_cancel_test() local
3569 evhttp_free(http); in http_stream_in_cancel_test()
3603 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_connection_fail_test_impl() local
3609 evhttp_free(http); in http_connection_fail_test_impl()
3619 * At this point, we want to schedule an HTTP GET request in http_connection_fail_test_impl()
3660 struct evhttp *http; 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() local
3705 if (http) in http_simple_test_impl()
3706 evhttp_free(http); 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() local
3728 evhttp_free(http); in http_connection_retry_test_basic()
3741 * At this point, we want to schedule an HTTP GET request in http_connection_retry_test_basic()
3839 if (http) in http_connection_retry_test_basic()
3840 evhttp_free(hs.http); in http_connection_retry_test_basic()
3883 struct evhttp *http = NULL; in http_primitives() local
3894 http = evhttp_new(NULL); in http_primitives()
3895 tt_assert(http); in http_primitives()
3896 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, 0); in http_primitives()
3897 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, -1); in http_primitives()
3898 tt_int_op(evhttp_del_cb(http, "/test"), ==, 0); in http_primitives()
3899 tt_int_op(evhttp_del_cb(http, "/test"), ==, -1); in http_primitives()
3900 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, 0); in http_primitives()
3905 if (http) in http_primitives()
3906 evhttp_free(http); in http_primitives()
3917 struct evhttp *http = http_setup(&port, data->base, 0); in http_multi_line_header_test() local
3922 tt_ptr_op(http, !=, NULL); in http_multi_line_header_test()
3934 "GET /test HTTP/1.1\r\n" in http_multi_line_header_test()
3958 if (http) in http_multi_line_header_test()
3959 evhttp_free(http); in http_multi_line_header_test()
3981 struct evhttp *http = http_setup(&port, data->base, 0); in http_negative_content_length_test() local
3989 * At this point, we want to schedule a request to the HTTP in http_negative_content_length_test()
4008 if (http) in http_negative_content_length_test()
4009 evhttp_free(http); in http_negative_content_length_test()
4049 struct evhttp *http = http_setup(&port, data->base, 0); in http_data_length_constraints_test_impl() local
4071 evhttp_set_max_headers_size(http, size - 1); in http_data_length_constraints_test_impl()
4087 /* GET /?arg=verylongvalue HTTP/1.1 */ in http_data_length_constraints_test_impl()
4094 evhttp_set_max_body_size(http, size - 2); in http_data_length_constraints_test_impl()
4146 if (http) in http_data_length_constraints_test_impl()
4147 evhttp_free(http); in http_data_length_constraints_test_impl()
4166 struct evhttp *http = http_setup(&port, data->base, 0); in http_lingering_close_test_impl() local
4171 tt_assert(!evhttp_set_flags(http, EVHTTP_SERVER_LINGERING_CLOSE)); in http_lingering_close_test_impl()
4172 evhttp_set_max_body_size(http, size / 2); in http_lingering_close_test_impl()
4179 * At this point, we want to schedule an HTTP GET request in http_lingering_close_test_impl()
4204 if (http) in http_lingering_close_test_impl()
4205 evhttp_free(http); in http_lingering_close_test_impl()
4319 struct evhttp *http = http_setup(&port, data->base, 0); in http_terminate_chunked_test_impl() local
4323 evhttp_del_cb(http, "/test"); in http_terminate_chunked_test_impl()
4324 tt_assert(evhttp_set_cb(http, "/test", in http_terminate_chunked_test_impl()
4342 /* first half of the http request */ in http_terminate_chunked_test_impl()
4344 "GET /test HTTP/1.1\r\n" in http_terminate_chunked_test_impl()
4361 if (http) in http_terminate_chunked_test_impl()
4362 evhttp_free(http); in http_terminate_chunked_test_impl()
4442 struct evhttp *http = http_setup(&port, data->base, 0); in http_get_addr_test() local
4452 * At this point, we want to schedule a request to the HTTP in http_get_addr_test()
4470 if (http) in http_get_addr_test()
4471 evhttp_free(http); in http_get_addr_test()
4511 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0); in http_write_during_read_test_impl() local
4523 "GET /large HTTP/1.1\r\n" in http_write_during_read_test_impl()
4537 if (http) in http_write_during_read_test_impl()
4538 evhttp_free(http); in http_write_during_read_test_impl()
4550 struct evhttp *http = http_setup(&port, data->base, 0); in http_request_own_test() local
4555 evhttp_free(http); in http_request_own_test()
4612 struct evhttp *http = in http_request_extra_body_test() local
4624 "HEAD /timeout HTTP/1.1\r\n" in http_request_extra_body_test()
4635 "HEAD /__gencb__ HTTP/1.1\r\n" in http_request_extra_body_test()
4646 evhttp_free(http); in http_request_extra_body_test()
4664 #define HTTP(name) HTTP_N(name, name, 0, NULL) macro
4670 { http_basic_test_impl(arg, 1, "GET /test HTTP/1.1"); } in https_basic_test()
4672 { http_basic_test_impl(arg, 1 | HTTP_SSL_FILTER, "GET /test HTTP/1.1"); } in https_filter_basic_test()
4710 HTTP(basic),
4711 HTTP(basic_trailing_space),
4712 HTTP(simple),
4713 HTTP(simple_nonconformant),
4728 HTTP(virtual_host),
4729 HTTP(post),
4730 HTTP(put),
4731 HTTP(delete),
4732 HTTP(allowed_methods),
4733 HTTP(failure),
4734 HTTP(connection),
4735 HTTP(persist_connection),
4736 HTTP(autofree_connection),
4737 HTTP(connection_async),
4738 HTTP(close_detection),
4739 HTTP(close_detection_delay),
4740 HTTP(bad_request),
4741 HTTP(incomplete),
4742 HTTP(incomplete_timeout),
4743 HTTP(terminate_chunked),
4744 HTTP(terminate_chunked_oneshot),
4745 HTTP(on_complete),
4747 HTTP(highport),
4748 HTTP(dispatcher),
4749 HTTP(multi_line_header),
4750 HTTP(negative_content_length),
4751 HTTP(chunk_out),
4752 HTTP(stream_out),
4754 HTTP(stream_in),
4755 HTTP(stream_in_cancel),
4757 HTTP(connection_fail),
4762 HTTP(data_length_constraints),
4763 HTTP(read_on_write_error),
4764 HTTP(non_lingering_close),
4765 HTTP(lingering_close),
4767 HTTP(ipv6_for_domain),
4768 HTTP(get_addr),
4770 HTTP(set_family),
4771 HTTP(set_family_ipv4),
4772 HTTP(set_family_ipv6),
4774 HTTP(write_during_read),
4775 HTTP(request_own),
4777 HTTP(request_extra_body),