Explorar o código

Fixed UA_Client_disconnect()

If the client runs into an error state, we can't reconnect.
As all states, but UA_CLIENTSTATE_READY are connected, we should be able to disconnect (which is necessary to renew the connection - as required by the error client states).
Root-Core %!s(int64=8) %!d(string=hai) anos
pai
achega
b8117c9323
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/client/ua_client.c

+ 1 - 1
src/client/ua_client.c

@@ -665,7 +665,7 @@ UA_Client_connect(UA_Client *client, const char *endpointUrl) {
 }
 
 UA_StatusCode UA_Client_disconnect(UA_Client *client) {
-    if(client->state != UA_CLIENTSTATE_CONNECTED)
+    if(client->state == UA_CLIENTSTATE_READY)
         return UA_STATUSCODE_BADNOTCONNECTED;
     UA_StatusCode retval = UA_STATUSCODE_GOOD;
     /* Is a session established? */