Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3cd1cfea
Commit
3cd1cfea
authored
Dec 11, 2003
by
Jeremy Shaw
Committed by
Alexandre Julliard
Dec 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a '\r\n' to lpszHeaders if it is not already terminated by
'\r\n'.
parent
39a16e82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
4 deletions
+38
-4
http.c
dlls/wininet/http.c
+38
-4
No files found.
dlls/wininet/http.c
View file @
3cd1cfea
...
...
@@ -1160,6 +1160,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
INT
i
;
BOOL
bSuccess
=
FALSE
;
LPSTR
requestString
=
NULL
;
LPSTR
lpszHeaders_r_n
=
NULL
;
/* lpszHeaders with atleast one pair of \r\n at the end */
INT
requestStringLen
;
INT
responseLen
;
INT
headerLength
=
0
;
...
...
@@ -1236,10 +1237,34 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
strlen
(
HTTPHEADER
)
+
5
;
/* " \r\n\r\n" */
/* add "\r\n" to end of lpszHeaders if needed */
if
(
lpszHeaders
)
{
int
len
=
strlen
(
lpszHeaders
);
/* Check if the string is terminated with \r\n, but not if
* the string is less that 2 characters long, because then
* we would be looking at memory before the beginning of
* the string. Besides, if it is less than 2 characters
* long, then clearly, its not terminated with \r\n.
*/
if
((
len
>
2
)
&&
(
memcmp
(
lpszHeaders
+
(
len
-
2
),
"
\r\n
"
,
2
)
==
0
))
{
lpszHeaders_r_n
=
HTTP_strdup
(
lpszHeaders
);
}
else
{
TRACE
(
"Adding
\r\n
to lpszHeaders.
\n
"
);
lpszHeaders_r_n
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
lpszHeaders
)
+
3
);
strcpy
(
lpszHeaders_r_n
,
lpszHeaders
);
strcpy
(
lpszHeaders_r_n
+
strlen
(
lpszHeaders
),
"
\r\n
"
);
}
}
/* Add length of passed headers */
if
(
lpszHeaders
)
{
headerLength
=
-
1
==
dwHeaderLength
?
strlen
(
lpszHeaders
)
:
dwHeaderLength
;
headerLength
=
-
1
==
dwHeaderLength
?
strlen
(
lpszHeaders
_r_n
)
:
dwHeaderLength
;
requestStringLen
+=
headerLength
+
2
;
/* \r\n */
}
...
...
@@ -1319,12 +1344,18 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
cnt
+=
sprintf
(
requestString
+
cnt
,
"%s%s"
,
HTTPHOSTHEADER
,
lpwhr
->
lpszHostName
);
/* Append passed request headers */
if
(
lpszHeaders
)
if
(
lpszHeaders
_r_n
)
{
strcpy
(
requestString
+
cnt
,
"
\r\n
"
);
cnt
+=
2
;
strcpy
(
requestString
+
cnt
,
lpszHeaders
);
strcpy
(
requestString
+
cnt
,
lpszHeaders
_r_n
);
cnt
+=
headerLength
;
/* only add \r\n if not already present */
if
(
memcmp
((
requestString
+
cnt
)
-
2
,
"
\r\n
"
,
2
)
!=
0
)
{
strcpy
(
requestString
+
cnt
,
"
\r\n
"
);
cnt
+=
2
;
}
}
/* Set (header) termination string for request */
...
...
@@ -1345,7 +1376,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
cnt
+=
dwOptionalLength
;
/* we also have to decrease the expected string length by two,
* since we won't be adding on those following \r\n's */
requestStringLen
-=
2
;
requestStringLen
-=
2
;
}
else
{
/* if there is no optional data, add on another \r\n just to be safe */
...
...
@@ -1464,6 +1495,9 @@ lend:
if
(
requestString
)
HeapFree
(
GetProcessHeap
(),
0
,
requestString
);
if
(
lpszHeaders
)
HeapFree
(
GetProcessHeap
(),
0
,
lpszHeaders_r_n
);
/* TODO: send notification for P3P header */
if
(
!
(
hIC
->
hdr
.
dwFlags
&
INTERNET_FLAG_NO_AUTO_REDIRECT
)
&&
bSuccess
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment