]> granicus.if.org Git - libevent/commitdiff
test/http: stream_out for https
authorAzat Khuzhin <a3at.mail@gmail.com>
Sat, 14 Nov 2015 21:05:00 +0000 (00:05 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Wed, 18 Nov 2015 12:40:47 +0000 (15:40 +0300)
test/regress_http.c

index c6eafceb1f0f0fb77199a9da312a68c9e4fecfed..589199572a3a1415e03ba7897f3516d771031e0d 100644 (file)
@@ -3153,19 +3153,22 @@ static void http_chunk_out_test(void *arg)
 { return http_chunk_out_test_impl(arg, 0); }
 
 static void
-http_stream_out_test(void *arg)
+http_stream_out_test_impl(void *arg, int ssl)
 {
        struct basic_test_data *data = arg;
        ev_uint16_t port = 0;
        struct evhttp_connection *evcon = NULL;
        struct evhttp_request *req = NULL;
+       struct bufferevent *bev;
 
        test_ok = 0;
        exit_base = data->base;
 
-       http = http_setup(&port, data->base, 0);
+       http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
 
-       evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+       bev = create_bev(data->base, -1, ssl);
+       evcon = evhttp_connection_base_bufferevent_new(
+               data->base, NULL, bev, "127.0.0.1", port);
        tt_assert(evcon);
 
        /*
@@ -3193,6 +3196,8 @@ http_stream_out_test(void *arg)
        if (http)
                evhttp_free(http);
 }
+static void http_stream_out_test(void *arg)
+{ return http_stream_out_test_impl(arg, 0); }
 
 static void
 http_stream_in_chunk(struct evhttp_request *req, void *arg)
@@ -4238,6 +4243,8 @@ static void https_connection_retry_test(void *arg)
 { return http_connection_retry_test_impl(arg, 1); }
 static void https_chunk_out_test(void *arg)
 { return http_chunk_out_test_impl(arg, 1); }
+static void https_stream_out_test(void *arg)
+{ return http_stream_out_test_impl(arg, 1); }
 #endif
 
 struct testcase_t http_testcases[] = {
@@ -4307,6 +4314,7 @@ struct testcase_t http_testcases[] = {
        { "https_connection_retry_conn_address", https_connection_retry_conn_address_test,
          TT_ISOLATED|TT_OFF_BY_DEFAULT, &basic_setup, NULL },
        HTTPS(chunk_out),
+       HTTPS(stream_out),
 #endif
 
        END_OF_TESTCASES