mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-31 09:50:05 +02:00
GSocket: Reset the timeout in the GSocket GSource after it was triggered
https://bugzilla.gnome.org/show_bug.cgi?id=667989
This commit is contained in:
parent
fbdb8128dc
commit
d44bb6ef64
@ -3112,6 +3112,8 @@ socket_source_dispatch (GSource *source,
|
|||||||
{
|
{
|
||||||
GSocketSourceFunc func = (GSocketSourceFunc)callback;
|
GSocketSourceFunc func = (GSocketSourceFunc)callback;
|
||||||
GSocketSource *socket_source = (GSocketSource *)source;
|
GSocketSource *socket_source = (GSocketSource *)source;
|
||||||
|
GSocket *socket = socket_source->socket;
|
||||||
|
gboolean ret;
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
socket_source->pollfd.revents = update_condition (socket_source->socket);
|
socket_source->pollfd.revents = update_condition (socket_source->socket);
|
||||||
@ -3119,9 +3121,18 @@ socket_source_dispatch (GSource *source,
|
|||||||
if (socket_source->socket->priv->timed_out)
|
if (socket_source->socket->priv->timed_out)
|
||||||
socket_source->pollfd.revents |= socket_source->condition & (G_IO_IN | G_IO_OUT);
|
socket_source->pollfd.revents |= socket_source->condition & (G_IO_IN | G_IO_OUT);
|
||||||
|
|
||||||
return (*func) (socket_source->socket,
|
ret = (*func) (socket,
|
||||||
socket_source->pollfd.revents & socket_source->condition,
|
socket_source->pollfd.revents & socket_source->condition,
|
||||||
user_data);
|
user_data);
|
||||||
|
|
||||||
|
if (socket->priv->timeout)
|
||||||
|
socket_source->timeout_time = g_get_monotonic_time () +
|
||||||
|
socket->priv->timeout * 1000000;
|
||||||
|
|
||||||
|
else
|
||||||
|
socket_source->timeout_time = 0;
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user