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;
if (!socket->priv->closed &&
WSAEnumNetworkEvents (socket->priv->fd,
socket->priv->event,
&events) == 0)
(WSAWaitForMultipleEvents (1, &socket->priv->event, FALSE, 0, FALSE) == WSA_WAIT_EVENT_0) &&
(WSAEnumNetworkEvents (socket->priv->fd, socket->priv->event, &events) == 0))
{
socket->priv->current_events |= events.lNetworkEvents;
if (events.lNetworkEvents & FD_WRITE &&