You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Rebase against bdaa571c5d7dd59dd28fd1f25cdad5761bfaf4dd.
This commit is contained in:
@@ -1,138 +0,0 @@
|
||||
From 72a8f7896554e752e1c924b71709e8cb0e48a51c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 16 May 2015 01:39:33 +0200
|
||||
Subject: wininet: Delay setting the http host header.
|
||||
|
||||
This change temporarly breaks two other tests which were only
|
||||
working by pure accident before.
|
||||
---
|
||||
dlls/wininet/http.c | 28 ++++++++++++++++++----------
|
||||
dlls/wininet/tests/http.c | 10 +++++-----
|
||||
2 files changed, 23 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
|
||||
index 5dd1b3b..e24a337 100644
|
||||
--- a/dlls/wininet/http.c
|
||||
+++ b/dlls/wininet/http.c
|
||||
@@ -376,6 +376,7 @@ static WCHAR *get_host_header( http_request_t *req )
|
||||
|
||||
EnterCriticalSection( &req->headers_section );
|
||||
if ((header = HTTP_GetHeader( req, hostW ))) ret = heap_strdupW( header->lpszValue );
|
||||
+ else ret = heap_strdupW( req->server->canon_host_port );
|
||||
LeaveCriticalSection( &req->headers_section );
|
||||
return ret;
|
||||
}
|
||||
@@ -1886,20 +1887,21 @@ static BOOL HTTP_GetRequestURL(http_request_t *req, LPWSTR buf)
|
||||
static const WCHAR https[] = { 'h','t','t','p','s',':','/','/',0 };
|
||||
static const WCHAR slash[] = { '/',0 };
|
||||
LPHTTPHEADERW host_header;
|
||||
+ const WCHAR *host;
|
||||
LPCWSTR scheme;
|
||||
|
||||
- host_header = HTTP_GetHeader(req, hostW);
|
||||
- if(!host_header)
|
||||
- return FALSE;
|
||||
-
|
||||
EnterCriticalSection( &req->headers_section );
|
||||
|
||||
+ host_header = HTTP_GetHeader(req, hostW);
|
||||
+ if (host_header) host = host_header->lpszValue;
|
||||
+ else host = req->server->canon_host_port;
|
||||
+
|
||||
if (req->hdr.dwFlags & INTERNET_FLAG_SECURE)
|
||||
scheme = https;
|
||||
else
|
||||
scheme = http;
|
||||
strcpyW(buf, scheme);
|
||||
- strcatW(buf, host_header->lpszValue);
|
||||
+ strcatW(buf, host);
|
||||
if (req->path[0] != '/')
|
||||
strcatW(buf, slash);
|
||||
strcatW(buf, req->path);
|
||||
@@ -2140,14 +2142,19 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
|
||||
case INTERNET_OPTION_URL: {
|
||||
static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0};
|
||||
WCHAR url[INTERNET_MAX_URL_LENGTH];
|
||||
- HTTPHEADERW *host;
|
||||
+ HTTPHEADERW *host_header;
|
||||
+ const WCHAR *host;
|
||||
|
||||
TRACE("INTERNET_OPTION_URL\n");
|
||||
|
||||
EnterCriticalSection( &req->headers_section );
|
||||
- host = HTTP_GetHeader(req, hostW);
|
||||
+
|
||||
+ host_header = HTTP_GetHeader(req, hostW);
|
||||
+ if (host_header) host = host_header->lpszValue;
|
||||
+ else host = req->server->canon_host_port;
|
||||
+
|
||||
strcpyW(url, httpW);
|
||||
- strcatW(url, host->lpszValue);
|
||||
+ strcatW(url, host);
|
||||
strcatW(url, req->path);
|
||||
LeaveCriticalSection( &req->headers_section );
|
||||
|
||||
@@ -3417,8 +3424,6 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session,
|
||||
request->verb = heap_strdupW(lpszVerb && *lpszVerb ? lpszVerb : szGET);
|
||||
request->version = heap_strdupW(lpszVersion && *lpszVersion ? lpszVersion : g_szHttp1_1);
|
||||
|
||||
- HTTP_ProcessHeader(request, hostW, request->server->canon_host_port, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ);
|
||||
-
|
||||
if (hIC->proxy && hIC->proxy[0] && !HTTP_ShouldBypassProxy(hIC, session->hostName))
|
||||
HTTP_DealWithProxy( hIC, session, request );
|
||||
|
||||
@@ -4911,6 +4916,9 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
|
||||
if (!request->verb)
|
||||
request->verb = heap_strdupW(szGET);
|
||||
|
||||
+ HTTP_ProcessHeader(request, hostW, request->server->canon_host_port,
|
||||
+ HTTP_ADDREQ_FLAG_ADD_IF_NEW | HTTP_ADDHDR_FLAG_REQ);
|
||||
+
|
||||
if (dwContentLength || strcmpW(request->verb, szGET))
|
||||
{
|
||||
sprintfW(contentLengthStr, szContentLength, dwContentLength);
|
||||
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
|
||||
index 46a2258..5725b30 100644
|
||||
--- a/dlls/wininet/tests/http.c
|
||||
+++ b/dlls/wininet/tests/http.c
|
||||
@@ -3054,8 +3054,8 @@ static void test_header_override(int port)
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
ret = HttpQueryInfoA(req, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &count);
|
||||
err = GetLastError();
|
||||
- todo_wine ok(!ret, "HttpQueryInfo succeeded\n");
|
||||
- todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err);
|
||||
+ ok(!ret, "HttpQueryInfo succeeded\n");
|
||||
+ ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err);
|
||||
|
||||
size = sizeof(buffer) - 1;
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
@@ -3081,7 +3081,7 @@ static void test_header_override(int port)
|
||||
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
|
||||
ok(ret, "HttpSendRequest failed\n");
|
||||
|
||||
- test_status_code_todo(req, 200);
|
||||
+ test_status_code(req, 200);
|
||||
|
||||
InternetCloseHandle(req);
|
||||
req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0);
|
||||
@@ -3229,7 +3229,7 @@ static void test_header_override(int port)
|
||||
ret = HttpSendRequestA( req, NULL, 0, NULL, 0 );
|
||||
ok( ret, "HttpSendRequestA failed %u\n", GetLastError() );
|
||||
|
||||
- test_status_code(req, 200);
|
||||
+ test_status_code_todo(req, 200);
|
||||
|
||||
InternetCloseHandle(req);
|
||||
InternetCloseHandle(con);
|
||||
@@ -3268,7 +3268,7 @@ static void test_header_override(int port)
|
||||
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
|
||||
ok(ret, "HttpSendRequestA failed %u\n", GetLastError());
|
||||
|
||||
- test_status_code(req, 200);
|
||||
+ test_status_code_todo(req, 200);
|
||||
|
||||
InternetCloseHandle(req);
|
||||
InternetCloseHandle(con);
|
||||
--
|
||||
2.4.3
|
||||
|
@@ -1,49 +0,0 @@
|
||||
From f0e05bd23a5a4377462586a0f8bd9c54117dcbb8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 16 May 2015 01:57:17 +0200
|
||||
Subject: wininet: Use request->server->canon_host_port in authentication
|
||||
process.
|
||||
|
||||
---
|
||||
dlls/wininet/http.c | 2 +-
|
||||
dlls/wininet/tests/http.c | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
|
||||
index 356ebb6..3232fad 100644
|
||||
--- a/dlls/wininet/http.c
|
||||
+++ b/dlls/wininet/http.c
|
||||
@@ -5116,7 +5116,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
|
||||
dwBufferSize=2048;
|
||||
if (request->status_code == HTTP_STATUS_DENIED)
|
||||
{
|
||||
- WCHAR *host = get_host_header( request );
|
||||
+ WCHAR *host = heap_strdupW( request->server->canon_host_port );
|
||||
DWORD dwIndex = 0;
|
||||
while (HTTP_HttpQueryInfoW(request,HTTP_QUERY_WWW_AUTHENTICATE,szAuthValue,&dwBufferSize,&dwIndex) == ERROR_SUCCESS)
|
||||
{
|
||||
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
|
||||
index 2ac075f..9e207b9 100644
|
||||
--- a/dlls/wininet/tests/http.c
|
||||
+++ b/dlls/wininet/tests/http.c
|
||||
@@ -3215,7 +3215,7 @@ static void test_header_override(int port)
|
||||
ret = HttpSendRequestA( req, NULL, 0, NULL, 0 );
|
||||
ok( ret, "HttpSendRequestA failed %u\n", GetLastError() );
|
||||
|
||||
- test_status_code_todo(req, 200);
|
||||
+ test_status_code(req, 200);
|
||||
|
||||
InternetCloseHandle(req);
|
||||
InternetCloseHandle(con);
|
||||
@@ -3254,7 +3254,7 @@ static void test_header_override(int port)
|
||||
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
|
||||
ok(ret, "HttpSendRequestA failed %u\n", GetLastError());
|
||||
|
||||
- test_status_code_todo(req, 200);
|
||||
+ test_status_code(req, 200);
|
||||
|
||||
InternetCloseHandle(req);
|
||||
InternetCloseHandle(con);
|
||||
--
|
||||
2.4.0
|
||||
|
@@ -1,54 +0,0 @@
|
||||
From 53df41c8abfc5bafd1ba214d58a3edda1099024b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 16 May 2015 02:00:57 +0200
|
||||
Subject: wininet: Use request->server->canon_host_port when querying for
|
||||
INTERNET_OPTION_URL.
|
||||
|
||||
---
|
||||
dlls/wininet/http.c | 11 +----------
|
||||
dlls/wininet/tests/http.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
|
||||
index b61a96a..edea9f8 100644
|
||||
--- a/dlls/wininet/http.c
|
||||
+++ b/dlls/wininet/http.c
|
||||
@@ -2142,21 +2142,12 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
|
||||
case INTERNET_OPTION_URL: {
|
||||
static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0};
|
||||
WCHAR url[INTERNET_MAX_URL_LENGTH];
|
||||
- HTTPHEADERW *host_header;
|
||||
- const WCHAR *host;
|
||||
|
||||
TRACE("INTERNET_OPTION_URL\n");
|
||||
|
||||
- EnterCriticalSection( &req->headers_section );
|
||||
-
|
||||
- host_header = HTTP_GetHeader(req, hostW);
|
||||
- if (host_header) host = host_header->lpszValue;
|
||||
- else host = req->server->canon_host_port;
|
||||
-
|
||||
strcpyW(url, httpW);
|
||||
- strcatW(url, host);
|
||||
+ strcatW(url, req->server->canon_host_port);
|
||||
strcatW(url, req->path);
|
||||
- LeaveCriticalSection( &req->headers_section );
|
||||
|
||||
TRACE("INTERNET_OPTION_URL: %s\n",debugstr_w(url));
|
||||
return str_to_buffer(url, buffer, size, unicode);
|
||||
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
|
||||
index fd235b1..1a82aba 100644
|
||||
--- a/dlls/wininet/tests/http.c
|
||||
+++ b/dlls/wininet/tests/http.c
|
||||
@@ -3076,7 +3076,7 @@ static void test_header_override(int port)
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
ret = InternetQueryOptionA(req, INTERNET_OPTION_URL, buffer, &size);
|
||||
ok(ret, "InternetQueryOption failed\n");
|
||||
- todo_wine ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer);
|
||||
+ ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer);
|
||||
|
||||
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
|
||||
ok(ret, "HttpSendRequest failed\n");
|
||||
--
|
||||
2.4.3
|
||||
|
@@ -1 +1 @@
|
||||
Fixes: [28911] Add HTTP Host header in HttpSendRequest instead of HttpOpenRequest
|
||||
# Fixes: [28911] Add HTTP Host header in HttpSendRequest instead of HttpOpenRequest
|
||||
|
Reference in New Issue
Block a user