os: Don't call ospoll_listen/ospoll_mute after connection is closed

In set_poll_client, check oc->trans_conn to make sure the connection
is still running before changing the ospoll configuration of the file
descriptor in case some other bit of the server is now using this file
descriptor.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2017-05-17 09:57:27 -07:00 committed by Adam Jackson
parent 523d35e3e1
commit 448a5586e9

View File

@ -1084,10 +1084,12 @@ set_poll_client(ClientPtr client)
{
OsCommPtr oc = (OsCommPtr) client->osPrivate;
if (listen_to_client(client))
ospoll_listen(server_poll, oc->fd, X_NOTIFY_READ);
else
ospoll_mute(server_poll, oc->fd, X_NOTIFY_READ);
if (oc->trans_conn) {
if (listen_to_client(client))
ospoll_listen(server_poll, oc->trans_conn->fd, X_NOTIFY_READ);
else
ospoll_mute(server_poll, oc->trans_conn->fd, X_NOTIFY_READ);
}
}
static void