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
904b6ea8
Commit
904b6ea8
authored
Oct 24, 2005
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made accept thread safe(r).
parent
f610f31c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
26 deletions
+31
-26
socket.c
dlls/winsock/socket.c
+31
-26
No files found.
dlls/winsock/socket.c
View file @
904b6ea8
...
...
@@ -1378,34 +1378,39 @@ SOCKET WINAPI WS_accept(SOCKET s, struct WS_sockaddr *addr,
int
*
addrlen32
)
{
SOCKET
as
;
BOOL
is_blocking
;
TRACE
(
"socket %04x
\n
"
,
s
);
if
(
_is_blocking
(
s
))
{
int
fd
=
get_sock_fd
(
s
,
GENERIC_READ
,
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? */
}
SERVER_START_REQ
(
accept_socket
)
{
req
->
lhandle
=
SOCKET2HANDLE
(
s
);
req
->
access
=
GENERIC_READ
|
GENERIC_WRITE
|
SYNCHRONIZE
;
req
->
inherit
=
TRUE
;
set_error
(
wine_server_call
(
req
)
);
as
=
HANDLE2SOCKET
(
reply
->
handle
);
}
SERVER_END_REQ
;
if
(
as
)
{
if
(
addr
)
WS_getpeername
(
as
,
addr
,
addrlen32
);
return
as
;
}
is_blocking
=
_is_blocking
(
s
);
do
{
if
(
is_blocking
)
{
int
fd
=
get_sock_fd
(
s
,
GENERIC_READ
,
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? */
}
SERVER_START_REQ
(
accept_socket
)
{
req
->
lhandle
=
SOCKET2HANDLE
(
s
);
req
->
access
=
GENERIC_READ
|
GENERIC_WRITE
|
SYNCHRONIZE
;
req
->
inherit
=
TRUE
;
set_error
(
wine_server_call
(
req
)
);
as
=
HANDLE2SOCKET
(
reply
->
handle
);
}
SERVER_END_REQ
;
if
(
as
)
{
if
(
addr
)
WS_getpeername
(
as
,
addr
,
addrlen32
);
return
as
;
}
}
while
(
is_blocking
);
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