summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-12-27 12:33:32 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-12-27 12:34:10 (GMT)
commitad8e8feaabb0a35e7e816340fae474d132483275 (patch)
treefba2ab831187d106cdf19acccfa118070b740914 /Swiften/Network/BoostConnection.cpp
parent5beacb825c2df1620462ba68df16eb61d15d7c33 (diff)
downloadswift-contrib-ad8e8feaabb0a35e7e816340fae474d132483275.zip
swift-contrib-ad8e8feaabb0a35e7e816340fae474d132483275.tar.bz2
Also emit connection disconnected signal when we initiate the disconnect.
Diffstat (limited to 'Swiften/Network/BoostConnection.cpp')
-rw-r--r--Swiften/Network/BoostConnection.cpp8
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());
}
}