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
04b33ef0
Commit
04b33ef0
authored
May 05, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
May 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Don't poll for POLLIN or POLLPRI if there are alerted read asyncs.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cafd2600
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
afd.c
dlls/ws2_32/tests/afd.c
+1
-1
sock.c
server/sock.c
+21
-13
No files found.
dlls/ws2_32/tests/afd.c
View file @
04b33ef0
...
...
@@ -382,7 +382,7 @@ static void test_poll(void)
ok
(
size
==
1
,
"got size %lu
\n
"
,
size
);
ret
=
WaitForSingleObject
(
event
,
0
);
todo_wine
ok
(
ret
==
WAIT_TIMEOUT
,
"got %#x
\n
"
,
ret
);
ok
(
ret
==
WAIT_TIMEOUT
,
"got %#x
\n
"
,
ret
);
ret
=
send
(
client
,
"a"
,
1
,
0
);
ok
(
ret
==
1
,
"got %d
\n
"
,
ret
);
...
...
server/sock.c
View file @
04b33ef0
...
...
@@ -1229,6 +1229,18 @@ static int sock_get_poll_events( struct fd *fd )
if
(
!
sock
->
type
)
/* not initialized yet */
return
-
1
;
LIST_FOR_EACH_ENTRY
(
req
,
&
poll_list
,
struct
poll_req
,
entry
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
req
->
count
;
++
i
)
{
if
(
req
->
sockets
[
i
].
sock
!=
sock
)
continue
;
ev
|=
poll_flags_from_afd
(
sock
,
req
->
sockets
[
i
].
mask
);
}
}
switch
(
sock
->
state
)
{
case
SOCK_UNCONNECTED
:
...
...
@@ -1271,7 +1283,15 @@ static int sock_get_poll_events( struct fd *fd )
}
else
if
(
async_queued
(
&
sock
->
read_q
))
{
if
(
async_waiting
(
&
sock
->
read_q
))
ev
|=
POLLIN
|
POLLPRI
;
/* Clear POLLIN and POLLPRI if we have an alerted async, even if
* we're polling this socket for READ or OOB. We can't signal the
* poll if the pending async will read all of the data [cf. the
* matching logic in sock_dispatch_asyncs()], but we also don't
* want to spin polling for POLLIN if we're not going to use it. */
if
(
async_waiting
(
&
sock
->
read_q
))
ev
|=
POLLIN
|
POLLPRI
;
else
ev
&=
~
(
POLLIN
|
POLLPRI
);
}
else
{
...
...
@@ -1302,18 +1322,6 @@ static int sock_get_poll_events( struct fd *fd )
break
;
}
LIST_FOR_EACH_ENTRY
(
req
,
&
poll_list
,
struct
poll_req
,
entry
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
req
->
count
;
++
i
)
{
if
(
req
->
sockets
[
i
].
sock
!=
sock
)
continue
;
ev
|=
poll_flags_from_afd
(
sock
,
req
->
sockets
[
i
].
mask
);
}
}
return
ev
;
}
...
...
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