From: Haoyang Chen chenhaoyang@kylinos.cn
--- dlls/http.sys/http.c | 2 +- dlls/httpapi/tests/httpapi.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/dlls/http.sys/http.c b/dlls/http.sys/http.c index 973ff91801d..3af2d519cbb 100644 --- a/dlls/http.sys/http.c +++ b/dlls/http.sys/http.c @@ -385,7 +385,7 @@ static BOOL host_matches(const struct url *url, const char *conn_host) if (!url->url) return FALSE;
- if (url->url[7] == '+') + if (url->url[7] == '+' || url->url[7] == '*') { const char *queue_port = strchr(url->url + 7, ':'); host_len = strchr(queue_port, '/') - queue_port - 1; diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c index 06d67f203bb..24b09f85659 100644 --- a/dlls/httpapi/tests/httpapi.c +++ b/dlls/httpapi/tests/httpapi.c @@ -1354,7 +1354,42 @@ static void test_v1_urls(void) } ok(ret == ERROR_SHARING_VIOLATION, "Failed to add %s, error %u.\n", debugstr_w(url), ret); } + ok(!ret, "Got error %u.\n", ret);
+ s = create_client_socket(port); + sprintf(req_text, simple_req, port); + ret = send(s, req_text, strlen(req_text), 0); + ok(ret == strlen(req_text), "send() returned %d.\n", ret); + + memset(req_buffer, 0xcc, sizeof(req_buffer)); + ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); + ok(!ret, "Got error %u.\n", ret); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size); + + send_response_v1(queue, req->RequestId, s); + + ret = HttpRemoveUrl(queue, url); + ok(!ret, "Got error %u.\n", ret); + closesocket(s); + ret = CloseHandle(queue); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError()); + + ret = HttpCreateHttpHandle(&queue, 0); + ok(!ret, "Got error %u.\n", ret); + + for (port = 51000; port < 52000; ++port) + { + swprintf(url, ARRAY_SIZE(url), L"http://*:%u/", port); + if (!(ret = HttpAddUrl(queue, url, NULL))) + break; + if (ret == ERROR_ACCESS_DENIED) + { + skip("Not enough permissions to bind to all URLs.\n"); + CloseHandle(queue); + return; + } + ok(ret == ERROR_SHARING_VIOLATION, "Failed to add %s, error %u.\n", debugstr_w(url), ret); + } ok(!ret, "Got error %u.\n", ret);
s = create_client_socket(port);