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
25f8698f
Commit
25f8698f
authored
Oct 31, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Only set sock->event when the event is first noticed.
Do not set it every time another event is polled. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55838
parent
99dd3c5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
sock.c
dlls/ws2_32/tests/sock.c
+1
-1
sock.c
server/sock.c
+22
-14
No files found.
dlls/ws2_32/tests/sock.c
View file @
25f8698f
...
...
@@ -14025,7 +14025,7 @@ static void test_select_after_WSAEventSelect(void)
check_poll
(
client
,
POLLRDNORM
|
POLLWRNORM
);
ret
=
WaitForSingleObject
(
event
,
0
);
todo_wine
ok
(
ret
==
WAIT_TIMEOUT
,
"got %d
\n
"
,
ret
);
ok
(
ret
==
WAIT_TIMEOUT
,
"got %d
\n
"
,
ret
);
CloseHandle
(
event
);
closesocket
(
server
);
...
...
server/sock.c
View file @
25f8698f
...
...
@@ -787,18 +787,11 @@ static unsigned int afd_poll_flag_to_win32( unsigned int flags )
return
ret
;
}
/* wake anybody waiting on the socket event or send the associated message */
static
void
sock_wake_up
(
struct
sock
*
sock
)
static
void
post_sock_messages
(
struct
sock
*
sock
)
{
unsigned
int
events
=
sock
->
pending_events
&
sock
->
mask
;
int
i
;
if
(
sock
->
event
)
{
if
(
debug_level
)
fprintf
(
stderr
,
"signalling events %x ptr %p
\n
"
,
events
,
sock
->
event
);
if
(
events
)
set_event
(
sock
->
event
);
}
if
(
sock
->
window
)
{
if
(
debug_level
)
fprintf
(
stderr
,
"signalling events %x win %08x
\n
"
,
events
,
sock
->
window
);
...
...
@@ -1285,6 +1278,9 @@ static void post_socket_event( struct sock *sock, enum afd_poll_bit event_bit )
{
sock
->
pending_events
|=
event
;
sock
->
reported_events
|=
event
;
if
((
sock
->
mask
&
event
)
&&
sock
->
event
)
set_event
(
sock
->
event
);
}
}
...
...
@@ -1329,7 +1325,7 @@ static void sock_dispatch_events( struct sock *sock, enum connection_state prevs
break
;
}
sock_wake_up
(
sock
);
post_sock_messages
(
sock
);
}
static
void
sock_poll_event
(
struct
fd
*
fd
,
int
event
)
...
...
@@ -2858,11 +2854,23 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
sock
->
nonblocking
=
1
;
sock_reselect
(
sock
);
/* Explicitly wake the socket up if the mask causes it to become
* signaled. Note that reselecting isn't enough, since we might already
* have had events recorded in sock->reported_events and we don't want
* to select for them again. */
sock_wake_up
(
sock
);
/* Explicitly wake the socket up if the mask matches pending_events.
*
* The logic here is a bit surprising. We always set the event if the
* socket has events that haven't been consumed by
* WSAEnumNetworkEvents() yet, including if WSAEventSelect() is called
* multiple times without consuming the events.
* However, once the events are consumed by WSAEnumNetworkEvents(), we
* don't set the event again (even though e.g. data is still available)
* until a "reset" call (i.e. that clears reported_events). */
if
(
event
&&
(
sock
->
pending_events
&
mask
))
{
if
(
debug_level
)
fprintf
(
stderr
,
"signalling pending events %#x due to event select
\n
"
,
sock
->
pending_events
&
mask
);
set_event
(
event
);
}
return
;
}
...
...
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