Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0d501685
Commit
0d501685
authored
Dec 09, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp/tests: Handle more potential connection failures.
parent
5e6490a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
10 deletions
+39
-10
notification.c
dlls/winhttp/tests/notification.c
+36
-0
winhttp.c
dlls/winhttp/tests/winhttp.c
+3
-10
No files found.
dlls/winhttp/tests/notification.c
View file @
0d501685
...
...
@@ -186,6 +186,11 @@ static void test_connection_cache( void )
setup_test
(
&
info
,
winhttp_send_request
,
__LINE__
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_WINHTTP_CANNOT_CONNECT
)
{
skip
(
"connection failed, skipping
\n
"
);
goto
done
;
}
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
setup_test
(
&
info
,
winhttp_receive_response
,
__LINE__
);
...
...
@@ -209,6 +214,11 @@ static void test_connection_cache( void )
setup_test
(
&
info
,
winhttp_send_request
,
__LINE__
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_WINHTTP_CANNOT_CONNECT
)
{
skip
(
"connection failed, skipping
\n
"
);
goto
done
;
}
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
setup_test
(
&
info
,
winhttp_receive_response
,
__LINE__
);
...
...
@@ -253,6 +263,11 @@ static void test_connection_cache( void )
setup_test
(
&
info
,
winhttp_send_request
,
__LINE__
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_WINHTTP_CANNOT_CONNECT
)
{
skip
(
"connection failed, skipping
\n
"
);
goto
done
;
}
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
setup_test
(
&
info
,
winhttp_receive_response
,
__LINE__
);
...
...
@@ -276,6 +291,11 @@ static void test_connection_cache( void )
setup_test
(
&
info
,
winhttp_send_request
,
__LINE__
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_WINHTTP_CANNOT_CONNECT
)
{
skip
(
"connection failed, skipping
\n
"
);
goto
done
;
}
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
setup_test
(
&
info
,
winhttp_receive_response
,
__LINE__
);
...
...
@@ -288,6 +308,7 @@ static void test_connection_cache( void )
ok
(
status
==
200
,
"request failed unexpectedly %u
\n
"
,
status
);
setup_test
(
&
info
,
winhttp_close_handle
,
__LINE__
);
done:
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
...
...
@@ -353,6 +374,11 @@ static void test_redirect( void )
setup_test
(
&
info
,
winhttp_send_request
,
__LINE__
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_WINHTTP_CANNOT_CONNECT
)
{
skip
(
"connection failed, skipping
\n
"
);
goto
done
;
}
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
setup_test
(
&
info
,
winhttp_receive_response
,
__LINE__
);
...
...
@@ -365,6 +391,7 @@ static void test_redirect( void )
ok
(
status
==
200
,
"request failed unexpectedly %u
\n
"
,
status
);
setup_test
(
&
info
,
winhttp_close_handle
,
__LINE__
);
done:
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
...
...
@@ -435,6 +462,15 @@ static void test_async( void )
setup_test
(
&
info
,
winhttp_send_request
,
__LINE__
);
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_WINHTTP_CANNOT_CONNECT
)
{
skip
(
"connection failed, skipping
\n
"
);
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
CloseHandle
(
info
.
wait
);
return
;
}
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
WaitForSingleObject
(
info
.
wait
,
INFINITE
);
...
...
dlls/winhttp/tests/winhttp.c
View file @
0d501685
...
...
@@ -954,7 +954,7 @@ static void test_request_parameter_defaults(void)
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
());
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_WINHTTP_CANNOT_CONNECT
)
if
(
!
ret
&&
(
GetLastError
()
==
ERROR_WINHTTP_CANNOT_CONNECT
||
GetLastError
()
==
ERROR_WINHTTP_TIMEOUT
)
)
{
skip
(
"connection failed, skipping
\n
"
);
goto
done
;
...
...
@@ -3044,12 +3044,8 @@ static void test_WinHttpGetProxyForUrl(void)
options
.
dwAutoDetectFlags
=
WINHTTP_AUTO_DETECT_TYPE_DNS_A
;
memset
(
&
info
,
0
,
sizeof
(
info
)
);
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
session
,
urlW
,
&
options
,
&
info
);
error
=
GetLastError
();
if
(
!
ret
)
ok
(
error
==
ERROR_WINHTTP_AUTODETECTION_FAILED
||
error
==
ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT
,
"got %u
\n
"
,
error
);
else
if
(
ret
)
{
trace
(
"Proxy.AccessType=%u
\n
"
,
info
.
dwAccessType
);
trace
(
"Proxy.Proxy=%s
\n
"
,
wine_dbgstr_w
(
info
.
lpszProxy
));
...
...
@@ -3063,11 +3059,8 @@ static void test_WinHttpGetProxyForUrl(void)
options
.
lpszAutoConfigUrl
=
wpadW
;
memset
(
&
info
,
0
,
sizeof
(
info
)
);
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
session
,
urlW
,
&
options
,
&
info
);
error
=
GetLastError
();
if
(
!
ret
)
ok
(
error
==
ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT
,
"got %u
\n
"
,
error
);
else
if
(
ret
)
{
trace
(
"Proxy.AccessType=%u
\n
"
,
info
.
dwAccessType
);
trace
(
"Proxy.Proxy=%s
\n
"
,
wine_dbgstr_w
(
info
.
lpszProxy
));
...
...
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