mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 18:07:21 +00:00
server: Mark the socket as cacheable when it is connected, marked listening, or created as connectionless.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a554079860
commit
89f77a93a6
|
@ -416,7 +416,6 @@ static int sock_reselect( struct sock *sock )
|
|||
if (!(sock->state & ~FD_WINE_NONBLOCKING)) return 0;
|
||||
/* ok, it is, attach it to the wineserver's main poll loop */
|
||||
sock->polling = 1;
|
||||
allow_fd_caching( sock->fd );
|
||||
}
|
||||
/* update condition mask */
|
||||
set_fd_events( sock->fd, ev );
|
||||
|
@ -1358,7 +1357,11 @@ static int init_socket( struct sock *sock, int family, int type, int protocol, u
|
|||
{
|
||||
return -1;
|
||||
}
|
||||
sock_reselect( sock );
|
||||
|
||||
/* We can't immediately allow caching for a connection-mode socket, since it
|
||||
* might be accepted into (changing the underlying fd object.) */
|
||||
if (sock->type != WS_SOCK_STREAM) allow_fd_caching( sock->fd );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1750,6 +1753,9 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
|
|||
sock->state |= FD_WINE_LISTENING;
|
||||
sock->state &= ~(FD_CONNECT | FD_WINE_CONNECTED);
|
||||
|
||||
/* a listening socket can no longer be accepted into */
|
||||
allow_fd_caching( sock->fd );
|
||||
|
||||
/* we may already be selecting for FD_ACCEPT */
|
||||
sock_reselect( sock );
|
||||
return 0;
|
||||
|
@ -1790,6 +1796,9 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* a connected or connecting socket can no longer be accepted into */
|
||||
allow_fd_caching( sock->fd );
|
||||
|
||||
sock->pending_events &= ~(FD_CONNECT | FD_READ | FD_WRITE);
|
||||
sock->reported_events &= ~(FD_CONNECT | FD_READ | FD_WRITE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue