From cae643434576c0cc3b631c3a5b72ea524f0203e0 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 28 Apr 2018 12:35:36 +0100 Subject: [PATCH] Problem: HEARTBEAT command breaks REQ connection Solution: ignore command messages in the REQ session to avoid disrupting the state machine. Commands are handled by the engine before handing off to the session. --- src/req.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/req.cpp b/src/req.cpp index 4342048d..ca9718df 100644 --- a/src/req.cpp +++ b/src/req.cpp @@ -285,6 +285,11 @@ zmq::req_session_t::~req_session_t () int zmq::req_session_t::push_msg (msg_t *msg_) { + // Ignore commands, they are processed by the engine and should not + // affect the state machine. + if (unlikely (msg_->flags () & msg_t::command)) + return 0; + switch (state) { case bottom: if (msg_->flags () == msg_t::more) {