Fixed ZMQ_REQ_CORRELATE (see pull request #1730) #1882
Merged
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.
Commit Comment
Problem: Since pull request #1730 was merged, protocol for REQ socket is checked at the session level and this check does not take into account the possibility of a request_id being part of the message. Thus the option
ZMQ_REQ_CORRELATE
would no longer work.This is now fixed: the possiblity of a 4 bytes integer being present before the delimiter frame is taken into account (whether or not this breaks the REQ/REP RFC is another issue).
Work done
request_id
in the protocol of the REQ sockettest_req_relaxed
as they were there only to make the tests fail fasttest_req_correlate
that were testing that invalid REQ messages were silently ignored. This is no longer the case: malformed messages now trigger the closing of the peer that sent them.Comments
0|payload
orrequest_id|0|payload
. I did not bother checking whether theZMQ_REQ_CORRELATE
was on or not as I found too cumbersome to check this at the session level (would have to pass the option from the socket to the session). I do not think that this is too much of a problem: we may accept invalid message in some cases but then they would be silently ignored at the socket level.