wine/server
Jinoh Kang a115feab9c server: Always prefer synchronous I/O in nonblocking mode.
foobar2000.exe's UPnP Media Renderer component (foo_out_upnp.dll)
expects that, if a select() call completes successfully with a non-empty
writefds set, any immediately following send() call on a socket in the
writefds set never fails with WSAEWOULDBLOCK.

On Wine, the Winsock select() and send() implementations both call the
Unix poll(2) under the hood to test if I/O is possible on the socket.
As it turns out, it's entirely possible that Linux poll() may yield
POLLOUT on the first call (by select) but *not* the second (by send),
even if no send() call has been made in the meanwhile.

On Linux (as of v5.19), a connected (ESTABLISHED) TCP socket that has
not been shut down indicates (E)POLLOUT only if the ratio of
sk_wmem_queued (the amount of bytes queued in the send buffer) to
sk_sndbuf (the size of send buffer size itself, which can be retrieved
via SO_SNDBUF) is below a certain threshold.  Therefore, a falling edge
in POLLOUT can be triggered due to a number of reasons:

1. TCP fragmentation.  Once a TCP packet is split out from a larger
   sk_buff, it incurs extra bookkeeping overhead (e.g. sk_buff header)
   that is counted in sk_wmem_queued alongside application data.
   See also: tcp_fragment(), tso_fragment() (Linux 5.19).

2. Control packets (e.g. MTU probing).  Such packets share the same
   buffer with application-initiated packets, and thus counted in
   sk_wmem_queued.
   See also: sk_wmem_queued_add() callers (Linux 5.19).

3. Memory pressure.  This causes sk_sndbuf to shrink.
   See also: sk_stream_moderate_sndbuf() callers (Linux 5.19).

Fix this by always attempting synchronous I/O first if req->force_async
is unset and the nonblocking flag is set.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53486
2022-08-24 09:06:37 -05:00
..
async.c ntdll: Cancel asyncs when thread is terminated. 2022-06-09 13:20:13 +02:00
atom.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
change.c server: Use the token owner instead of the token user for default object owner. 2022-07-20 22:33:44 +02:00
class.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
clipboard.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
completion.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
console.c kernelbase: Support CONSOLE_READCONSOLE_CONTROL in ReadConsoleW. 2022-03-01 22:41:15 +01:00
debugger.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
device.c server: Always close previous IRP handle. 2022-03-14 12:00:48 +01:00
directory.c ntdll: Return the required length from NtQueryDirectoryObject(). 2022-04-13 16:25:44 +02:00
event.c server: Add sys/types.h include in a few more files. 2021-10-11 11:44:02 +02:00
fd.c ntdll: Fix returned status code for paths with a trailing slash. 2022-06-28 13:20:15 +02:00
file.c server: Use the token owner instead of the token user for default object owner. 2022-07-20 22:33:44 +02:00
file.h ntdll: Cancel asyncs when thread is terminated. 2022-06-09 13:20:13 +02:00
handle.c server: Define a server-side structure for SID. 2022-01-25 12:32:11 +01:00
handle.h server: Inherit standard handles together with explicit handle list. 2020-09-29 21:04:13 +02:00
hook.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
mach.c server: Remove workarounds for Mac OS X 10.4. 2021-12-02 09:50:46 +01:00
mailslot.c configure: Assume that sys/ioctl.h is available on Unix. 2021-12-09 18:43:51 +01:00
main.c server: Avoid using getopt_long(). 2021-10-05 11:53:08 +02:00
Makefile.in makefiles: Add separate variables for Unix flags and libraries. 2022-06-29 23:23:41 +02:00
mapping.c server: Store PE image info in process structure. 2022-01-02 13:53:08 +01:00
mutex.c server: Add sys/types.h include in a few more files. 2021-10-11 11:44:02 +02:00
named_pipe.c server: Return ReadDataAvailable value for FilePipeLocalInformation. 2021-12-06 22:55:07 +01:00
object.c server: Use the token owner instead of the token user for default object owner. 2022-07-20 22:33:44 +02:00
object.h server: Implement the \??\GLOBALROOT symbolic link. 2021-11-25 21:43:49 +01:00
process.c server: Use the client provided rawinput registered device array. 2022-07-28 20:08:58 +02:00
process.h server: Use the client provided rawinput registered device array. 2022-07-28 20:08:58 +02:00
procfs.c server: Add a platform-specific entry point to initialize registers of a new thread. 2017-07-27 17:04:04 +02:00
protocol.def win32u: Implement NtUserGetRegisteredRawInputDevices on the client side. 2022-07-28 20:08:58 +02:00
ptrace.c configure: Assume that sys/wait.h is available on Unix. 2021-12-09 18:43:51 +01:00
queue.c server: Avoid reallocating rawinput device array with zero size. 2022-08-08 18:50:54 +02:00
region.c server: Map region to the window DPI in redraw_region(). 2018-08-24 20:12:05 +02:00
registry.c server: Create new keys in the parent of a shared key. 2022-07-13 12:50:07 +02:00
request.c configure: Assume that sys/wait.h is available on Unix. 2021-12-09 18:43:51 +01:00
request.h win32u: Implement NtUserGetRegisteredRawInputDevices on the client side. 2022-07-28 20:08:58 +02:00
security.h server: Use the token owner instead of the token user for default object owner. 2022-07-20 22:33:44 +02:00
semaphore.c server: Add sys/types.h include in a few more files. 2021-10-11 11:44:02 +02:00
serial.c configure: Assume that sys/ioctl.h is available on Unix. 2021-12-09 18:43:51 +01:00
signal.c configure: Stop checking for poll.h and sys/poll.h - always use poll.h. 2021-10-31 17:56:54 +01:00
sock.c server: Always prefer synchronous I/O in nonblocking mode. 2022-08-24 09:06:37 -05:00
symlink.c server: Implement the \??\GLOBALROOT symbolic link. 2021-11-25 21:43:49 +01:00
thread.c ntdll: Cancel asyncs when thread is terminated. 2022-06-09 13:20:13 +02:00
thread.h ntdll: Avoid accessing the I/O status block in wait_async(). 2021-05-24 11:32:28 +02:00
timer.c server: Avoid using wine/port.h. 2021-10-07 18:03:11 +02:00
token.c server: Use the token owner instead of the token user for default object owner. 2022-07-20 22:33:44 +02:00
trace.c win32u: Implement NtUserGetRegisteredRawInputDevices on the client side. 2022-07-28 20:08:58 +02:00
unicode.c server: Use sysctl instead of /proc/curproc/file on FreeBSD. 2021-10-25 18:50:59 +02:00
unicode.h server: Create the NLS section object for the l_intl.nls file. 2020-11-27 18:28:35 +01:00
user.c
user.h server: Make window struct a server object. 2022-02-09 18:37:32 +01:00
window.c server: Store all 64 bits of window id. 2022-02-10 18:15:04 +01:00
wineserver.de.UTF-8.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
wineserver.fr.UTF-8.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
wineserver.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
winstation.c server: Make window struct a server object. 2022-02-09 18:37:32 +01:00