diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-08-08 16:50:11 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-08-09 15:19:33 +0100 |
commit | b30fd16a74865c371b32f89a7a304005d7d4881f (patch) | |
tree | d2959b0c02df550cd268b3af8b523a76c8686b62 | |
parent | 21d2afd4981fb07ecde77b86b6cc997294950f29 (diff) |
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 <simon.mcvittie@collabora.co.uk>
Reviewed-by: Vivek Dasmohapatra <vivek@collabora.co.uk>
-rw-r--r-- | tests/wocky-connector-test.c | 13 |
1 files changed, 0 insertions, 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); |