소스 검색

test for securechannel timeouts in the client

Julius Pfrommer 7 년 전
부모
커밋
570d175ac7
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/client/ua_client.c

+ 8 - 0
src/client/ua_client.c

@@ -180,6 +180,14 @@ processServiceResponse(void *application, UA_SecureChannel *channel,
         return UA_STATUSCODE_BADTCPMESSAGETYPEINVALID;
     }
 
+    /* Has the SecureChannel timed out?
+     * TODO: Solve this for client and server together */
+    if(rd->client->state >= UA_CLIENTSTATE_SECURECHANNEL &&
+       (channel->securityToken.createdAt +
+        (channel->securityToken.revisedLifetime * UA_MSEC_TO_DATETIME))
+       < UA_DateTime_nowMonotonic())
+        return UA_STATUSCODE_BADSECURECHANNELCLOSED;
+
     /* Forward declaration for the goto */
     UA_NodeId expectedNodeId;
     const UA_NodeId serviceFaultNodeId =