summaryrefslogtreecommitdiff
path: root/src/options.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-03-24 14:48:50 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-03-24 14:48:50 +0100
commit17e82a361121dc81c90e17f1382dff678537b651 (patch)
tree25896e0124cf0f247ca9e754021458b3d2eac01a /src/options.cpp
parenta2252de2bcecb672f09c8a5d0013cce23d1d404f (diff)
ZMQ_SNDBUF and ZMQ_RCVBUF type changed to int
This mimics POSIX specification. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/options.cpp')
-rw-r--r--src/options.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/options.cpp b/src/options.cpp
index a053048..4c1289a 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -87,7 +87,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0;
case ZMQ_RECOVERY_IVL:
- if (optvallen_ != sizeof (int64_t) || *((int64_t*) optval_) < 0) {
+ if (optvallen_ != sizeof (int64_t) || *((int64_t*) optval_) < 0) {
errno = EINVAL;
return -1;
}
@@ -95,19 +95,19 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0;
case ZMQ_SNDBUF:
- if (optvallen_ != sizeof (uint64_t)) {
+ if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) {
errno = EINVAL;
return -1;
}
- sndbuf = *((uint64_t*) optval_);
+ sndbuf = *((int*) optval_);
return 0;
case ZMQ_RCVBUF:
- if (optvallen_ != sizeof (uint64_t)) {
+ if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) {
errno = EINVAL;
return -1;
}
- rcvbuf = *((uint64_t*) optval_);
+ rcvbuf = *((int*) optval_);
return 0;
case ZMQ_LINGER:
@@ -215,21 +215,21 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
return 0;
case ZMQ_SNDBUF:
- if (*optvallen_ < sizeof (uint64_t)) {
+ if (*optvallen_ < sizeof (int)) {
errno = EINVAL;
return -1;
}
- *((uint64_t*) optval_) = sndbuf;
- *optvallen_ = sizeof (uint64_t);
+ *((int*) optval_) = sndbuf;
+ *optvallen_ = sizeof (int);
return 0;
case ZMQ_RCVBUF:
- if (*optvallen_ < sizeof (uint64_t)) {
+ if (*optvallen_ < sizeof (int)) {
errno = EINVAL;
return -1;
}
- *((uint64_t*) optval_) = rcvbuf;
- *optvallen_ = sizeof (uint64_t);
+ *((int*) optval_) = rcvbuf;
+ *optvallen_ = sizeof (int);
return 0;
case ZMQ_TYPE: