Browse Source

Network: Fix computation of timeSinceStart; Fix 2658

Julius Pfrommer 5 years ago
parent
commit
3ac9d00bfd
1 changed files with 2 additions and 3 deletions
  1. 2 3
      arch/network_tcp.c

+ 2 - 3
arch/network_tcp.c

@@ -652,9 +652,8 @@ UA_StatusCode UA_ClientConnectionTCP_poll(UA_Client *client, void *data) {
     if (error == -1 && (UA_ERRNO == UA_ERR_CONNECTION_PROGRESS)) {
         /* connection in progress. Wait until connected using select */
 
-        UA_UInt32 timeSinceStart =
-                        (UA_UInt32) ((UA_Double) (UA_DateTime_nowMonotonic() - connStart)
-                                        * UA_DATETIME_MSEC);
+        UA_UInt32 timeSinceStart = (UA_UInt32)
+            ((UA_Double) (UA_DateTime_nowMonotonic() - connStart) / UA_DATETIME_MSEC);
 #ifdef _OS9000
         /* OS-9 can't use select for checking write sockets.
          * Therefore, we need to use connect until success or failed