Home | History | Annotate | Download | only in test

Lines Matching refs:HTTP

60 #include "event2/http.h"
67 #include "http-internal.h"
517 struct evhttp *http = http_setup(&port, data->base, server_flags);
523 if (http_bind(http, &port2, server_flags) == -1) {
536 /* first half of the http request */
577 "GET http://somehost.net/test HTTP/1.1\r\n"
588 evhttp_free(http);
594 HTTP/1.1"); }
596 { http_basic_test_impl(arg, 0, "GET /test HTTP/1.1 "); }
694 struct evhttp *http = http_setup(&port, data->base, 0);
700 if (http_bind(http, &port2, 0) == -1)
745 /* first half of the http request */
747 "GET /badrequest HTTP/1.0\r\n" \
762 evhttp_free(http);
783 * HTTP DELETE test, just piggyback on the basic test
816 struct evhttp *http = http_setup(&port, data->base, 0);
821 tt_assert(http);
831 "DELETE /deleteit HTTP/1.1\r\n"
844 evhttp_free(http);
900 struct evhttp *http = http_setup(&port, data->base, 0);
914 "GET /oncomplete HTTP/1.1\r\n"
925 evhttp_free(http);
961 struct evhttp *http = http_setup(&port, data->base, 0);
970 evhttp_set_allowed_methods(http, EVHTTP_REQ_PATCH);
979 "GET /index.html HTTP/1.1\r\n"
997 "PATCH /test HTTP/1.1\r\n"
1015 "FLOOP /test HTTP/1.1\r\n"
1028 evhttp_free(http);
1032 tt_assert(!strncmp(result1, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
1036 tt_assert(!strncmp(result2, "HTTP/1.1 200 ", strlen("HTTP/1.1 200 ")));
1040 tt_assert(!strncmp(result3, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
1069 struct evhttp *http;
1077 http = http_setup(&port, data->base, mask);
1080 if (!http && ipv6) {
1083 tt_assert(http);
1110 * At this point, we want to schedule a request to the HTTP
1168 if (http)
1169 evhttp_free(http);
1198 struct evhttp *http = http_setup(&port, data->base, 0);
1217 * At this point, we want to schedule a request to the HTTP
1275 if (http)
1276 evhttp_free(http);
1289 struct evhttp *http = http_setup(&port, data->base, 0);
1298 * At this point, we want to schedule two request to the HTTP
1326 /* at this point, the http server should have no connection */
1327 tt_assert(TAILQ_FIRST(&http->connections) == NULL);
1332 if (http)
1333 evhttp_free(http);
1471 struct evhttp *http = http_setup(&port, data->base, 0);
1523 * At this point, we want to schedule a request to the HTTP
1596 if (http)
1597 evhttp_free(http);
1674 struct evhttp *http = http_setup(&port, data->base, 0);
1680 evhttp_set_cb(second, "/funnybunny", http_basic_cb, http);
1682 evhttp_set_cb(third, "/blackcoffee", http_basic_cb, http);
1684 if (evhttp_add_virtual_host(http, "foo.com", second) == -1) {
1688 if (evhttp_add_virtual_host(http, "bar.*.foo.com", third) == -1) {
1801 "GET http://manolito.info/funnybunny HTTP/1.1\r\n"
1818 if (http)
1819 evhttp_free(http);
1866 * HTTP DISPATCHER test
1925 struct evhttp *http = http_setup(&port, data->base, 0);
1936 * At this point, we want to schedule an HTTP GET request
1955 if (http)
1956 evhttp_free(http);
1960 * HTTP POST test.
1974 struct evhttp *http = http_setup(&port, data->base, 0);
1982 * At this point, we want to schedule an HTTP POST request
2022 evhttp_free(http);
2099 * HTTP PUT test, basically just like POST, but ...
2113 struct evhttp *http = http_setup(&port, data->base, 0);
2121 * Schedule the HTTP PUT request
2138 evhttp_free(http);
2228 * Testing that the HTTP server can deal with a malformed request.
2238 struct evhttp *http = http_setup(&port, data->base, 0);
2258 evhttp_free(http);
2311 tv.tv_sec = 0; /* longer than the http time out */
2312 tv.tv_usec = 600000; /* longer than the http time out */
2328 struct evhttp *http = http_setup(&port, data->base, 0);
2333 evhttp_set_timeout_tv(http, &sec_tenth);
2345 * At this point, we want to schedule a request to the HTTP
2362 /* at this point, the http server should have no connection */
2363 tt_assert(TAILQ_FIRST(&http->connections) == NULL);
2368 if (http)
2369 evhttp_free(http);
2439 r = evhttp_parse_query("http://www.test.com/?q=test", &headers);
2444 r = evhttp_parse_query("http://www.test.com/?q=test&foo=bar", &headers);
2450 r = evhttp_parse_query("http://www.test.com/?q=test+foo", &headers);
2455 r = evhttp_parse_query("http://www.test.com/?q=test%0Afoo", &headers);
2460 r = evhttp_parse_query("http://www.test.com/?q=test%0Dfoo", &headers);
2465 r = evhttp_parse_query("http://www.test.com/?q=test&&q2", &headers);
2469 r = evhttp_parse_query("http://www.test.com/?q=test+this", &headers);
2474 r = evhttp_parse_query("http://www.test.com/?q=test&q2=foo", &headers);
2480 r = evhttp_parse_query("http://www.test.com/?q&q2=foo", &headers);
2484 r = evhttp_parse_query("http://www.test.com/?q=foo&q2", &headers);
2488 r = evhttp_parse_query("http://www.test.com/?q=foo&q2&q3=x", &headers);
2492 r = evhttp_parse_query("http://www.test.com/?q=&q2=&q3=", &headers);
2510 r = evhttp_parse_query_str("http://www.test.com/?q=test", &headers);
2568 NCF("http://www.test.com/ why hello");
2569 NCF("http://www.test.com/why-hello\x01");
2570 NCF("http://www.test.com/why-hello?\x01");
2571 NCF("http://www.test.com/why-hello#\x01");
2572 BAD("http://www.\x01.test.com/why-hello");
2573 BAD("http://www.%7test.com/why-hello");
2574 NCF("http://www.test.com/why-hell%7o");
2576 NCF("http://www.test.com/why-hello%7");
2577 NCF("http://www.test.com/why-hell%7o");
2578 NCF("http://www.test.com/foo?ba%r");
2579 NCF("http://www.test.com/foo#ba%r");
2581 BAD("http://www.test.com:999x/");
2582 BAD("http://www.test.com:x/");
2583 BAD("http://[hello-there]/");
2584 BAD("http://[::1]]/");
2585 BAD("http://[::1/");
2586 BAD("http://[foob/");
2587 BAD("http://[/");
2588 BAD("http://[ffff:ffff:ffff:ffff:Ffff:ffff:ffff:"
2590 BAD("http://[vX.foo]/");
2591 BAD("http://[vX.foo]/");
2592 BAD("http://[v.foo]/");
2593 BAD("http://[v5.fo%o]/");
2594 BAD("http://[v5X]/");
2595 BAD("http://[v5]/");
2596 BAD("http://[]/");
2597 BAD("http://f\x01red@www.example.com/");
2598 BAD("http://f%0red@www.example.com/");
2599 BAD("http://www.example.com:9999999999999999999999999999999999999/");
2600 BAD("http://www.example.com:hihi/");
2641 tt_want(0 == evhttp_uri_set_scheme(uri,"http"));
2667 uri = URI_PARSE("http://www.test.com/?q=t%33est");
2668 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2675 TT_URI("http://www.test.com/?q=t%33est");
2678 uri = URI_PARSE("http://%77ww.test.com");
2679 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2686 TT_URI("http://%77ww.test.com");
2689 uri = URI_PARSE("http://www.test.com?q=test");
2690 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2697 TT_URI("http://www.test.com?q=test");
2700 uri = URI_PARSE("http://www.test.com#fragment");
2701 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2708 TT_URI("http://www.test.com#fragment");
2711 uri = URI_PARSE("http://8000/");
2712 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2719 TT_URI("http://8000/");
2722 uri = URI_PARSE("http://:8000/");
2723 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2730 TT_URI("http://:8000/");
2733 uri = URI_PARSE("http://www.test.com:/"); /* empty port */
2734 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2741 TT_URI("http://www.test.com/");
2744 uri = URI_PARSE("http://www.test.com:"); /* empty port 2 */
2745 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2752 TT_URI("http://www.test.com");
2956 ENC("http://www.ietf.org/rfc/rfc3986.txt",
2957 "http%3A%2F%2Fwww.ietf.org%2Frfc%2Frfc3986.txt",1);
3004 OLD_DEC("http://example.com/normal+path/?key=val+with+spaces",
3005 "http://example.com/normal+path/?key=val with spaces");
3025 struct evhttp *http;
3030 http = http_setup(&port, base, 0);
3042 "GET /test HTTP/1.1\r\n"
3054 evhttp_free(http);
3112 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3117 evhttp_set_timeout(http, 1);
3129 "GET /test HTTP/1.1\r\n"
3147 evhttp_free(http);
3331 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3346 "GET /chunked HTTP/1.1\r\n"
3394 if (http)
3395 evhttp_free(http);
3408 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3419 * At this point, we want to schedule a request to the HTTP
3440 if (http)
3441 evhttp_free(http);
3481 struct evhttp *http = http_setup(&port, data->base, 0);
3515 if (http)
3516 evhttp_free(http);
3553 struct evhttp *http = http_setup(&port, data->base, 0);
3571 evhttp_free(http);
3605 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3611 evhttp_free(http);
3621 * At this point, we want to schedule an HTTP GET request
3662 struct evhttp *http;
3669 hs->http = http_setup(&hs->port, http_make_web_server_base, hs->ssl ? HTTP_BIND_SSL : 0);
3680 struct evhttp *http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0);
3707 if (http)
3708 evhttp_free(http);
3724 struct evhttp *http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0);
3730 evhttp_free(http);
3743 * At this point, we want to schedule an HTTP GET request
3841 if (http)
3842 evhttp_free(hs.http);
3885 struct evhttp *http = NULL;
3896 http = evhttp_new(NULL);
3897 tt_assert(http);
3898 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, 0);
3899 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, -1);
3900 tt_int_op(evhttp_del_cb(http, "/test"), ==, 0);
3901 tt_int_op(evhttp_del_cb(http, "/test"), ==, -1);
3902 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, 0);
3907 if (http)
3908 evhttp_free(http);
3919 struct evhttp *http = http_setup(&port, data->base, 0);
3924 tt_ptr_op(http, !=, NULL);
3936 "GET /test HTTP/1.1\r\n"
3960 if (http)
3961 evhttp_free(http);
3983 struct evhttp *http = http_setup(&port, data->base, 0);
3991 * At this point, we want to schedule a request to the HTTP
4010 if (http)
4011 evhttp_free(http);
4051 struct evhttp *http = http_setup(&port, data->base, 0);
4073 evhttp_set_max_headers_size(http, size - 1);
4089 /* GET /?arg=verylongvalue HTTP/1.1 */
4096 evhttp_set_max_body_size(http, size - 2);
4148 if (http)
4149 evhttp_free(http);
4168 struct evhttp *http = http_setup(&port, data->base, 0);
4173 tt_assert(!evhttp_set_flags(http, EVHTTP_SERVER_LINGERING_CLOSE));
4174 evhttp_set_max_body_size(http, size / 2);
4181 * At this point, we want to schedule an HTTP GET request
4206 if (http)
4207 evhttp_free(http);
4321 struct evhttp *http = http_setup(&port, data->base, 0);
4325 evhttp_del_cb(http, "/test");
4326 tt_assert(evhttp_set_cb(http, "/test",
4344 /* first half of the http request */
4346 "GET /test HTTP/1.1\r\n"
4363 if (http)
4364 evhttp_free(http);
4444 struct evhttp *http = http_setup(&port, data->base, 0);
4454 * At this point, we want to schedule a request to the HTTP
4472 if (http)
4473 evhttp_free(http);
4513 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
4525 "GET /large HTTP/1.1\r\n"
4539 if (http)
4540 evhttp_free(http);
4552 struct evhttp *http = http_setup(&port, data->base, 0);
4557 evhttp_free(http);
4614 struct evhttp *http =
4626 "HEAD /timeout HTTP/1.1\r\n"
4637 "HEAD /__gencb__ HTTP/1.1\r\n"
4648 evhttp_free(http);
4666 #define HTTP(name) HTTP_N(name, name, 0, NULL)
4672 { http_basic_test_impl(arg, 1, "GET /test HTTP/1.1"); }
4674 { http_basic_test_impl(arg, 1 | HTTP_SSL_FILTER, "GET /test HTTP/1.1"); }
4712 HTTP(basic),
4713 HTTP(basic_trailing_space),
4714 HTTP(simple),
4715 HTTP(simple_nonconformant),
4730 HTTP(virtual_host),
4731 HTTP(post),
4732 HTTP(put),
4733 HTTP(delete),
4734 HTTP(allowed_methods),
4735 HTTP(failure),
4736 HTTP(connection),
4737 HTTP(persist_connection),
4738 HTTP(autofree_connection),
4739 HTTP(connection_async),
4740 HTTP(close_detection),
4741 HTTP(close_detection_delay),
4742 HTTP(bad_request),
4743 HTTP(incomplete),
4744 HTTP(incomplete_timeout),
4745 HTTP(terminate_chunked),
4746 HTTP(terminate_chunked_oneshot),
4747 HTTP(on_complete),
4749 HTTP(highport),
4750 HTTP(dispatcher),
4751 HTTP(multi_line_header),
4752 HTTP(negative_content_length),
4753 HTTP(chunk_out),
4754 HTTP(stream_out),
4756 HTTP(stream_in),
4757 HTTP(stream_in_cancel),
4759 HTTP(connection_fail),
4764 HTTP(data_length_constraints),
4765 HTTP(read_on_write_error),
4766 HTTP(non_lingering_close),
4767 HTTP(lingering_close),
4769 HTTP(ipv6_for_domain),
4770 HTTP(get_addr),
4772 HTTP(set_family),
4773 HTTP(set_family_ipv4),
4774 HTTP(set_family_ipv6),
4776 HTTP(write_during_read),
4777 HTTP(request_own),
4779 HTTP(request_extra_body),