Explorar o código

possible fix for #1284

StalderT %!s(int64=7) %!d(string=hai) anos
pai
achega
2455f3ceb2
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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)