From 32b3daad7e2c3d1d09b3ceb444eeab18b94c2db1 Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Mon, 19 May 2014 20:45:38 +0200 Subject: [PATCH] PLAIN: Small simplification --- src/plain_client.cpp | 5 ++--- src/plain_client.hpp | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plain_client.cpp b/src/plain_client.cpp index 38e77b61..4bf41bfa 100644 --- a/src/plain_client.cpp +++ b/src/plain_client.cpp @@ -30,7 +30,6 @@ zmq::plain_client_t::plain_client_t (const options_t &options_) : mechanism_t (options_), - error_command_received (false), state (sending_hello) { } @@ -98,7 +97,7 @@ zmq::mechanism_t::status_t zmq::plain_client_t::status () const if (state == ready) return mechanism_t::ready; else - if (error_command_received) + if (state == error_command_received) return mechanism_t::error; else return mechanism_t::handshaking; @@ -208,6 +207,6 @@ int zmq::plain_client_t::process_error ( errno = EPROTO; return -1; } - error_command_received = true; + state = error_command_received; return 0; } diff --git a/src/plain_client.hpp b/src/plain_client.hpp index 758c3bfc..c76bd05d 100644 --- a/src/plain_client.hpp +++ b/src/plain_client.hpp @@ -42,13 +42,12 @@ namespace zmq private: - bool error_command_received; - enum state_t { sending_hello, waiting_for_welcome, sending_initiate, waiting_for_ready, + error_command_received, ready };