Skip to content

Commit

Permalink
Client: Remove openSecureChannelResponseCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Sep 21, 2018
1 parent 43ac1ee commit c027a53
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/client/ua_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions src/client/ua_client_connect_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions src/client/ua_client_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit c027a53

Please sign in to comment.