Browse Source

refactor(core): Replace UA_Connection_deleteMembers with UA_Connection_clear

Julius Pfrommer 5 years ago
parent
commit
6c777640e6

+ 1 - 1
arch/network_tcp.c

@@ -185,7 +185,7 @@ typedef struct {
 
 static void
 ServerNetworkLayerTCP_freeConnection(UA_Connection *connection) {
-    UA_Connection_deleteMembers(connection);
+    UA_Connection_clear(connection);
     UA_free(connection);
 }
 

+ 1 - 1
arch/network_ws.c

@@ -94,7 +94,7 @@ freeConnection(UA_Connection *connection) {
     if(connection->handle) {
         UA_free(connection->handle);
     }
-    UA_Connection_deleteMembers(connection);
+    UA_Connection_clear(connection);
     UA_free(connection);
 }
 

+ 1 - 1
include/open62541/plugin/network.h

@@ -114,7 +114,7 @@ struct UA_Connection {
 
 /* Cleans up half-received messages, and so on. Called from connection->free. */
 void UA_EXPORT
-UA_Connection_deleteMembers(UA_Connection *connection);
+UA_Connection_clear(UA_Connection *connection);
 
 /**
  * Server Network Layer

+ 1 - 1
src/client/ua_client.c

@@ -84,7 +84,7 @@ UA_Client_deleteMembers(UA_Client *client) {
     //UA_SecureChannel_deleteMembersCleanup(&client->channel);
     if (client->connection.free)
         client->connection.free(&client->connection);
-    UA_Connection_deleteMembers(&client->connection);
+    UA_Connection_clear(&client->connection);
     UA_NodeId_deleteMembers(&client->authenticationToken);
     UA_String_deleteMembers(&client->endpointUrl);
 

+ 1 - 1
src/ua_connection.c

@@ -20,7 +20,7 @@
 #include "ua_types_encoding_binary.h"
 #include "ua_util_internal.h"
 
-void UA_Connection_deleteMembers(UA_Connection *connection) {
+void UA_Connection_clear(UA_Connection *connection) {
     UA_ByteString_deleteMembers(&connection->incompleteChunk);
 }
 

+ 1 - 1
tests/fuzz/fuzz_binary_message.cc

@@ -58,6 +58,6 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     UA_Server_run_shutdown(server);
     UA_Server_delete(server);
     c.close(&c);
-    UA_Connection_deleteMembers(&c);
+    UA_Connection_clear(&c);
     return 0;
 }