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
c86ba5d0
Commit
c86ba5d0
authored
Jul 05, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Separate a poll_single_socket() helper.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
026b1920
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
19 deletions
+25
-19
sock.c
server/sock.c
+25
-19
No files found.
server/sock.c
View file @
c86ba5d0
...
...
@@ -2734,6 +2734,29 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
}
}
static
int
poll_single_socket
(
struct
sock
*
sock
,
int
mask
)
{
struct
pollfd
pollfd
;
pollfd
.
fd
=
get_unix_fd
(
sock
->
fd
);
pollfd
.
events
=
poll_flags_from_afd
(
sock
,
mask
);
if
(
pollfd
.
events
<
0
||
poll
(
&
pollfd
,
1
,
0
)
<
0
)
return
0
;
if
((
mask
&
AFD_POLL_HUP
)
&&
(
pollfd
.
revents
&
POLLIN
)
&&
sock
->
type
==
WS_SOCK_STREAM
)
{
char
dummy
;
if
(
!
recv
(
get_unix_fd
(
sock
->
fd
),
&
dummy
,
1
,
MSG_PEEK
))
{
pollfd
.
revents
&=
~
POLLIN
;
pollfd
.
revents
|=
POLLHUP
;
}
}
return
get_poll_flags
(
sock
,
pollfd
.
revents
)
&
mask
;
}
static
int
poll_socket
(
struct
sock
*
poll_sock
,
struct
async
*
async
,
timeout_t
timeout
,
unsigned
int
count
,
const
struct
poll_socket_input
*
input
)
{
...
...
@@ -2788,26 +2811,9 @@ static int poll_socket( struct sock *poll_sock, struct async *async, timeout_t t
for
(
i
=
0
;
i
<
count
;
++
i
)
{
struct
sock
*
sock
=
req
->
sockets
[
i
].
sock
;
struct
pollfd
pollfd
;
int
flags
;
pollfd
.
fd
=
get_unix_fd
(
sock
->
fd
);
pollfd
.
events
=
poll_flags_from_afd
(
sock
,
req
->
sockets
[
i
].
flags
);
if
(
pollfd
.
events
<
0
||
poll
(
&
pollfd
,
1
,
0
)
<
0
)
continue
;
if
((
req
->
sockets
[
i
].
flags
&
AFD_POLL_HUP
)
&&
(
pollfd
.
revents
&
POLLIN
)
&&
sock
->
type
==
WS_SOCK_STREAM
)
{
char
dummy
;
if
(
!
recv
(
get_unix_fd
(
sock
->
fd
),
&
dummy
,
1
,
MSG_PEEK
))
{
pollfd
.
revents
&=
~
POLLIN
;
pollfd
.
revents
|=
POLLHUP
;
}
}
int
mask
=
req
->
sockets
[
i
].
flags
;
int
flags
=
poll_single_socket
(
sock
,
mask
);
flags
=
get_poll_flags
(
sock
,
pollfd
.
revents
)
&
req
->
sockets
[
i
].
flags
;
if
(
flags
)
{
req
->
iosb
->
status
=
STATUS_SUCCESS
;
...
...
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