getsockopt ZMQ_RCVMORE requires sizeof(int) at least, with 1 byte it should be more than enough

Description

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) ?

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.

Won't Fix

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Created November 6, 2013 at 1:10 PM
Updated November 7, 2013 at 1:18 PM
Resolved November 7, 2013 at 1:18 PM