Sfoglia il codice sorgente

Reuse previously fetched UA_DateTime_nowMonotonic() (#877)

Lykurg 8 anni fa
parent
commit
b9c8963456
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/client/ua_client.c

+ 1 - 1
src/client/ua_client.c

@@ -23,7 +23,7 @@ Connection_receiveChunk(UA_Connection *connection, UA_ByteString * UA_RESTRICT m
         UA_DateTime now = UA_DateTime_nowMonotonic();
         if(now > maxDate)
             return UA_STATUSCODE_GOODNONCRITICALTIMEOUT;
-        UA_UInt32 thisTimeout = (UA_UInt32)((maxDate - UA_DateTime_nowMonotonic()) / UA_MSEC_TO_DATETIME);
+        UA_UInt32 thisTimeout = (UA_UInt32)((maxDate - now) / UA_MSEC_TO_DATETIME);
         retval = connection->recv(connection, message, thisTimeout);
         retval |= UA_Connection_completeMessages(connection, message, realloced);
     } while(retval == UA_STATUSCODE_GOOD && message->length == 0);