diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-12-27 12:33:32 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-12-27 12:34:10 (GMT) |
commit | ad8e8feaabb0a35e7e816340fae474d132483275 (patch) | |
tree | fba2ab831187d106cdf19acccfa118070b740914 | |
parent | 5beacb825c2df1620462ba68df16eb61d15d7c33 (diff) | |
download | swift-contrib-ad8e8feaabb0a35e7e816340fae474d132483275.zip swift-contrib-ad8e8feaabb0a35e7e816340fae474d132483275.tar.bz2 |
Also emit connection disconnected signal when we initiate the disconnect.
-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()); } } |