Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Review) Modify Send-/Recv-buffer handling + MaxMsgSize (from PR 2955) #3975

Open
wants to merge 6 commits into
base: 1.2
Choose a base branch
from

Conversation

mlang-de
Copy link
Contributor

See discussion in pull request #2955

@mlang-de mlang-de changed the title [Review] Modify Send-/Recv-buffer handling + MaxMsgSize (from PR 2955) [WIP + Help wanted] Modify Send-/Recv-buffer handling + MaxMsgSize (from PR 2955) Oct 26, 2020
@mlang-de mlang-de changed the title [WIP + Help wanted] Modify Send-/Recv-buffer handling + MaxMsgSize (from PR 2955) (WIP) Modify Send-/Recv-buffer handling + MaxMsgSize (from PR 2955) Oct 27, 2020
@mlang-de
Copy link
Contributor Author

Current commit:
The between client and server shared function UA_SecureChannel_processHELACK is splitted into UA_SecureChannel_serverProcessHELACK and UA_SecureChannel_clientProcessHELACK.
This is imho required since the server shall never return a bad status during HEL-Msg.
The server shall response with the revised channel configuration the server can support.
The client shall check whether it can handle these revised configuration.

I am not the client guy, so someone with client expertise is asked to look into the UA_SecureChannel_clientProcessHELACK function.

@jpfr
Copy link
Member

jpfr commented Nov 2, 2020

I understand that there are some differences in the client and server-side handling.
But we should keep as much logic common as possible.
Can we have a function with the common subset of the HEL logic and both the client and server side call into that?

@mlang-de
Copy link
Contributor Author

mlang-de commented Nov 2, 2020

Imho there are no real common parts which can be used for both.
Maybe a additional function parameter which indicates which kind of checks (sever or client) are required.
But within the function different logic will be used.
For instance:

UA_StatusCode
UA_SecureChannel_ProcessHELACK(UA_SecureChannel *channel,
                               const UA_TcpAcknowledgeMessage *remoteServerConfig, uint8_t fServerOrClient)
{
    if(fServerOrClient == Server)
    {
        /* do checks from function UA_SecureChannel_serverProcessHELACK */
    }
    else
    {
        /* do checks from funtion UA_SecureChannel_clientProcessHELACK */
    }

    return UA_STATUSCODE_GOOD

Some checks could maybe merged and reused.

  • MaxSendBuffer or MaxReceiveBuffer

BUT so the client side never uses a bad statuscode and the client must be able to handle each channel configuration revised from the server. This ends up, that a client has to support unlimited resources each time.

@mlang-de mlang-de force-pushed the Modify_Send-/Recv-buffer_handling_+_MaxMsgSize_(PR_2955) branch 3 times, most recently from 44342c8 to 70d9ced Compare February 9, 2021 10:44
@lgtm-com
Copy link

lgtm-com bot commented Feb 9, 2021

This pull request introduces 1 alert when merging ab3ab96 into 0af95df - view on LGTM.com

new alerts:

  • 1 for Implicit function declaration

@mlang-de mlang-de force-pushed the Modify_Send-/Recv-buffer_handling_+_MaxMsgSize_(PR_2955) branch from 239495c to b95458a Compare February 9, 2021 13:34
@lgtm-com
Copy link

lgtm-com bot commented Feb 9, 2021

This pull request introduces 1 alert when merging b95458a into 0af95df - view on LGTM.com

new alerts:

  • 1 for Implicit function declaration

@mlang-de
Copy link
Contributor Author

mlang-de commented Feb 9, 2021

@jpfr Please confirm, that this PR is ok in relation to 1.2 rebasing. I do a lot squash, rebase and so. Not sure that this PR is now "clean" or "ok". Tests outstanding.

@mlang-de mlang-de changed the title (WIP) Modify Send-/Recv-buffer handling + MaxMsgSize (from PR 2955) (Review) Modify Send-/Recv-buffer handling + MaxMsgSize (from PR 2955) Feb 9, 2021
@mlang-de mlang-de changed the base branch from master to 1.2 February 9, 2021 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants