Parcourir la source

close connection when close secure channel

StalderT il y a 7 ans
Parent
commit
fbc321948c
2 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 0 1
      src/server/ua_services_securechannel.c
  2. 4 2
      src/ua_securechannel.c

+ 0 - 1
src/server/ua_services_securechannel.c

@@ -54,5 +54,4 @@ Service_CloseSecureChannel(UA_Server *server, UA_SecureChannel *channel) {
     UA_LOG_INFO_CHANNEL(server->config.logger, channel, "CloseSecureChannel");
     UA_SecureChannelManager_close(&server->secureChannelManager,
                                   channel->securityToken.channelId);
-    channel->connection->close(channel->connection);
 }

+ 4 - 2
src/ua_securechannel.c

@@ -94,9 +94,11 @@ UA_SecureChannel_deleteMembersCleanup(UA_SecureChannel *channel) {
     if(channel->securityPolicy)
         channel->securityPolicy->channelModule.deleteContext(channel->channelContext);
 
-    /* Detach from the connection */
-    if(channel->connection)
+    /* Detach from the connection and close the connection */
+    if(channel->connection){
+        channel->connection->close(channel->connection);
         UA_Connection_detachSecureChannel(channel->connection);
+    }
 
     /* Remove session pointers (not the sessions) */
     struct SessionEntry *se, *temp;