浏览代码

possible fix for #1284

StalderT 7 年之前
父节点
当前提交
2455f3ceb2
共有 1 个文件被更改,包括 3 次插入1 次删除
  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)