]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/civetweb/test/public_server.c
update sources to v12.1.0
[ceph.git] / ceph / src / civetweb / test / public_server.c
index 686537c9042bad216f80743048e6368fa801b8b4..b86776e245f28c52d0152b28f27a51ce35db8168 100644 (file)
@@ -1429,6 +1429,32 @@ START_TEST(test_request_handlers)
        ck_assert_str_eq(buf, expected);
        mg_close_connection(client_conn);
 
+       /* Get data from callback using mg_connect_client and absolute URI with a
+        * sub-domain */
+       memset(ebuf, 0, sizeof(ebuf));
+       client_conn =
+           mg_connect_client("localhost", ipv4_port, 0, ebuf, sizeof(ebuf));
+       ck_assert(client_conn != NULL);
+       ck_assert_str_eq(ebuf, "");
+
+       mg_printf(client_conn,
+                 "GET http://subdomain.test.domain:%d/U7 HTTP/1.0\r\n\r\n",
+                 ipv4_port);
+
+       i = mg_get_response(client_conn, ebuf, sizeof(ebuf), 10000);
+       ck_assert_int_ge(i, 0);
+       ck_assert_str_eq(ebuf, "");
+
+       ri = mg_get_request_info(client_conn);
+
+       ck_assert(ri != NULL);
+       ck_assert_str_eq(ri->uri, "200");
+       i = mg_read(client_conn, buf, sizeof(buf));
+       ck_assert_int_eq(i, (int)strlen(expected));
+       buf[i] = 0;
+       ck_assert_str_eq(buf, expected);
+       mg_close_connection(client_conn);
+
 
 /* Websocket test */
 #ifdef USE_WEBSOCKET
@@ -2824,13 +2850,12 @@ MAIN_PUBLIC_SERVER(void)
            test_threading(0);
            */
        test_mg_start_stop_http_server(0);
-       /*
-       test_mg_start_stop_https_server(0);
+  // test_mg_start_stop_https_server(0);
        test_request_handlers(0);
-       test_mg_server_and_client_tls(0);
-       test_handle_form(0);
-       test_http_auth(0);
-*/
+       // test_mg_server_and_client_tls(0);
+       // test_handle_form(0);
+       // test_http_auth(0);
+       test_keep_alive(0);
 
        printf("\nok: %i\nfailed: %i\n\n", chk_ok, chk_failed);
 }