Parcourir la source

Client: Remove openSecureChannelResponseCallback

Julius Pfrommer il y a 6 ans
Parent
commit
c027a538e3

+ 1 - 3
src/client/ua_client.c

@@ -538,9 +538,7 @@ receivePacketAsync(UA_Client *client) {
         retval = UA_Connection_receiveChunksNonBlocking(&client->connection, client, processACKResponseAsync);
     }
     else if(UA_Client_getState(client) == UA_CLIENTSTATE_CONNECTED) {
-        retval = UA_Connection_receiveChunksNonBlocking(
-                &client->connection, client,
-                client->openSecureChannelResponseCallback);
+        retval = UA_Connection_receiveChunksNonBlocking(&client->connection, client, processOPNResponseAsync);
     }
     if(retval != UA_STATUSCODE_GOOD && retval != UA_STATUSCODE_GOODNONCRITICALTIMEOUT) {
         if(retval == UA_STATUSCODE_BADCONNECTIONCLOSED)

+ 3 - 5
src/client/ua_client_connect_async.c

@@ -198,9 +198,9 @@ processDecodedOPNResponseAsync(void *application, UA_SecureChannel *channel,
         setClientState(client, UA_CLIENTSTATE_SECURECHANNEL);
 }
 
-static UA_StatusCode
-processOPNResponse(void *application, UA_Connection *connection,
-                   UA_ByteString *chunk) {
+UA_StatusCode
+processOPNResponseAsync(void *application, UA_Connection *connection,
+                        UA_ByteString *chunk) {
     UA_Client *client = (UA_Client*) application;
     UA_StatusCode retval = UA_SecureChannel_decryptAddChunk(&client->channel, chunk, UA_TRUE);
     client->connectStatus = retval;
@@ -566,8 +566,6 @@ UA_Client_connect_async(UA_Client *client, const char *endpointUrl,
 
     UA_ChannelSecurityToken_init(&client->channel.securityToken);
     client->channel.state = UA_SECURECHANNELSTATE_FRESH;
-    /* Set up further callback function to handle secure channel and session establishment  */
-    client->openSecureChannelResponseCallback = processOPNResponse;
     client->endpointsHandshake = true;
 
     UA_StatusCode retval = UA_STATUSCODE_GOOD;

+ 5 - 2
src/client/ua_client_internal.h

@@ -156,8 +156,7 @@ struct UA_Client {
     UA_UserTokenPolicy token;
     UA_NodeId authenticationToken;
     UA_UInt32 requestHandle;
-    /* Connection Establishment (async) */
-    UA_Connection_processChunk openSecureChannelResponseCallback;
+
     UA_Boolean endpointsHandshake;
 
     /* Async Service */
@@ -203,6 +202,10 @@ UA_StatusCode
 processACKResponseAsync(void *application, UA_Connection *connection,
                         UA_ByteString *chunk);
 
+UA_StatusCode
+processOPNResponseAsync(void *application, UA_Connection *connection,
+                        UA_ByteString *chunk);
+
 UA_StatusCode
 openSecureChannel(UA_Client *client, UA_Boolean renew);