getsockopt ZMQ_RCVMORE requires sizeof(int) at least, with 1 byte it should be more than enough
Description
Environment
None
Activity
Show:

PieterP November 7, 2013 at 1:18 PM
Socket options are always int when possible for consistency. Otherwise it's extremely hard for users to remember what types to use for what options.
in socket_base.cpp, line 267:
if (option_ == ZMQ_RCVMORE) {
if (*optvallen_ < sizeof (int)) {
errno = EINVAL;
return -1;
}
((int) optval_) = rcvmore ? 1 : 0;
*optvallen_ = sizeof (int);
return 0;
}
It forces the optval to be sizeof(int) when a char would be enough. What is the reason of enforcing at least sizeof(int) ?