I encounter a problem when setting a low value for the ZMQ_MAXMSGSIZE option. With TCP, CURVE and a PUB/SUB, on my environment, whenever the value is between 0 and 275, the connection fails and no messages are received. It starts working with the value 276 (which I guess corresponds to the size of the INITIATE command for CURVE).
I assume this is due to the handshake failing? Indeed, in zmtp_engine.cpp, the handshake takes the ZMQ_MAXMSGSIZE option as an argument in vX_decoder_t (_options.in_batch_size, _options.maxmsgsize).
I would either recommend to either make the handshake function ignore the ZMQ_MAXMSGSIZE option by taking an argument -1 instead of _options.maxmsgsize, or set a lower bound for the authorised input of the ZMQ_MAXMSGSIZE option. One could also specify in the manual that the ZMQ_MAXMSGSIZE option also applies to the handshake and that an appropriate lower bound should be used.
I encounter a problem when setting a low value for the
ZMQ_MAXMSGSIZE
option. With TCP, CURVE and a PUB/SUB, on my environment, whenever the value is between0
and275
, the connection fails and no messages are received. It starts working with the value276
(which I guess corresponds to the size of the INITIATE command for CURVE).I assume this is due to the handshake failing? Indeed, in zmtp_engine.cpp, the handshake takes the
ZMQ_MAXMSGSIZE
option as an argument invX_decoder_t (_options.in_batch_size, _options.maxmsgsize)
.I would either recommend to either make the handshake function ignore the
ZMQ_MAXMSGSIZE
option by taking an argument-1
instead of_options.maxmsgsize
, or set a lower bound for the authorised input of theZMQ_MAXMSGSIZE
option. One could also specify in the manual that theZMQ_MAXMSGSIZE
option also applies to the handshake and that an appropriate lower bound should be used.