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
4745c567
Commit
4745c567
authored
Jan 17, 2011
by
Greg Geldorp
Committed by
Alexandre Julliard
Jan 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp/tests: Fix tests when connecting via proxy.
parent
ac66c575
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
19 deletions
+43
-19
winhttp.c
dlls/winhttp/tests/winhttp.c
+43
-19
No files found.
dlls/winhttp/tests/winhttp.c
View file @
4745c567
...
...
@@ -34,6 +34,25 @@ static const WCHAR test_useragent[] =
static
const
WCHAR
test_server
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
0
};
static
const
WCHAR
localhostW
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'h'
,
'o'
,
's'
,
't'
,
0
};
static
BOOL
proxy_active
(
void
)
{
WINHTTP_PROXY_INFO
proxy_info
;
BOOL
active
=
FALSE
;
if
(
WinHttpGetDefaultProxyConfiguration
(
&
proxy_info
))
{
active
=
(
proxy_info
.
lpszProxy
!=
NULL
);
if
(
active
)
GlobalFree
((
HGLOBAL
)
proxy_info
.
lpszProxy
);
if
(
proxy_info
.
lpszProxyBypass
!=
NULL
)
GlobalFree
((
HGLOBAL
)
proxy_info
.
lpszProxyBypass
);
}
else
active
=
FALSE
;
return
active
;
}
static
void
test_QueryOption
(
void
)
{
BOOL
ret
;
...
...
@@ -796,7 +815,7 @@ static void test_secure_connection(void)
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
ret
=
WinHttpReceiveResponse
(
req
,
NULL
);
ok
(
!
ret
,
"succeeded unexpectedly
\n
"
);
ok
(
!
ret
||
proxy_active
()
,
"succeeded unexpectedly
\n
"
);
size
=
0
;
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_RAW_HEADERS_CRLF
,
NULL
,
NULL
,
&
size
,
NULL
);
...
...
@@ -1668,28 +1687,33 @@ static void test_resolve_timeout(void)
DWORD
timeout
;
BOOL
ret
;
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
timeout
=
10000
;
ret
=
WinHttpSetOption
(
ses
,
WINHTTP_OPTION_RESOLVE_TIMEOUT
,
&
timeout
,
sizeof
(
timeout
));
ok
(
ret
,
"failed to set resolve timeout %u
\n
"
,
GetLastError
());
if
(
!
proxy_active
())
{
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
con
=
WinHttpConnect
(
ses
,
nxdomain
,
0
,
0
);
ok
(
con
!=
NULL
,
"failed to open a connection %u
\n
"
,
GetLastError
());
timeout
=
10000
;
ret
=
WinHttpSetOption
(
ses
,
WINHTTP_OPTION_RESOLVE_TIMEOUT
,
&
timeout
,
sizeof
(
timeout
));
ok
(
ret
,
"failed to set resolve timeout %u
\n
"
,
GetLastError
());
req
=
WinHttpOpenRequest
(
con
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
req
!=
NULL
,
"failed to open a request
%u
\n
"
,
GetLastError
());
con
=
WinHttpConnect
(
ses
,
nxdomain
,
0
,
0
);
ok
(
con
!=
NULL
,
"failed to open a connection
%u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
ok
(
!
ret
,
"sent request
\n
"
);
ok
(
GetLastError
()
==
ERROR_WINHTTP_NAME_NOT_RESOLVED
,
"expected ERROR_WINHTTP_NAME_NOT_RESOLVED got %u
\n
"
,
GetLastError
());
req
=
WinHttpOpenRequest
(
con
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
());
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
ok
(
!
ret
,
"sent request
\n
"
);
ok
(
GetLastError
()
==
ERROR_WINHTTP_NAME_NOT_RESOLVED
,
"expected ERROR_WINHTTP_NAME_NOT_RESOLVED got %u
\n
"
,
GetLastError
());
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
}
else
skip
(
"Skipping host resolution tests, host resolution preformed by proxy
\n
"
);
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
...
...
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