From c027a538e3b600090e1b786b987294465cc271b4 Mon Sep 17 00:00:00 2001 From: Julius Pfrommer Date: Fri, 21 Sep 2018 15:56:19 +0200 Subject: [PATCH] Client: Remove openSecureChannelResponseCallback --- src/client/ua_client.c | 4 +--- src/client/ua_client_connect_async.c | 8 +++----- src/client/ua_client_internal.h | 7 +++++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/client/ua_client.c b/src/client/ua_client.c index 120f3bedacd..d38a6778a42 100644 --- a/src/client/ua_client.c +++ b/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) diff --git a/src/client/ua_client_connect_async.c b/src/client/ua_client_connect_async.c index afe25b116dd..d97011227d2 100644 --- a/src/client/ua_client_connect_async.c +++ b/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; diff --git a/src/client/ua_client_internal.h b/src/client/ua_client_internal.h index 0889a06b683..5d1b0ffaa35 100644 --- a/src/client/ua_client_internal.h +++ b/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);