From d6d396790754dc03bfbde4d957c31e2170151bfd Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 13 Mar 2012 16:00:57 +0100 Subject: Type of XS_MAXMSGSIZE changed to uint64_t Signed-off-by: Martin Sustrik --- src/options.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/options.cpp') diff --git a/src/options.cpp b/src/options.cpp index 50ef379..2b123c2 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -21,6 +21,7 @@ */ #include +#include #include "options.hpp" #include "err.hpp" @@ -40,7 +41,7 @@ xs::options_t::options_t () : reconnect_ivl (100), reconnect_ivl_max (0), backlog (100), - maxmsgsize (-1), + maxmsgsize (std::numeric_limits ::max ()), rcvtimeo (-1), sndtimeo (-1), ipv4only (1), @@ -169,11 +170,11 @@ int xs::options_t::setsockopt (int option_, const void *optval_, return 0; case XS_MAXMSGSIZE: - if (optvallen_ != sizeof (int64_t)) { + if (optvallen_ != sizeof (uint64_t)) { errno = EINVAL; return -1; } - maxmsgsize = *((int64_t*) optval_); + maxmsgsize = *((uint64_t*) optval_); return 0; case XS_MULTICAST_HOPS: @@ -343,12 +344,12 @@ int xs::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_) return 0; case XS_MAXMSGSIZE: - if (*optvallen_ < sizeof (int64_t)) { + if (*optvallen_ < sizeof (uint64_t)) { errno = EINVAL; return -1; } - *((int64_t*) optval_) = maxmsgsize; - *optvallen_ = sizeof (int64_t); + *((uint64_t*) optval_) = maxmsgsize; + *optvallen_ = sizeof (uint64_t); return 0; case XS_MULTICAST_HOPS: -- cgit v1.2.3