mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 04:17:57 +01:00
Bug with setting options on SUB socket fixed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
@@ -38,6 +38,11 @@ zmq::sub_t::~sub_t ()
|
|||||||
int zmq::sub_t::xsetsockopt (int option_, const void *optval_,
|
int zmq::sub_t::xsetsockopt (int option_, const void *optval_,
|
||||||
size_t optvallen_)
|
size_t optvallen_)
|
||||||
{
|
{
|
||||||
|
if (option_ != ZMQ_SUBSCRIBE && option_ != ZMQ_UNSUBSCRIBE) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Create the subscription message.
|
// Create the subscription message.
|
||||||
msg_t msg;
|
msg_t msg;
|
||||||
int rc = msg.init_size (optvallen_ + 1);
|
int rc = msg.init_size (optvallen_ + 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user