From 4a3bf35d99eba2d77155c981f6c4396b4923640f Mon Sep 17 00:00:00 2001 From: Matt Hortman Date: Tue, 28 Feb 2012 15:25:59 -0500 Subject: [PATCH] added timeout to select waiting on FreeRDP --- src/guac_handlers.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/guac_handlers.c b/src/guac_handlers.c index 2d1bc20..ef8e101 100644 --- a/src/guac_handlers.c +++ b/src/guac_handlers.c @@ -116,7 +116,10 @@ int rdp_guac_client_handle_messages(guac_client* client) { } /* Otherwise, wait for file descriptors given */ - if (select(max_fd + 1, &rfds, &wfds, NULL, NULL) == -1) { + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 250000; + if (select(max_fd + 1, &rfds, &wfds, NULL, &timeout) == -1) { /* these are not really errors */ if (!((errno == EAGAIN) || (errno == EWOULDBLOCK) || -- 1.7.10.4