Merge branch 'main' into 'main'

gsocket windows: check event before calling WSAEnumNetworkEvents

See merge request GNOME/glib!4261
This commit is contained in:
Michael Catanzaro 2024-09-10 13:08:50 +00:00
commit 7a1c8d9ba3

View File

@ -4107,9 +4107,8 @@ update_condition_unlocked (GSocket *socket)
GIOCondition condition; GIOCondition condition;
if (!socket->priv->closed && if (!socket->priv->closed &&
WSAEnumNetworkEvents (socket->priv->fd, (WSAWaitForMultipleEvents (1, &socket->priv->event, FALSE, 0, FALSE) == WSA_WAIT_EVENT_0) &&
socket->priv->event, (WSAEnumNetworkEvents (socket->priv->fd, socket->priv->event, &events) == 0))
&events) == 0)
{ {
socket->priv->current_events |= events.lNetworkEvents; socket->priv->current_events |= events.lNetworkEvents;
if (events.lNetworkEvents & FD_WRITE && if (events.lNetworkEvents & FD_WRITE &&