From 9a24e8ec1cdaee3f9f822b47b71bd75f221feaca Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 8 Aug 2013 16:50:11 +0100 Subject: [PATCH 2/5] wocky-connector-test: stop putting sockets in blocking mode GSocket configures its underlying fd to be in non-blocking mode, and implements blocking calls by select()ing (or equivalent) first. If we break this assumption, most test cases in wocky-connector-test hang in a recv() that should have been non-blocking. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67900 --- tests/wocky-connector-test.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tests/wocky-connector-test.c b/tests/wocky-connector-test.c index 2bd575e..e2622b4 100644 --- a/tests/wocky-connector-test.c +++ b/tests/wocky-connector-test.c @@ -3259,11 +3259,6 @@ client_connected (GIOChannel *channel, int csock = accept (ssock, (struct sockaddr *) &client, &clen); GSocket *gsock = g_socket_new_from_fd (csock, NULL); ConnectorProblem *cproblem = &srv->problem.conn; -#ifdef G_OS_WIN32 - u_long mode = 0; -#else - long flags; -#endif GSocketConnection *gconn; @@ -3277,14 +3272,6 @@ client_connected (GIOChannel *channel, if (!srv->features.tls) cproblem->xmpp |= XMPP_PROBLEM_NO_TLS; -#ifdef G_OS_WIN32 - WSAEventSelect (csock, 0, 0); - ioctlsocket (csock, FIONBIO, &mode); -#else - flags = fcntl (csock, F_GETFL ); - flags = flags & ~O_NONBLOCK; - fcntl (csock, F_SETFL, flags); -#endif gconn = g_object_new (G_TYPE_SOCKET_CONNECTION, "socket", gsock, NULL); g_object_unref (gsock); -- 1.8.4.rc1