Browse Source

[FIX] Check the request type for not activated sessions

 - Currently when the session is not activated and if close Session
   is requested, the server will return a Bad_SessionNotActivated
   status code
 - In new CTT, this will cause the issue in various conformance units
   such as Security Username Password and session base
 - So modified the SessionNotActivated check to ignore if the request
   is of type CloseSessionRequest

Signed-off-by: Jayanth Velusamy <jayanth.v@kalycito.com>
Jayanth Velusamy 6 years ago
parent
commit
9e1f43e6da
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/server/ua_server_binary.c

+ 3 - 2
src/server/ua_server_binary.c

@@ -519,8 +519,9 @@ processMSG(UA_Server *server, UA_SecureChannel *channel,
         session = &anonymousSession;
     }
 
-    /* Trying to use a non-activated session? */
-    if(sessionRequired && !session->activated) {
+    /* Trying to use a non-activated session?
+     * Do not allow if request is of type CloseSessionRequest */
+    if(sessionRequired && !session->activated && requestType != &UA_TYPES[UA_TYPES_CLOSESESSIONREQUEST]) {
         UA_LOG_WARNING_SESSION(&server->config.logger, session,
                                "Calling service %i on a non-activated session",
                                requestType->binaryEncodingId);