Browse Source

Bugfixes (#674)

* Delete in case of SequenceNumberCheck failt
Torben-D 8 years ago
parent
commit
056cf2f6e5
2 changed files with 5 additions and 1 deletions
  1. 2 1
      src/client/ua_client_internal.h
  2. 3 0
      src/server/ua_server_binary.c

+ 2 - 1
src/client/ua_client_internal.h

@@ -40,6 +40,7 @@ typedef struct UA_Client_Subscription_s {
     LIST_HEAD(UA_ListOfClientMonitoredItems, UA_Client_MonitoredItem_s) MonitoredItems;
 } UA_Client_Subscription;
 
+void UA_Client_Subscriptions_forceDelete(UA_Client *client, UA_Client_Subscription *sub);
 #endif
 
 /**********/
@@ -82,6 +83,6 @@ struct UA_Client {
     UA_DateTime scRenewAt;
 };
 
-void UA_Client_Subscriptions_forceDelete(UA_Client *client, UA_Client_Subscription *sub);
+
 
 #endif /* UA_CLIENT_INTERNAL_H_ */

+ 3 - 0
src/server/ua_server_binary.c

@@ -552,6 +552,9 @@ processMSG(UA_Connection *connection, UA_Server *server, const UA_TcpMessageHead
                             sequenceHeader.sequenceNumber, channel->receiveSequenceNumber + 1);
         sendError(channel, msg, *offset, &UA_TYPES[UA_TYPES_SERVICEFAULT],
                   sequenceHeader.requestId, UA_STATUSCODE_BADSECURITYCHECKSFAILED);
+        Service_CloseSecureChannel(server, channel);
+        connection->close(connection);
+        return;
     }
 
     /* Does the token match? */