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
39b1dbed
Commit
39b1dbed
authored
Oct 29, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Accept empty headers parameter in WinHttpSendRequest.
parent
ebe6dabe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
request.c
dlls/winhttp/request.c
+1
-0
winhttp.c
dlls/winhttp/tests/winhttp.c
+25
-0
No files found.
dlls/winhttp/request.c
View file @
39b1dbed
...
@@ -411,6 +411,7 @@ BOOL add_request_headers( request_t *request, LPCWSTR headers, DWORD len, DWORD
...
@@ -411,6 +411,7 @@ BOOL add_request_headers( request_t *request, LPCWSTR headers, DWORD len, DWORD
header_t
*
header
;
header_t
*
header
;
if
(
len
==
~
0u
)
len
=
strlenW
(
headers
);
if
(
len
==
~
0u
)
len
=
strlenW
(
headers
);
if
(
!
len
)
return
TRUE
;
if
(
!
(
buffer
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
FALSE
;
if
(
!
(
buffer
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
FALSE
;
strcpyW
(
buffer
,
headers
);
strcpyW
(
buffer
,
headers
);
...
...
dlls/winhttp/tests/winhttp.c
View file @
39b1dbed
...
@@ -221,6 +221,30 @@ static void test_OpenRequest (void)
...
@@ -221,6 +221,30 @@ static void test_OpenRequest (void)
}
}
static
void
test_empty_headers_param
(
void
)
{
static
const
WCHAR
winehq
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
0
};
static
const
WCHAR
empty
[]
=
{
0
};
HANDLE
ses
,
con
,
req
;
BOOL
ret
;
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
con
=
WinHttpConnect
(
ses
,
winehq
,
80
,
0
);
ok
(
con
!=
NULL
,
"failed to open a connection %u
\n
"
,
GetLastError
());
req
=
WinHttpOpenRequest
(
con
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
());
ret
=
WinHttpSendRequest
(
req
,
empty
,
0
,
NULL
,
0
,
0
,
0
);
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
}
static
void
test_SendRequest
(
void
)
static
void
test_SendRequest
(
void
)
{
{
HINTERNET
session
,
request
,
connection
;
HINTERNET
session
,
request
,
connection
;
...
@@ -978,4 +1002,5 @@ START_TEST (winhttp)
...
@@ -978,4 +1002,5 @@ START_TEST (winhttp)
test_request_parameter_defaults
();
test_request_parameter_defaults
();
test_QueryOption
();
test_QueryOption
();
test_set_default_proxy_config
();
test_set_default_proxy_config
();
test_empty_headers_param
();
}
}
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