Browse Source

possible fix for #1284

StalderT 7 years ago
parent
commit
2455f3ceb2
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/client/ua_client_connect.c

+ 3 - 1
src/client/ua_client_connect.c

@@ -519,8 +519,10 @@ sendCloseSecureChannel(UA_Client *client) {
 UA_StatusCode
 UA_Client_disconnect(UA_Client *client) {
     /* Is a session established? */
-    if(client->state == UA_CLIENTSTATE_SESSION)
+    if(client->state == UA_CLIENTSTATE_SESSION){
+        client->state = UA_CLIENTSTATE_SESSION_DISCONNECTED;
         sendCloseSession(client);
+    }    
 
     /* Is a secure channel established? */
     if(client->state >= UA_CLIENTSTATE_SECURECHANNEL)