diff options
Diffstat (limited to 'meta/recipes-support/libsoup/libsoup-2.4/0001-Remove-http-and-https-aliases-support-test.patch')
-rw-r--r-- | meta/recipes-support/libsoup/libsoup-2.4/0001-Remove-http-and-https-aliases-support-test.patch | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/0001-Remove-http-and-https-aliases-support-test.patch b/meta/recipes-support/libsoup/libsoup-2.4/0001-Remove-http-and-https-aliases-support-test.patch deleted file mode 100644 index 0d4139ec08..0000000000 --- a/meta/recipes-support/libsoup/libsoup-2.4/0001-Remove-http-and-https-aliases-support-test.patch +++ /dev/null | |||
@@ -1,145 +0,0 @@ | |||
1 | From 0e3bfa22b23451531caf8cc30b1771ac6a41fcad Mon Sep 17 00:00:00 2001 | ||
2 | From: Carlos Garcia Campos <cgarcia@igalia.com> | ||
3 | Date: Thu, 11 Feb 2021 10:47:09 +0100 | ||
4 | Subject: [PATCH] Remove http and https aliases support test | ||
5 | |||
6 | Upstream has removed the whole function of http and https aliases | ||
7 | support, this commit partially cherry pick it, only remove the test to | ||
8 | mute the warning: | ||
9 | | ../libsoup-2.74.3/tests/server-test.c: In function 'do_one_server_aliases_test': | ||
10 | | ../libsoup-2.74.3/tests/server-test.c:180:17: warning: 'g_socket_client_set_tls_validation_flags' is deprecated [-Wdeprecated-declarations] | ||
11 | | 180 | g_socket_client_set_tls_validation_flags (client, 0); | ||
12 | | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
13 | |||
14 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/111ae4ebe7cc2e389573cff5b9ac76509d6cbac0] | ||
15 | |||
16 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
17 | --- | ||
18 | tests/server-test.c | 104 -------------------------------------------- | ||
19 | 1 file changed, 104 deletions(-) | ||
20 | |||
21 | diff --git a/tests/server-test.c b/tests/server-test.c | ||
22 | index 8976103..cb7e815 100644 | ||
23 | --- a/tests/server-test.c | ||
24 | +++ b/tests/server-test.c | ||
25 | @@ -154,108 +154,6 @@ do_star_test (ServerData *sd, gconstpointer test_data) | ||
26 | soup_uri_free (star_uri); | ||
27 | } | ||
28 | |||
29 | -static void | ||
30 | -do_one_server_aliases_test (SoupURI *uri, | ||
31 | - const char *alias, | ||
32 | - gboolean succeed) | ||
33 | -{ | ||
34 | - GSocketClient *client; | ||
35 | - GSocketConnectable *addr; | ||
36 | - GSocketConnection *conn; | ||
37 | - GInputStream *in; | ||
38 | - GOutputStream *out; | ||
39 | - GError *error = NULL; | ||
40 | - GString *req; | ||
41 | - static char buf[1024]; | ||
42 | - | ||
43 | - debug_printf (1, " %s via %s\n", alias, uri->scheme); | ||
44 | - | ||
45 | - /* There's no way to make libsoup's client side send an absolute | ||
46 | - * URI (to a non-proxy server), so we have to fake this. | ||
47 | - */ | ||
48 | - | ||
49 | - client = g_socket_client_new (); | ||
50 | - if (uri->scheme == SOUP_URI_SCHEME_HTTPS) { | ||
51 | - g_socket_client_set_tls (client, TRUE); | ||
52 | - g_socket_client_set_tls_validation_flags (client, 0); | ||
53 | - } | ||
54 | - addr = g_network_address_new (uri->host, uri->port); | ||
55 | - | ||
56 | - conn = g_socket_client_connect (client, addr, NULL, &error); | ||
57 | - g_object_unref (addr); | ||
58 | - g_object_unref (client); | ||
59 | - if (!conn) { | ||
60 | - g_assert_no_error (error); | ||
61 | - g_error_free (error); | ||
62 | - return; | ||
63 | - } | ||
64 | - | ||
65 | - in = g_io_stream_get_input_stream (G_IO_STREAM (conn)); | ||
66 | - out = g_io_stream_get_output_stream (G_IO_STREAM (conn)); | ||
67 | - | ||
68 | - req = g_string_new (NULL); | ||
69 | - g_string_append_printf (req, "GET %s://%s:%d HTTP/1.1\r\n", | ||
70 | - alias, uri->host, uri->port); | ||
71 | - g_string_append_printf (req, "Host: %s:%d\r\n", | ||
72 | - uri->host, uri->port); | ||
73 | - g_string_append (req, "Connection: close\r\n\r\n"); | ||
74 | - | ||
75 | - if (!g_output_stream_write_all (out, req->str, req->len, NULL, NULL, &error)) { | ||
76 | - g_assert_no_error (error); | ||
77 | - g_error_free (error); | ||
78 | - g_object_unref (conn); | ||
79 | - g_string_free (req, TRUE); | ||
80 | - return; | ||
81 | - } | ||
82 | - g_string_free (req, TRUE); | ||
83 | - | ||
84 | - if (!g_input_stream_read_all (in, buf, sizeof (buf), NULL, NULL, &error)) { | ||
85 | - g_assert_no_error (error); | ||
86 | - g_error_free (error); | ||
87 | - g_object_unref (conn); | ||
88 | - return; | ||
89 | - } | ||
90 | - | ||
91 | - if (succeed) | ||
92 | - g_assert_true (g_str_has_prefix (buf, "HTTP/1.1 200 ")); | ||
93 | - else | ||
94 | - g_assert_true (g_str_has_prefix (buf, "HTTP/1.1 400 ")); | ||
95 | - | ||
96 | - g_io_stream_close (G_IO_STREAM (conn), NULL, NULL); | ||
97 | - g_object_unref (conn); | ||
98 | -} | ||
99 | - | ||
100 | -static void | ||
101 | -do_server_aliases_test (ServerData *sd, gconstpointer test_data) | ||
102 | -{ | ||
103 | - char *http_aliases[] = { "dav", NULL }; | ||
104 | - char *https_aliases[] = { "davs", NULL }; | ||
105 | - char *http_good[] = { "http", "dav", NULL }; | ||
106 | - char *http_bad[] = { "https", "davs", "fred", NULL }; | ||
107 | - char *https_good[] = { "https", "davs", NULL }; | ||
108 | - char *https_bad[] = { "http", "dav", "fred", NULL }; | ||
109 | - int i; | ||
110 | - | ||
111 | - g_test_bug ("703694"); | ||
112 | - | ||
113 | - g_object_set (G_OBJECT (sd->server), | ||
114 | - SOUP_SERVER_HTTP_ALIASES, http_aliases, | ||
115 | - SOUP_SERVER_HTTPS_ALIASES, https_aliases, | ||
116 | - NULL); | ||
117 | - | ||
118 | - for (i = 0; http_good[i]; i++) | ||
119 | - do_one_server_aliases_test (sd->base_uri, http_good[i], TRUE); | ||
120 | - for (i = 0; http_bad[i]; i++) | ||
121 | - do_one_server_aliases_test (sd->base_uri, http_bad[i], FALSE); | ||
122 | - | ||
123 | - if (tls_available) { | ||
124 | - for (i = 0; https_good[i]; i++) | ||
125 | - do_one_server_aliases_test (sd->ssl_base_uri, https_good[i], TRUE); | ||
126 | - for (i = 0; https_bad[i]; i++) | ||
127 | - do_one_server_aliases_test (sd->ssl_base_uri, https_bad[i], FALSE); | ||
128 | - } | ||
129 | -} | ||
130 | - | ||
131 | static void | ||
132 | do_dot_dot_test (ServerData *sd, gconstpointer test_data) | ||
133 | { | ||
134 | @@ -1382,8 +1280,6 @@ main (int argc, char **argv) | ||
135 | |||
136 | g_test_add ("/server/OPTIONS *", ServerData, NULL, | ||
137 | server_setup, do_star_test, server_teardown); | ||
138 | - g_test_add ("/server/aliases", ServerData, NULL, | ||
139 | - server_setup, do_server_aliases_test, server_teardown); | ||
140 | g_test_add ("/server/..-in-path", ServerData, NULL, | ||
141 | server_setup, do_dot_dot_test, server_teardown); | ||
142 | g_test_add ("/server/ipv6", ServerData, NULL, | ||
143 | -- | ||
144 | 2.34.1 | ||
145 | |||