diff options
-rw-r--r-- | Swiften/Network/BoostConnection.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Network/BoostConnection.cpp b/Swiften/Network/BoostConnection.cpp index 6ec8460..f3cf9a6 100644 --- a/Swiften/Network/BoostConnection.cpp +++ b/Swiften/Network/BoostConnection.cpp @@ -92,10 +92,10 @@ void BoostConnection::handleSocketRead(const boost::system::error_code& error, s eventLoop->postEvent(boost::bind(boost::ref(onDataRead), ByteArray(&readBuffer_[0], bytesTransferred)), shared_from_this()); doRead(); } - else if (error == boost::asio::error::eof) { + else if (error == boost::asio::error::eof || error == boost::asio::error::operation_aborted) { eventLoop->postEvent(boost::bind(boost::ref(onDisconnected), boost::optional<Error>()), shared_from_this()); } - else if (error != boost::asio::error::operation_aborted) { + else { eventLoop->postEvent(boost::bind(boost::ref(onDisconnected), ReadError), shared_from_this()); } } @@ -104,10 +104,10 @@ void BoostConnection::handleDataWritten(const boost::system::error_code& error) if (!error) { eventLoop->postEvent(boost::ref(onDataWritten), shared_from_this()); } - if (error == boost::asio::error::eof) { + else if (error == boost::asio::error::eof || error == boost::asio::error::operation_aborted) { eventLoop->postEvent(boost::bind(boost::ref(onDisconnected), boost::optional<Error>()), shared_from_this()); } - else if (error && error != boost::asio::error::operation_aborted) { + else { eventLoop->postEvent(boost::bind(boost::ref(onDisconnected), WriteError), shared_from_this()); } } |