From 57c1342c683df3207094e8ec660e72812be37f9c Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 12 Jul 2011 13:05:58 +0200 Subject: Bug with setting options on SUB socket fixed Signed-off-by: Martin Sustrik --- src/sub.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sub.cpp b/src/sub.cpp index 2a1454a..81082a2 100644 --- a/src/sub.cpp +++ b/src/sub.cpp @@ -38,6 +38,11 @@ zmq::sub_t::~sub_t () int zmq::sub_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_) { + if (option_ != ZMQ_SUBSCRIBE && option_ != ZMQ_UNSUBSCRIBE) { + errno = EINVAL; + return -1; + } + // Create the subscription message. msg_t msg; int rc = msg.init_size (optvallen_ + 1); -- cgit v1.2.3