if (*timeout < 0)
{
socket_source->socket->priv->timed_out = TRUE;
- socket_source->pollfd.revents = socket_source->condition & (G_IO_IN | G_IO_OUT);
*timeout = 0;
return TRUE;
}
#ifdef G_OS_WIN32
socket_source->pollfd.revents = update_condition (socket_source->socket);
#endif
+ if (socket_source->socket->priv->timed_out)
+ socket_source->pollfd.revents |= socket_source->condition & (G_IO_IN | G_IO_OUT);
return (*func) (socket_source->socket,
socket_source->pollfd.revents & socket_source->condition,
if (data->family == G_SOCKET_FAMILY_IPV4)
{
- g_assert_cmpint (cond, ==, 0);
+ g_assert_cmpint (cond, ==, G_IO_IN);
len = g_socket_receive (client, buf, sizeof (buf), NULL, &error);
g_assert_cmpint (len, ==, -1);
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT);
g_test_add_func ("/socket/ipv4_sync", test_ipv4_sync);
g_test_add_func ("/socket/ipv4_async", test_ipv4_async);
g_test_add_func ("/socket/ipv6_sync", test_ipv6_sync);
- g_test_add_func ("/socket/ipv6_sync", test_ipv6_async);
+ g_test_add_func ("/socket/ipv6_async", test_ipv6_async);
#ifdef G_OS_UNIX
g_test_add_func ("/socket/unix-from-fd", test_unix_from_fd);
g_test_add_func ("/socket/unix-connection", test_unix_connection);