From b30fd16a74865c371b32f89a7a304005d7d4881f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 8 Aug 2013 16:50:11 +0100 Subject: 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 Signed-off-by: Simon McVittie Reviewed-by: Vivek Dasmohapatra --- 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); -- cgit v1.2.3