[FIX] Added rejection handshake sent to the peer in rendezvous mode #2667
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the procedure to craft and send the rejection response in case when the handshake in rendezvous mode in one side has resulted in rejection. Some paths for this are common with caller mode so it's taken care of that it happens only in case of rendezvous mode.
Motivation: in case of caller-listener layout, it happens the following way:
In some rare cases when the rejection is done on the caller, while the listener accepts the handshake, the caller doesn't send any rejection handshake to the listener (and sends the shutdown message instead) because:
Hence:
In rendezvous the situation is a little bit different: both sides handle the request in their procedures working the same way as for caller, with a special procedure handling the rendezvous part. So there wasn't so far defined any way to send any rejection packet to the peer - but then it was possible to add this only for the path referring to rendezvous connection. Unlike for the caller, it does make sense here to send the rejection handshake because it is always the first arrived conclusion handshake with extension that ignites the connection and it is awaiting a response, be it even of AGREEMENT type.