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
36d7bf95
Commit
36d7bf95
authored
May 26, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Jun 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Make wait in connect() alertable.
parent
15763322
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
socket.c
dlls/ws2_32/socket.c
+1
-1
sock.c
dlls/ws2_32/tests/sock.c
+22
-0
No files found.
dlls/ws2_32/socket.c
View file @
36d7bf95
...
...
@@ -1240,7 +1240,7 @@ int WINAPI connect( SOCKET s, const struct sockaddr *addr, int len )
free
(
params
);
if
(
status
==
STATUS_PENDING
)
{
if
(
WaitForSingleObject
(
sync_event
,
INFINITE
)
==
WAIT_FAILED
)
return
-
1
;
if
(
wait_event_alertable
(
sync_event
)
==
WAIT_FAILED
)
return
-
1
;
status
=
io
.
u
.
Status
;
}
if
(
status
)
...
...
dlls/ws2_32/tests/sock.c
View file @
36d7bf95
...
...
@@ -8443,6 +8443,28 @@ static void test_connect(void)
WSACloseEvent
(
overlapped
.
hEvent
);
closesocket
(
connector
);
if
(
0
)
{
/* Wait in connect() is alertable. This may take a very long time before connection fails,
* so disable the test. Testing with localhost is unreliable as that may avoid waiting in
* accept(). */
connector
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
ok
(
connector
!=
INVALID_SOCKET
,
"failed to create socket, error %u
\n
"
,
WSAGetLastError
());
address
.
sin_addr
.
s_addr
=
inet_addr
(
"8.8.8.8"
);
address
.
sin_port
=
htons
(
255
);
apc_count
=
0
;
SleepEx
(
0
,
TRUE
);
ok
(
apc_count
==
0
,
"got apc_count %d.
\n
"
,
apc_count
);
bret
=
QueueUserAPC
(
apc_func
,
GetCurrentThread
(),
(
ULONG_PTR
)
&
apc_count
);
ok
(
bret
,
"QueueUserAPC returned %d
\n
"
,
bret
);
iret
=
connect
(
connector
,
(
struct
sockaddr
*
)
&
address
,
sizeof
(
address
));
ok
(
apc_count
==
1
,
"got apc_count %d.
\n
"
,
apc_count
);
ok
(
iret
==
-
1
&&
(
WSAGetLastError
()
==
WSAECONNREFUSED
||
WSAGetLastError
()
==
WSAETIMEDOUT
),
"unexpected iret %d, error %d.
\n
"
,
iret
,
WSAGetLastError
());
closesocket
(
connector
);
}
/* Test connect after previous connect attempt failure. */
connector
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
ok
(
connector
!=
INVALID_SOCKET
,
"failed to create socket, error %u
\n
"
,
WSAGetLastError
());
...
...
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