Rebase against cb0e4f5f4f7dc10a0933349ad780a11405cd736e.

This commit is contained in:
Alistair Leslie-Hughes 2022-09-20 08:49:48 +10:00
parent 1d75f6950a
commit c10d599428
3 changed files with 25 additions and 25 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "f5b92137257b9564dca623ee9578c49b4495e220"
echo "cb0e4f5f4f7dc10a0933349ad780a11405cd736e"
}
# Show version information

View File

@ -1,4 +1,4 @@
From 0703846f52cc70153aacee4ef699008da450bfe8 Mon Sep 17 00:00:00 2001
From ec84f3463bb1750c51e062b80c3ce16dabb972e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 16 May 2015 03:16:15 +0200
Subject: [PATCH] wininet: Replacing header fields should fail if they do not
@ -12,10 +12,10 @@ a way that it behaves identical to the old code in such situations.
1 file changed, 99 insertions(+), 98 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 55698467cda..c618652cfaa 100644
index 575ebab24c6..132ed61e1de 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -6108,130 +6108,131 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer)
@@ -6112,130 +6112,131 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer)
static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR value, DWORD dwModifier)
{
@ -31,23 +31,23 @@ index 55698467cda..c618652cfaa 100644
EnterCriticalSection( &request->headers_section );
- /* REPLACE wins out over ADD */
- if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE)
- dwModifier &= ~HTTP_ADDHDR_FLAG_ADD;
-
- if (dwModifier & HTTP_ADDHDR_FLAG_ADD)
- index = -1;
- else
- index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only);
- if (dwModifier & HTTP_ADDREQ_FLAG_REPLACE)
- dwModifier &= ~HTTP_ADDREQ_FLAG_ADD;
+ index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only);
+ if (index >= 0)
+ {
+ lphttpHdr = &request->custHeaders[index];
- if (dwModifier & HTTP_ADDREQ_FLAG_ADD)
- index = -1;
- else
- index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only);
-
- if (index >= 0)
- {
- if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW)
- if (dwModifier & HTTP_ADDREQ_FLAG_ADD_IF_NEW)
+ /* replace existing header if FLAG_REPLACE is given */
+ if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE)
+ if (dwModifier & HTTP_ADDREQ_FLAG_REPLACE)
{
- LeaveCriticalSection( &request->headers_section );
- return ERROR_HTTP_INVALID_HEADER;
@ -92,20 +92,20 @@ index 55698467cda..c618652cfaa 100644
+ res = HTTP_InsertCustomHeader( request, &hdr );
+ }
- if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE)
- if (dwModifier & HTTP_ADDREQ_FLAG_REPLACE)
- {
- HTTP_DeleteCustomHeader( request, index );
+ goto out;
+ }
+
- if (value && value[0])
+ /* do not add new header if FLAG_ADD_IF_NEW is set */
+ if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW)
+ if (dwModifier & HTTP_ADDREQ_FLAG_ADD_IF_NEW)
+ {
+ res = ERROR_HTTP_INVALID_HEADER; /* FIXME */
+ goto out;
+ }
- if (value && value[0])
+
+ /* handle appending to existing header */
+ if (dwModifier & COALESCEFLAGS)
{
@ -125,12 +125,12 @@ index 55698467cda..c618652cfaa 100644
- hdr.lpszField = (LPWSTR)field;
- hdr.lpszValue = (LPWSTR)value;
- hdr.wFlags = hdr.wCount = 0;
+ if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA)
+ if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA)
+ {
+ ch = ',';
+ lphttpHdr->wFlags |= HDR_COMMADELIMITED;
+ }
+ else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON)
+ else if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON)
+ {
+ ch = ';';
+ lphttpHdr->wFlags |= HDR_COMMADELIMITED;
@ -175,7 +175,7 @@ index 55698467cda..c618652cfaa 100644
+ }
+
+ /* FIXME: What about other combinations? */
+ if ((dwModifier & ~HTTP_ADDHDR_FLAG_REQ) == HTTP_ADDHDR_FLAG_REPLACE)
+ if ((dwModifier & ~HTTP_ADDHDR_FLAG_REQ) == HTTP_ADDREQ_FLAG_REPLACE)
{
- LPWSTR lpsztmp;
- WCHAR ch = 0;
@ -186,12 +186,12 @@ index 55698467cda..c618652cfaa 100644
+ goto out;
+ }
- if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA)
- if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA)
- {
- ch = ',';
- lphttpHdr->wFlags |= HDR_COMMADELIMITED;
- }
- else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON)
- else if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON)
- {
- ch = ';';
- lphttpHdr->wFlags |= HDR_COMMADELIMITED;
@ -246,5 +246,5 @@ index 55698467cda..c618652cfaa 100644
/***********************************************************************
--
2.34.1
2.35.1

View File

@ -1 +1 @@
f5b92137257b9564dca623ee9578c49b4495e220
cb0e4f5f4f7dc10a0933349ad780a11405cd736e