Removing forced sleep between message handling. Can cause excess delays if handle_mes...
[guacd.git] / src / client.c
index b240278..abaf442 100644 (file)
@@ -135,8 +135,9 @@ void* __guac_client_output_thread(void* data) {
 
             }
 
-            /* Sleep before handling more messages */
-            __guacd_sleep(GUAC_SERVER_MESSAGE_HANDLE_FREQUENCY);
+            /* Do not spin while waiting for old sync */
+            else
+                __guacd_sleep(GUAC_SERVER_MESSAGE_HANDLE_FREQUENCY);
 
         }
 
@@ -171,6 +172,11 @@ void* __guac_client_input_thread(void* data) {
             return NULL;
         }
 
+        /* Reset guac_error and guac_error_message (client handlers are not
+         * guaranteed to set these) */
+        guac_error = GUAC_STATUS_SUCCESS;
+        guac_error_message = NULL;
+
         /* Call handler, stop on error */
         if (guac_client_handle_instruction(client, instruction) < 0) {