Lines Matching defs:http
62 #include "event2/http.h"
69 #include "http-internal.h"
520 struct evhttp *http = http_setup(&port, data->base, server_flags);
526 if (http_bind(http, &port2, server_flags) == -1) {
539 /* first half of the http request */
580 "GET http://somehost.net/test HTTP/1.1\r\n"
591 evhttp_free(http);
597 { http_basic_test_impl(arg, 0, "GET /test HTTP/1.1"); }
599 { http_basic_test_impl(arg, 0, "GET /test HTTP/1.1 "); }
697 struct evhttp *http = http_setup(&port, data->base, 0);
703 if (http_bind(http, &port2, 0) == -1)
748 /* first half of the http request */
750 "GET /badrequest HTTP/1.0\r\n" \
765 evhttp_free(http);
786 * HTTP DELETE test, just piggyback on the basic test
819 struct evhttp *http = http_setup(&port, data->base, 0);
824 tt_assert(http);
834 "DELETE /deleteit HTTP/1.1\r\n"
847 evhttp_free(http);
903 struct evhttp *http = http_setup(&port, data->base, 0);
917 "GET /oncomplete HTTP/1.1\r\n"
928 evhttp_free(http);
964 struct evhttp *http = http_setup(&port, data->base, 0);
973 evhttp_set_allowed_methods(http, EVHTTP_REQ_PATCH);
982 "GET /index.html HTTP/1.1\r\n"
1000 "PATCH /test HTTP/1.1\r\n"
1018 "FLOOP /test HTTP/1.1\r\n"
1031 evhttp_free(http);
1035 tt_assert(!strncmp(result1, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
1039 tt_assert(!strncmp(result2, "HTTP/1.1 200 ", strlen("HTTP/1.1 200 ")));
1043 tt_assert(!strncmp(result3, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
1072 struct evhttp *http;
1080 http = http_setup(&port, data->base, mask);
1083 if (!http && ipv6) {
1086 tt_assert(http);
1113 * At this point, we want to schedule a request to the HTTP
1171 if (http)
1172 evhttp_free(http);
1201 struct evhttp *http = http_setup(&port, data->base, 0);
1220 * At this point, we want to schedule a request to the HTTP
1278 if (http)
1279 evhttp_free(http);
1292 struct evhttp *http = http_setup(&port, data->base, 0);
1301 * At this point, we want to schedule two request to the HTTP
1329 /* at this point, the http server should have no connection */
1330 tt_assert(TAILQ_FIRST(&http->connections) == NULL);
1335 if (http)
1336 evhttp_free(http);
1474 struct evhttp *http = http_setup(&port, data->base, 0);
1526 * At this point, we want to schedule a request to the HTTP
1599 if (http)
1600 evhttp_free(http);
1677 struct evhttp *http = http_setup(&port, data->base, 0);
1683 evhttp_set_cb(second, "/funnybunny", http_basic_cb, http);
1685 evhttp_set_cb(third, "/blackcoffee", http_basic_cb, http);
1687 if (evhttp_add_virtual_host(http, "foo.com", second) == -1) {
1691 if (evhttp_add_virtual_host(http, "bar.*.foo.com", third) == -1) {
1804 "GET http://manolito.info/funnybunny HTTP/1.1\r\n"
1821 if (http)
1822 evhttp_free(http);
1869 * HTTP
1928 struct evhttp *http = http_setup(&port, data->base, 0);
1939 * At this point, we want to schedule an HTTP GET request
1958 if (http)
1959 evhttp_free(http);
1963 * HTTP POST test.
1977 struct evhttp *http = http_setup(&port, data->base, 0);
1985 * At this point, we want to schedule an HTTP POST request
2025 evhttp_free(http);
2102 * HTTP PUT test, basically just like POST, but ...
2116 struct evhttp *http = http_setup(&port, data->base, 0);
2124 * Schedule the HTTP PUT request
2141 evhttp_free(http);
2231 * Testing that the HTTP server can deal with a malformed request.
2241 struct evhttp *http = http_setup(&port, data->base, 0);
2261 evhttp_free(http);
2314 tv.tv_sec = 0; /* longer than the http time out */
2315 tv.tv_usec = 600000; /* longer than the http time out */
2331 struct evhttp *http = http_setup(&port, data->base, 0);
2336 evhttp_set_timeout_tv(http, &sec_tenth);
2348 * At this point, we want to schedule a request to the HTTP
2365 /* at this point, the http server should have no connection */
2366 tt_assert(TAILQ_FIRST(&http->connections) == NULL);
2371 if (http)
2372 evhttp_free(http);
2442 r = evhttp_parse_query("http://www.test.com/?q=test", &headers);
2447 r = evhttp_parse_query("http://www.test.com/?q=test&foo=bar", &headers);
2453 r = evhttp_parse_query("http://www.test.com/?q=test+foo", &headers);
2458 r = evhttp_parse_query("http://www.test.com/?q=test%0Afoo", &headers);
2463 r = evhttp_parse_query("http://www.test.com/?q=test%0Dfoo", &headers);
2468 r = evhttp_parse_query("http://www.test.com/?q=test&&q2", &headers);
2472 r = evhttp_parse_query("http://www.test.com/?q=test+this", &headers);
2477 r = evhttp_parse_query("http://www.test.com/?q=test&q2=foo", &headers);
2483 r = evhttp_parse_query("http://www.test.com/?q&q2=foo", &headers);
2487 r = evhttp_parse_query("http://www.test.com/?q=foo&q2", &headers);
2491 r = evhttp_parse_query("http://www.test.com/?q=foo&q2&q3=x", &headers);
2495 r = evhttp_parse_query("http://www.test.com/?q=&q2=&q3=", &headers);
2513 r = evhttp_parse_query_str("http://www.test.com/?q=test", &headers);
2571 NCF("http://www.test.com/ why hello");
2572 NCF("http://www.test.com/why-hello\x01");
2573 NCF("http://www.test.com/why-hello?\x01");
2574 NCF("http://www.test.com/why-hello#\x01");
2575 BAD("http://www.\x01.test.com/why-hello");
2576 BAD("http://www.%7test.com/why-hello");
2577 NCF("http://www.test.com/why-hell%7o");
2579 NCF("http://www.test.com/why-hello%7");
2580 NCF("http://www.test.com/why-hell%7o");
2581 NCF("http://www.test.com/foo?ba%r");
2582 NCF("http://www.test.com/foo#ba%r");
2584 BAD("http://www.test.com:999x/");
2585 BAD("http://www.test.com:x/");
2586 BAD("http://[hello-there]/");
2587 BAD("http://[::1]]/");
2588 BAD("http://[::1/");
2589 BAD("http://[foob/");
2590 BAD("http://[/");
2591 BAD("http://[ffff:ffff:ffff:ffff:Ffff:ffff:ffff:"
2593 BAD("http://[vX.foo]/");
2594 BAD("http://[vX.foo]/");
2595 BAD("http://[v.foo]/");
2596 BAD("http://[v5.fo%o]/");
2597 BAD("http://[v5X]/");
2598 BAD("http://[v5]/");
2599 BAD("http://[]/");
2600 BAD("http://f\x01red@www.example.com/");
2601 BAD("http://f%0red@www.example.com/");
2602 BAD("http://www.example.com:9999999999999999999999999999999999999/");
2603 BAD("http://www.example.com:hihi/");
2644 tt_want(0 == evhttp_uri_set_scheme(uri,"http"));
2670 uri = URI_PARSE("http://www.test.com/?q=t%33est");
2671 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2678 TT_URI("http://www.test.com/?q=t%33est");
2681 uri = URI_PARSE("http://%77ww.test.com");
2682 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2689 TT_URI("http://%77ww.test.com");
2692 uri = URI_PARSE("http://www.test.com?q=test");
2693 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2700 TT_URI("http://www.test.com?q=test");
2703 uri = URI_PARSE("http://www.test.com#fragment");
2704 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2711 TT_URI("http://www.test.com#fragment");
2714 uri = URI_PARSE("http://8000/");
2715 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2722 TT_URI("http://8000/");
2725 uri = URI_PARSE("http://:8000/");
2726 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2733 TT_URI("http://:8000/");
2736 uri = URI_PARSE("http://www.test.com:/"); /* empty port */
2737 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2744 TT_URI("http://www.test.com/");
2747 uri = URI_PARSE("http://www.test.com:"); /* empty port 2 */
2748 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2755 TT_URI("http://www.test.com");
2959 ENC("http://www.ietf.org/rfc/rfc3986.txt",
2960 "http%3A%2F%2Fwww.ietf.org%2Frfc%2Frfc3986.txt",1);
3007 OLD_DEC("http://example.com/normal+path/?key=val+with+spaces",
3008 "http://example.com/normal+path/?key=val with spaces");
3028 struct evhttp *http;
3033 http = http_setup(&port, base, 0);
3045 "GET /test HTTP/1.1\r\n"
3057 evhttp_free(http);
3115 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3120 evhttp_set_timeout(http, 1);
3132 "GET /test HTTP/1.1\r\n"
3150 evhttp_free(http);
3334 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3349 "GET /chunked HTTP/1.1\r\n"
3397 if (http)
3398 evhttp_free(http);
3411 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3422 * At this point, we want to schedule a request to the HTTP
3443 if (http)
3444 evhttp_free(http);
3484 struct evhttp *http = http_setup(&port, data->base, 0);
3518 if (http)
3519 evhttp_free(http);
3556 struct evhttp *http = http_setup(&port, data->base, 0);
3574 evhttp_free(http);
3608 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3614 evhttp_free(http);
3624 * At this point, we want to schedule an HTTP GET request
3665 struct evhttp *http;
3672 hs->http = http_setup(&hs->port, http_make_web_server_base, hs->ssl ? HTTP_BIND_SSL : 0);
3683 struct evhttp *http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0);
3710 if (http)
3711 evhttp_free(http);
3727 struct evhttp *http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0);
3733 evhttp_free(http);
3746 * At this point, we want to schedule an HTTP GET request
3844 if (http)
3845 evhttp_free(hs.http);
3922 struct evhttp *http = http_setup(&port, data->base, 0);
3927 tt_ptr_op(http, !=, NULL);
3939 "GET /test HTTP/1.1\r\n"
3963 if (http)
3964 evhttp_free(http);
3986 struct evhttp *http = http_setup(&port, data->base, 0);
3994 * At this point, we want to schedule a request to the HTTP
4013 if (http)
4014 evhttp_free(http);
4054 struct evhttp *http = http_setup(&port, data->base, 0);
4076 evhttp_set_max_headers_size(http, size - 1);
4092 /* GET /?arg=verylongvalue HTTP/1.1 */
4099 evhttp_set_max_body_size(http, size - 2);
4151 if (http)
4152 evhttp_free(http);
4171 struct evhttp *http = http_setup(&port, data->base, 0);
4176 tt_assert(!evhttp_set_flags(http, EVHTTP_SERVER_LINGERING_CLOSE));
4177 evhttp_set_max_body_size(http, size / 2);
4184 * At this point, we want to schedule an HTTP GET request
4209 if (http)
4210 evhttp_free(http);
4324 struct evhttp *http = http_setup(&port, data->base, 0);
4328 evhttp_del_cb(http, "/test");
4329 tt_assert(evhttp_set_cb(http, "/test",
4347 /* first half of the http request */
4349 "GET /test HTTP/1.1\r\n"
4366 if (http)
4367 evhttp_free(http);
4447 struct evhttp *http = http_setup(&port, data->base, 0);
4457 * At this point, we want to schedule a request to the HTTP
4475 if (http)
4476 evhttp_free(http);
4516 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
4528 "GET /large HTTP/1.1\r\n"
4542 if (http)
4543 evhttp_free(http);
4555 struct evhttp *http = http_setup(&port, data->base, 0);
4560 evhttp_free(http);
4621 struct evhttp *http =
4633 "HEAD /timeout HTTP/1.1\r\n"
4644 "HEAD /__gencb__ HTTP/1.1\r\n"
4655 evhttp_free(http);
4673 #define HTTP(name) HTTP_N(name, name, 0, NULL)
4679 { http_basic_test_impl(arg, 1, "GET /test HTTP/1.1"); }
4681 { http_basic_test_impl(arg, 1 | HTTP_SSL_FILTER, "GET /test HTTP/1.1"); }
4719 HTTP(basic),
4720 HTTP(basic_trailing_space),
4721 HTTP(simple),
4722 HTTP(simple_nonconformant),
4737 HTTP(virtual_host),
4738 HTTP(post),
4739 HTTP(put),
4740 HTTP(delete),
4741 HTTP(allowed_methods),
4742 HTTP(failure),
4743 HTTP(connection),
4744 HTTP(persist_connection),
4745 HTTP(autofree_connection),
4746 HTTP(connection_async),
4747 HTTP(close_detection),
4748 HTTP(close_detection_delay),
4749 HTTP(bad_request),
4750 HTTP(incomplete),
4751 HTTP(incomplete_timeout),
4752 HTTP(terminate_chunked),
4753 HTTP(terminate_chunked_oneshot),
4754 HTTP(on_complete),
4756 HTTP(highport),
4757 HTTP(dispatcher),
4758 HTTP(multi_line_header),
4759 HTTP(negative_content_length),
4760 HTTP(chunk_out),
4761 HTTP(stream_out),
4763 HTTP(stream_in),
4764 HTTP(stream_in_cancel),
4766 HTTP(connection_fail),
4771 HTTP(data_length_constraints),
4772 HTTP(read_on_write_error),
4773 HTTP(non_lingering_close),
4774 HTTP(lingering_close),
4776 HTTP(ipv6_for_domain),
4777 HTTP(get_addr),
4779 HTTP(set_family),
4780 HTTP(set_family_ipv4),
4781 HTTP(set_family_ipv6),
4783 HTTP(write_during_read),
4784 HTTP(request_own),
4786 HTTP(request_extra_body),