From b7c5a2e7913517ff22b253f8b0083fa59a718150 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Fri, 28 Feb 2014 08:27:14 -0600 Subject: [PATCH] tls short read in state closed is no longer an error --- websocketpp/impl/connection_impl.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/websocketpp/impl/connection_impl.hpp b/websocketpp/impl/connection_impl.hpp index 7da82f0ead..6f3365d8b3 100644 --- a/websocketpp/impl/connection_impl.hpp +++ b/websocketpp/impl/connection_impl.hpp @@ -879,6 +879,13 @@ void connection::handle_read_frame(lib::error_code const & ec, } } if (ec == transport::error::tls_short_read) { + if (m_state == session::state::closed) { + // We expect to get a TLS short read if we try to read after the + // connection is closed. If this happens ignore and exit the + // read frame path. + terminate(lib::error_code()); + return; + } echannel = log::elevel::rerror; } else if (ec == transport::error::action_after_shutdown) { echannel = log::elevel::info;