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
667e4828
Commit
667e4828
authored
Jan 15, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Calculate the header size if needed in HttpSendRequestW.
parent
b013ad16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
http.c
dlls/wininet/http.c
+7
-2
http.c
dlls/wininet/tests/http.c
+28
-0
No files found.
dlls/wininet/http.c
View file @
667e4828
...
...
@@ -2897,8 +2897,13 @@ BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders,
req
=
&
workRequest
.
u
.
HttpSendRequestW
;
if
(
lpszHeaders
)
{
req
->
lpszHeader
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwHeaderLength
*
sizeof
(
WCHAR
));
memcpy
(
req
->
lpszHeader
,
lpszHeaders
,
dwHeaderLength
*
sizeof
(
WCHAR
));
DWORD
size
;
if
(
dwHeaderLength
==
~
0u
)
size
=
(
strlenW
(
lpszHeaders
)
+
1
)
*
sizeof
(
WCHAR
);
else
size
=
dwHeaderLength
*
sizeof
(
WCHAR
);
req
->
lpszHeader
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
memcpy
(
req
->
lpszHeader
,
lpszHeaders
,
size
);
}
else
req
->
lpszHeader
=
0
;
...
...
dlls/wininet/tests/http.c
View file @
667e4828
...
...
@@ -1814,6 +1814,33 @@ static void test_http1_1(int port)
InternetCloseHandle
(
ses
);
}
static
void
test_HttpSendRequestW
(
int
port
)
{
static
const
WCHAR
header
[]
=
{
'U'
,
'A'
,
'-'
,
'C'
,
'P'
,
'U'
,
':'
,
' '
,
'x'
,
'8'
,
'6'
,
0
};
HINTERNET
ses
,
con
,
req
;
DWORD
error
;
BOOL
ret
;
ses
=
InternetOpen
(
"winetest"
,
INTERNET_OPEN_TYPE_DIRECT
,
NULL
,
NULL
,
INTERNET_FLAG_ASYNC
);
ok
(
ses
!=
NULL
,
"InternetOpen failed
\n
"
);
con
=
InternetConnect
(
ses
,
"localhost"
,
port
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
ok
(
con
!=
NULL
,
"InternetConnect failed
\n
"
);
req
=
HttpOpenRequest
(
con
,
NULL
,
"/test1"
,
NULL
,
NULL
,
NULL
,
0
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
SetLastError
(
0xdeadbeef
);
ret
=
HttpSendRequestW
(
req
,
header
,
~
0u
,
NULL
,
0
);
error
=
GetLastError
();
ok
(
!
ret
,
"HttpSendRequestW succeeded
\n
"
);
ok
(
error
==
ERROR_IO_PENDING
,
"got %u expected ERROR_IO_PENDING
\n
"
,
error
);
InternetCloseHandle
(
req
);
InternetCloseHandle
(
con
);
InternetCloseHandle
(
ses
);
}
static
void
test_cookie_header
(
int
port
)
{
HINTERNET
ses
,
con
,
req
;
...
...
@@ -2023,6 +2050,7 @@ static void test_http_connection(void)
test_cookie_header
(
si
.
port
);
test_basic_authentication
(
si
.
port
);
test_HttpQueryInfo
(
si
.
port
);
test_HttpSendRequestW
(
si
.
port
);
/* send the basic request again to shutdown the server thread */
test_basic_request
(
si
.
port
,
"GET"
,
"/quit"
);
...
...
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