mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
core: make sure win32 sockets remain blocking
Commit 7e344b5 hade the side effect of forcing every socket to
be non-blocking on Windows. This is because of a (documented)
side effect of WSAEventSelect(). So we need to make sure to restore
blocking behaviour afterwards for relevant sockets.
This commit is contained in:
parent
abfca5cb58
commit
0138a51a2c
3 changed files with 69 additions and 9 deletions
|
|
@ -65,6 +65,8 @@ typedef unsigned long nfds_t;
|
|||
|
||||
#include <time.h>
|
||||
|
||||
#include <pulsecore/core-util.h>
|
||||
|
||||
#ifndef INFTIM
|
||||
# define INFTIM (-1)
|
||||
#endif
|
||||
|
|
@ -602,6 +604,9 @@ restart:
|
|||
/* It's a socket. */
|
||||
WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
|
||||
WSAEventSelect ((SOCKET) h, 0, 0);
|
||||
/* Have to restore blocking as WSAEventSelect() clears it */
|
||||
if (!pa_is_fd_nonblock(pfd[i].fd))
|
||||
pa_make_fd_block(pfd[i].fd);
|
||||
|
||||
/* If we're lucky, WSAEnumNetworkEvents already provided a way
|
||||
to distinguish FD_READ and FD_ACCEPT; this saves a recv later. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue