Lines Matching refs:http
58 #include "event2/http.h"
65 #include "http-internal.h"
464 struct evhttp *http = http_setup(&port, data->base, server_flags);
470 if (http_bind(http, &port2, server_flags) == -1) {
482 /* first half of the http request */
484 "GET /test HTTP/1.1\r\n"
509 "GET /test HTTP/1.1\r\n"
532 "GET http://somehost.net/test HTTP/1.1\r\n"
543 evhttp_free(http);
647 struct evhttp *http = http_setup(&port, data->base, 0);
653 if (http_bind(http, &port2, 0) == -1)
697 /* first half of the http request */
699 "GET /badrequest HTTP/1.0\r\n" \
714 evhttp_free(http);
735 * HTTP DELETE test, just piggyback on the basic test
768 struct evhttp *http = http_setup(&port, data->base, 0);
773 tt_assert(http);
783 "DELETE /deleteit HTTP/1.1\r\n"
796 evhttp_free(http);
852 struct evhttp *http = http_setup(&port, data->base, 0);
866 "GET /oncomplete HTTP/1.1\r\n"
877 evhttp_free(http);
913 struct evhttp *http = http_setup(&port, data->base, 0);
922 evhttp_set_allowed_methods(http, EVHTTP_REQ_PATCH);
931 "GET /index.html HTTP/1.1\r\n"
949 "PATCH /test HTTP/1.1\r\n"
967 "FLOOP /test HTTP/1.1\r\n"
980 evhttp_free(http);
984 tt_assert(!strncmp(result1, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
988 tt_assert(!strncmp(result2, "HTTP/1.1 200 ", strlen("HTTP/1.1 200 ")));
992 tt_assert(!strncmp(result3, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
1021 struct evhttp *http;
1029 http = http_setup(&port, data->base, mask);
1032 if (!http && ipv6) {
1035 tt_assert(http);
1062 * At this point, we want to schedule a request to the HTTP
1120 if (http)
1121 evhttp_free(http);
1150 struct evhttp *http = http_setup(&port, data->base, 0);
1169 * At this point, we want to schedule a request to the HTTP
1227 if (http)
1228 evhttp_free(http);
1241 struct evhttp *http = http_setup(&port, data->base, 0);
1249 * At this point, we want to schedule two request to the HTTP
1281 /* at this point, the http server should have no connection */
1282 tt_assert(TAILQ_FIRST(&http->connections) == NULL);
1287 if (http)
1288 evhttp_free(http);
1426 struct evhttp *http = http_setup(&port, data->base, 0);
1478 * At this point, we want to schedule a request to the HTTP
1551 if (http)
1552 evhttp_free(http);
1629 struct evhttp *http = http_setup(&port, data->base, 0);
1635 evhttp_set_cb(second, "/funnybunny", http_basic_cb, http);
1637 evhttp_set_cb(third, "/blackcoffee", http_basic_cb, http);
1639 if (evhttp_add_virtual_host(http, "foo.com", second) == -1) {
1643 if (evhttp_add_virtual_host(http, "bar.*.foo.com", third) == -1) {
1755 "GET http://manolito.info/funnybunny HTTP/1.1\r\n"
1772 if (http)
1773 evhttp_free(http);
1820 * HTTP DISPATCHER test
1879 struct evhttp *http = http_setup(&port, data->base, 0);
1890 * At this point, we want to schedule an HTTP GET request
1909 if (http)
1910 evhttp_free(http);
1914 * HTTP POST test.
1928 struct evhttp *http = http_setup(&port, data->base, 0);
1936 * At this point, we want to schedule an HTTP POST request
1976 evhttp_free(http);
2053 * HTTP PUT test, basically just like POST, but ...
2067 struct evhttp *http = http_setup(&port, data->base, 0);
2075 * Schedule the HTTP PUT request
2092 evhttp_free(http);
2182 * Testing that the HTTP server can deal with a malformed request.
2192 struct evhttp *http = http_setup(&port, data->base, 0);
2212 evhttp_free(http);
2265 tv.tv_sec = 0; /* longer than the http time out */
2266 tv.tv_usec = 600000; /* longer than the http time out */
2282 struct evhttp *http = http_setup(&port, data->base, 0);
2287 evhttp_set_timeout_tv(http, &sec_tenth);
2299 * At this point, we want to schedule a request to the HTTP
2316 /* at this point, the http server should have no connection */
2317 tt_assert(TAILQ_FIRST(&http->connections) == NULL);
2322 if (http)
2323 evhttp_free(http);
2393 r = evhttp_parse_query("http://www.test.com/?q=test", &headers);
2398 r = evhttp_parse_query("http://www.test.com/?q=test&foo=bar", &headers);
2404 r = evhttp_parse_query("http://www.test.com/?q=test+foo", &headers);
2409 r = evhttp_parse_query("http://www.test.com/?q=test%0Afoo", &headers);
2414 r = evhttp_parse_query("http://www.test.com/?q=test%0Dfoo", &headers);
2419 r = evhttp_parse_query("http://www.test.com/?q=test&&q2", &headers);
2423 r = evhttp_parse_query("http://www.test.com/?q=test+this", &headers);
2428 r = evhttp_parse_query("http://www.test.com/?q=test&q2=foo", &headers);
2434 r = evhttp_parse_query("http://www.test.com/?q&q2=foo", &headers);
2438 r = evhttp_parse_query("http://www.test.com/?q=foo&q2", &headers);
2442 r = evhttp_parse_query("http://www.test.com/?q=foo&q2&q3=x", &headers);
2446 r = evhttp_parse_query("http://www.test.com/?q=&q2=&q3=", &headers);
2501 NCF("http://www.test.com/ why hello");
2502 NCF("http://www.test.com/why-hello\x01");
2503 NCF("http://www.test.com/why-hello?\x01");
2504 NCF("http://www.test.com/why-hello#\x01");
2505 BAD("http://www.\x01.test.com/why-hello");
2506 BAD("http://www.%7test.com/why-hello");
2507 NCF("http://www.test.com/why-hell%7o");
2509 NCF("http://www.test.com/why-hello%7");
2510 NCF("http://www.test.com/why-hell%7o");
2511 NCF("http://www.test.com/foo?ba%r");
2512 NCF("http://www.test.com/foo#ba%r");
2514 BAD("http://www.test.com:999x/");
2515 BAD("http://www.test.com:x/");
2516 BAD("http
2517 BAD("http://[::1]]/");
2518 BAD("http://[::1/");
2519 BAD("http://[foob/");
2520 BAD("http://[/");
2521 BAD("http://[ffff:ffff:ffff:ffff:Ffff:ffff:ffff:"
2523 BAD("http://[vX.foo]/");
2524 BAD("http://[vX.foo]/");
2525 BAD("http://[v.foo]/");
2526 BAD("http://[v5.fo%o]/");
2527 BAD("http://[v5X]/");
2528 BAD("http://[v5]/");
2529 BAD("http://[]/");
2530 BAD("http://f\x01red@www.example.com/");
2531 BAD("http://f%0red@www.example.com/");
2532 BAD("http://www.example.com:9999999999999999999999999999999999999/");
2533 BAD("http://www.example.com:hihi/");
2574 tt_want(0 == evhttp_uri_set_scheme(uri,"http"));
2600 uri = URI_PARSE("http://www.test.com/?q=t%33est");
2601 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2608 TT_URI("http://www.test.com/?q=t%33est");
2611 uri = URI_PARSE("http://%77ww.test.com");
2612 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2619 TT_URI("http://%77ww.test.com");
2622 uri = URI_PARSE("http://www.test.com?q=test");
2623 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2630 TT_URI("http://www.test.com?q=test");
2633 uri = URI_PARSE("http://www.test.com#fragment");
2634 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2641 TT_URI("http://www.test.com#fragment");
2644 uri = URI_PARSE("http://8000/");
2645 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2652 TT_URI("http://8000/");
2655 uri = URI_PARSE("http://:8000/");
2656 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2663 TT_URI("http://:8000/");
2666 uri = URI_PARSE("http://www.test.com:/"); /* empty port */
2667 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2674 TT_URI("http://www.test.com/");
2677 uri = URI_PARSE("http://www.test.com:"); /* empty port 2 */
2678 tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
2685 TT_URI("http://www.test.com");
2889 ENC("http://www.ietf.org/rfc/rfc3986.txt",
2890 "http%3A%2F%2Fwww.ietf.org%2Frfc%2Frfc3986.txt",1);
2937 OLD_DEC("http
2938 "http://example.com/normal+path/?key=val with spaces");
2958 struct evhttp *http;
2963 http = http_setup(&port, base, 0);
2975 "GET /test HTTP/1.1\r\n"
2987 evhttp_free(http);
3045 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3050 evhttp_set_timeout(http, 1);
3062 "GET /test HTTP/1.1\r\n"
3080 evhttp_free(http);
3264 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3278 "GET /chunked HTTP/1.1\r\n"
3326 if (http)
3327 evhttp_free(http);
3340 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3351 * At this point, we want to schedule a request to the HTTP
3372 if (http)
3373 evhttp_free(http);
3413 struct evhttp *http = http_setup(&port, data->base, 0);
3447 if (http)
3448 evhttp_free(http);
3485 struct evhttp *http = http_setup(&port, data->base, 0);
3503 evhttp_free(http);
3537 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
3543 evhttp_free(http);
3553 * At this point, we want to schedule an HTTP GET request
3594 struct evhttp *http;
3601 hs->http = http_setup(&hs->port, http_make_web_server_base, hs->ssl ? HTTP_BIND_SSL : 0);
3612 struct evhttp *http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0);
3640 if (http)
3641 evhttp_free(http);
3655 struct evhttp *http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0);
3661 evhttp_free(http);
3674 * At this point, we want to schedule an HTTP GET request
3772 if (http)
3773 evhttp_free(hs.http);
3816 struct evhttp *http = NULL;
3827 http = evhttp_new(NULL);
3828 tt_assert(http);
3829 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, 0);
3830 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, -1);
3831 tt_int_op(evhttp_del_cb(http, "/test"), ==, 0);
3832 tt_int_op(evhttp_del_cb(http, "/test"), ==, -1);
3833 tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, http), ==, 0);
3838 if (http)
3839 evhttp_free(http);
3850 struct evhttp *http = http_setup(&port, data->base, 0);
3855 tt_ptr_op(http, !=, NULL);
3868 "GET /test HTTP/1.1\r\n"
3892 if (http)
3893 evhttp_free(http);
3915 struct evhttp *http = http_setup(&port, data->base, 0);
3923 * At this point, we want to schedule a request to the HTTP
3942 if (http)
3943 evhttp_free(http);
3985 struct evhttp *http = http_setup(&port, data->base, 0);
4006 * At this point, we want to schedule an HTTP GET request
4017 evhttp_set_max_headers_size(http, size - 1);
4030 /* GET /?arg=verylongvalue HTTP/1.1 */
4040 evhttp_set_max_body_size(http, size - 2);
4085 if (http)
4086 evhttp_free(http);
4105 struct evhttp *http = http_setup(&port, data->base, 0);
4110 tt_assert(!evhttp_set_flags(http, EVHTTP_SERVER_LINGERING_CLOSE));
4111 evhttp_set_max_body_size(http, size / 2);
4118 * At this point, we want to schedule an HTTP GET request
4143 if (http)
4144 evhttp_free(http);
4258 struct evhttp *http = http_setup(&port, data->base, 0);
4262 evhttp_del_cb(http, "/test");
4263 tt_assert(evhttp_set_cb(http, "/test",
4280 /* first half of the http request */
4282 "GET /test HTTP/1.1\r\n"
4299 if (http)
4300 evhttp_free(http);
4380 struct evhttp *http = http_setup(&port, data->base, 0);
4390 * At this point, we want to schedule a request to the HTTP
4408 if (http)
4409 evhttp_free(http);
4449 struct evhttp *http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
4460 "GET /large HTTP/1.1\r\n"
4473 if (http)
4474 evhttp_free(http);
4486 struct evhttp *http = http_setup(&port, data->base, 0);
4491 evhttp_free(http);
4523 #define HTTP(name) HTTP_N(name, name, NULL)
4568 HTTP(basic),
4569 HTTP(simple),
4584 HTTP(virtual_host),
4585 HTTP(post),
4586 HTTP(put),
4587 HTTP(delete),
4588 HTTP(allowed_methods),
4589 HTTP(failure),
4590 HTTP(connection),
4591 HTTP(persist_connection),
4592 HTTP(autofree_connection),
4593 HTTP(connection_async),
4594 HTTP(close_detection),
4595 HTTP(close_detection_delay),
4596 HTTP(bad_request),
4597 HTTP(incomplete),
4598 HTTP(incomplete_timeout),
4599 HTTP(terminate_chunked),
4600 HTTP(terminate_chunked_oneshot),
4601 HTTP(on_complete),
4603 HTTP(highport),
4604 HTTP(dispatcher),
4605 HTTP(multi_line_header),
4606 HTTP(negative_content_length),
4607 HTTP(chunk_out),
4608 HTTP(stream_out),
4610 HTTP(stream_in),
4611 HTTP(stream_in_cancel),
4613 HTTP(connection_fail),
4618 HTTP(data_length_constraints),
4619 HTTP(read_on_write_error),
4620 HTTP(non_lingering_close),
4621 HTTP(lingering_close),
4623 HTTP(ipv6_for_domain),
4624 HTTP(get_addr),
4626 HTTP(set_family),
4627 HTTP(set_family_ipv4),
4628 HTTP(set_family_ipv6),
4630 HTTP(write_during_read),
4631 HTTP(request_own),