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
96e15460
Commit
96e15460
authored
Sep 11, 2008
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Fix a race in sock.c:test_write_events().
Stop draining the socket to make sure we will be able to fill the send buffer and trigger a short write.
parent
2797e8fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
sock.c
dlls/ws2_32/tests/sock.c
+10
-3
No files found.
dlls/ws2_32/tests/sock.c
View file @
96e15460
...
...
@@ -2020,6 +2020,7 @@ static void test_ioctlsocket(void)
}
}
static
int
drain_pause
=
0
;
static
DWORD
WINAPI
drain_socket_thread
(
LPVOID
arg
)
{
char
buffer
[
1024
];
...
...
@@ -2036,6 +2037,8 @@ static DWORD WINAPI drain_socket_thread(LPVOID arg)
FD_ZERO
(
&
readset
);
FD_SET
(
sock
,
&
readset
);
select
(
0
,
&
readset
,
NULL
,
NULL
,
NULL
);
while
(
drain_pause
)
Sleep
(
100
);
}
else
break
;
...
...
@@ -2188,13 +2191,17 @@ static void test_write_events(void)
goto
end
;
}
/* Now if we send a tonne of data, the socket send buffer will only take some of it,
and we will get a short write, which will trigger another FD_WRITE event
as soon as data is sent and more space becomes available, but not any earlier. */
/* Now if we send a ton of data and the 'server' does not drain it fast
* enough (set drain_pause to be sure), the socket send buffer will only
* take some of it, and we will get a short write. This will trigger
* another FD_WRITE event as soon as data is sent and more space becomes
* available, but not any earlier. */
drain_pause
=
1
;
do
{
ret
=
send
(
src
,
buffer
,
bufferSize
,
0
);
}
while
(
ret
==
bufferSize
);
drain_pause
=
0
;
if
(
ret
>=
0
||
WSAGetLastError
()
==
WSAEWOULDBLOCK
)
{
dwRet
=
WaitForSingleObject
(
hEvent
,
5000
);
...
...
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