From 36a3b84dbad0d077776f17a5e1de31178b091a64 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 19 Apr 2013 00:15:25 -0700 Subject: [PATCH] Fix a rare race condition. --- src/cpp/websocketpp/src/connection.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpp/websocketpp/src/connection.hpp b/src/cpp/websocketpp/src/connection.hpp index ed1b67bb87..52863efdf8 100644 --- a/src/cpp/websocketpp/src/connection.hpp +++ b/src/cpp/websocketpp/src/connection.hpp @@ -263,7 +263,7 @@ public: boost::lock_guard lock(m_lock); if (m_state != session::state::OPEN) {return;} - if (m_detached) {return;} + if (m_detached || !m_processor) {return;} // TODO: optimize control messages and handle case where // endpoint is out of messages @@ -895,7 +895,7 @@ public: // try and read more if (m_state != session::state::CLOSED && m_processor && - m_processor->get_bytes_needed() > 0 && // FIXME: m_processor had been reset here + m_processor->get_bytes_needed() > 0 && !m_protocol_error) { // TODO: read timeout timer?