From 971cbeda3de6691b212ad18bed9e9f08b278cfe1 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 1 May 2012 16:41:04 +0200 Subject: Revert "Implement protocol versioning (except PGM)" This reverts commit 512f3a604924fec9d89e2b4bfd6f73aa66309fa7. --- src/options.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/options.cpp') diff --git a/src/options.cpp b/src/options.cpp index d362c18..f7bbdc4 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -48,11 +48,7 @@ xs::options_t::options_t () : sndtimeo (-1), ipv4only (1), keepalive (0), - legacy_protocol (false), - sp_pattern (-1), - sp_version (-1), - sp_role (-1), - sp_complement (-1), + protocol (0), filter (XS_FILTER_PREFIX), survey_timeout (-1), delay_on_close (true), @@ -240,6 +236,21 @@ int xs::options_t::setsockopt (int option_, const void *optval_, return 0; } + case XS_PROTOCOL: + { + if (optvallen_ != sizeof (int)) { + errno = EINVAL; + return -1; + } + int val = *((int*) optval_); + if (val < 0) { + errno = EINVAL; + return -1; + } + protocol = val; + return 0; + } + case XS_FILTER: if (optvallen_ != sizeof (int)) { errno = EINVAL; @@ -446,7 +457,7 @@ int xs::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_) errno = EINVAL; return -1; } - *((int*) optval_) = sp_version; + *((int*) optval_) = protocol; *optvallen_ = sizeof (int); return 0; -- cgit v1.2.3