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
2910dcea
Commit
2910dcea
authored
Aug 08, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Aug 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Don't return synchronously if the connection is refused.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
448ac0e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
socket.c
dlls/ws2_32/socket.c
+7
-1
sock.c
dlls/ws2_32/tests/sock.c
+6
-14
No files found.
dlls/ws2_32/socket.c
View file @
2910dcea
...
...
@@ -3586,7 +3586,13 @@ static BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int n
/* If the connect already failed */
if
(
status
==
STATUS_PIPE_DISCONNECTED
)
status
=
_get_sock_error
(
s
,
FD_CONNECT_BIT
);
{
ov
->
Internal
=
_get_sock_error
(
s
,
FD_CONNECT_BIT
);
ov
->
InternalHigh
=
0
;
if
(
cvalue
)
WS_AddCompletion
(
s
,
cvalue
,
ov
->
Internal
,
ov
->
InternalHigh
);
if
(
ov
->
hEvent
)
NtSetEvent
(
ov
->
hEvent
,
NULL
);
status
=
STATUS_PENDING
;
}
SetLastError
(
NtStatusToWSAError
(
status
)
);
}
}
...
...
dlls/ws2_32/tests/sock.c
View file @
2910dcea
...
...
@@ -7915,22 +7915,14 @@ static void test_ConnectEx(void)
address
.
sin_port
=
htons
(
1
);
bret
=
pConnectEx
(
connector
,
(
struct
sockaddr
*
)
&
address
,
addrlen
,
NULL
,
0
,
&
bytesReturned
,
&
overlapped
);
ok
(
bret
==
FALSE
&&
GetLastError
(),
"ConnectEx to bad destination failed: "
ok
(
bret
==
FALSE
&&
GetLastError
()
==
ERROR_IO_PENDING
,
"ConnectEx to bad destination failed: "
"returned %d + errno %d
\n
"
,
bret
,
GetLastError
());
dwret
=
WaitForSingleObject
(
overlapped
.
hEvent
,
15000
);
ok
(
dwret
==
WAIT_OBJECT_0
,
"Waiting for connect event failed with %d + errno %d
\n
"
,
dwret
,
GetLastError
());
if
(
GetLastError
()
==
ERROR_IO_PENDING
)
{
dwret
=
WaitForSingleObject
(
overlapped
.
hEvent
,
15000
);
ok
(
dwret
==
WAIT_OBJECT_0
,
"Waiting for connect event failed with %d + errno %d
\n
"
,
dwret
,
GetLastError
());
bret
=
GetOverlappedResult
((
HANDLE
)
connector
,
&
overlapped
,
&
bytesReturned
,
FALSE
);
ok
(
bret
==
FALSE
&&
GetLastError
()
==
ERROR_CONNECTION_REFUSED
,
"Connecting to a disconnected host returned error %d - %d
\n
"
,
bret
,
WSAGetLastError
());
}
else
{
ok
(
GetLastError
()
==
WSAECONNREFUSED
,
"Connecting to a disconnected host returned error %d - %d
\n
"
,
bret
,
WSAGetLastError
());
}
bret
=
GetOverlappedResult
((
HANDLE
)
connector
,
&
overlapped
,
&
bytesReturned
,
FALSE
);
ok
(
bret
==
FALSE
&&
GetLastError
()
==
ERROR_CONNECTION_REFUSED
,
"Connecting to a disconnected host returned error %d - %d
\n
"
,
bret
,
WSAGetLastError
());
end:
if
(
overlapped
.
hEvent
)
...
...
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