refactored Bugfix
authortditsch <thomas.ditsch@oneclick-cloud.com>
Tue, 19 Sep 2017 08:18:41 +0000 (10:18 +0200)
committertditsch <thomas.ditsch@oneclick-cloud.com>
Tue, 19 Sep 2017 08:18:41 +0000 (10:18 +0200)
libfreerdp/core/transport.c

index bd8d853..0ab37dd 100644 (file)
@@ -997,8 +997,13 @@ int transport_check_fds(rdpTransport* transport)
                ResetEvent(transport->rereadEvent);
        }
 
-       while (!freerdp_shall_disconnect(transport->context->instance) && (now < dueDate))
+       while (now < dueDate)
        {
+
+               if (freerdp_shall_disconnect(transport->context->instance)) {
+                       return -1;
+               }
+
                /**
                 * Note: transport_read_pdu tries to read one PDU from
                 * the transport layer.
@@ -1053,10 +1058,6 @@ int transport_check_fds(rdpTransport* transport)
                transport->haveMoreBytesToRead = TRUE;
        }
 
-  if (freerdp_shall_disconnect(transport->context->instance)) {
-      return -1;
-  }
-
        return 0;
 }