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
f732065c
Commit
f732065c
authored
Aug 28, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Test secure connections. Fix a crash when no response is returned.
parent
0b19e855
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
request.c
dlls/winhttp/request.c
+1
-0
winhttp.c
dlls/winhttp/tests/winhttp.c
+49
-0
No files found.
dlls/winhttp/request.c
View file @
f732065c
...
...
@@ -538,6 +538,7 @@ static BOOL query_headers( request_t *request, DWORD level, LPCWSTR name, LPVOID
else
headers
=
request
->
raw_headers
;
if
(
!
headers
)
return
FALSE
;
len
=
strlenW
(
headers
)
*
sizeof
(
WCHAR
);
if
(
len
+
sizeof
(
WCHAR
)
>
*
buflen
)
{
...
...
dlls/winhttp/tests/winhttp.c
View file @
f732065c
...
...
@@ -525,6 +525,54 @@ static void test_WinHttpAddHeaders(void)
}
static
void
test_secure_connection
(
void
)
{
static
const
WCHAR
google
[]
=
{
'w'
,
'w'
,
'w'
,
'.'
,
'g'
,
'o'
,
'o'
,
'g'
,
'l'
,
'e'
,
'.'
,
'c'
,
'o'
,
'm'
,
0
};
HANDLE
ses
,
con
,
req
;
DWORD
size
;
BOOL
ret
;
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
con
=
WinHttpConnect
(
ses
,
google
,
443
,
0
);
ok
(
con
!=
NULL
,
"failed to open a connection %u
\n
"
,
GetLastError
());
/* try without setting WINHTTP_FLAG_SECURE */
req
=
WinHttpOpenRequest
(
con
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
());
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
ret
=
WinHttpReceiveResponse
(
req
,
NULL
);
ok
(
!
ret
,
"succeeded unexpectedly
\n
"
);
size
=
0
;
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_RAW_HEADERS_CRLF
,
NULL
,
NULL
,
&
size
,
NULL
);
ok
(
!
ret
,
"succeeded unexpectedly
\n
"
);
WinHttpCloseHandle
(
req
);
req
=
WinHttpOpenRequest
(
con
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
WINHTTP_FLAG_SECURE
);
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
());
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
ret
=
WinHttpReceiveResponse
(
req
,
NULL
);
ok
(
ret
,
"failed to receive response %u
\n
"
,
GetLastError
());
size
=
0
;
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_RAW_HEADERS_CRLF
,
NULL
,
NULL
,
&
size
,
NULL
);
ok
(
!
ret
,
"succeeded unexpectedly
\n
"
);
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
}
START_TEST
(
winhttp
)
{
test_OpenRequest
();
...
...
@@ -532,4 +580,5 @@ START_TEST (winhttp)
test_WinHttpTimeFromSystemTime
();
test_WinHttpTimeToSystemTime
();
test_WinHttpAddHeaders
();
test_secure_connection
();
}
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