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
3905c7a0
Commit
3905c7a0
authored
Sep 25, 2009
by
Mike Kaplinskiy
Committed by
Alexandre Julliard
Sep 25, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Try accepting a connection before blocking.
parent
94657000
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
socket.c
dlls/ws2_32/socket.c
+15
-15
No files found.
dlls/ws2_32/socket.c
View file @
3905c7a0
...
...
@@ -1457,6 +1457,7 @@ static int WS2_register_async_shutdown( SOCKET s, int type )
SOCKET
WINAPI
WS_accept
(
SOCKET
s
,
struct
WS_sockaddr
*
addr
,
int
*
addrlen32
)
{
NTSTATUS
status
;
SOCKET
as
;
BOOL
is_blocking
;
...
...
@@ -1464,33 +1465,32 @@ SOCKET WINAPI WS_accept(SOCKET s, struct WS_sockaddr *addr,
is_blocking
=
_is_blocking
(
s
);
do
{
if
(
is_blocking
)
{
int
fd
=
get_sock_fd
(
s
,
FILE_READ_DATA
,
NULL
);
if
(
fd
==
-
1
)
return
INVALID_SOCKET
;
/* block here */
do_block
(
fd
,
POLLIN
,
-
1
);
_sync_sock_state
(
s
);
/* let wineserver notice connection */
release_sock_fd
(
s
,
fd
);
/* retrieve any error codes from it */
SetLastError
(
_get_sock_error
(
s
,
FD_ACCEPT_BIT
));
/* FIXME: care about the error? */
}
/* try accepting first (if there is a deferred connection) */
SERVER_START_REQ
(
accept_socket
)
{
req
->
lhandle
=
wine_server_obj_handle
(
SOCKET2HANDLE
(
s
)
);
req
->
access
=
GENERIC_READ
|
GENERIC_WRITE
|
SYNCHRONIZE
;
req
->
attributes
=
OBJ_INHERIT
;
s
et_error
(
wine_server_call
(
req
)
);
s
tatus
=
wine_server_call
(
req
);
as
=
HANDLE2SOCKET
(
wine_server_ptr_handle
(
reply
->
handle
));
}
SERVER_END_REQ
;
if
(
a
s
)
if
(
!
statu
s
)
{
if
(
addr
)
WS_getpeername
(
as
,
addr
,
addrlen32
);
return
as
;
}
}
while
(
is_blocking
);
if
(
is_blocking
&&
status
==
WSAEWOULDBLOCK
)
{
int
fd
=
get_sock_fd
(
s
,
FILE_READ_DATA
,
NULL
);
/* block here */
do_block
(
fd
,
POLLIN
,
-
1
);
_sync_sock_state
(
s
);
/* let wineserver notice connection */
release_sock_fd
(
s
,
fd
);
}
}
while
(
is_blocking
&&
status
==
WSAEWOULDBLOCK
);
set_error
(
status
);
return
INVALID_SOCKET
;
}
...
...
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