summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-27 13:24:44 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-27 17:34:56 (GMT)
commit109e50103d757d880e7ce390482951111dad1e22 (patch)
treecbb9cdb9f63eda164727a24653c8ef8bdf283a46 /Swift/Controllers
parent0bdb45be4aa66dcc478d5f061096b1adbaa3ab2c (diff)
downloadswift-109e50103d757d880e7ce390482951111dad1e22.zip
swift-109e50103d757d880e7ce390482951111dad1e22.tar.bz2
Cleaning up code paths for rapid disconnect/reconnect.
This includes a fix in OpensSSLContext that stops assert failures when more data is received on a connection after a write has failed. It's worth investigating why this happens, stopping it doing so, and re-instate the assert. Resolves: #402
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/MainController.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 596edd2..d6a5587 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -333,6 +333,9 @@ void MainController::performLoginFromCachedCredentials() {
}
client_->onError.connect(boost::bind(&MainController::handleError, this, _1));
client_->onConnected.connect(boost::bind(&MainController::handleConnected, this));
+ } else {
+ /* In case we're in the middle of another login, make sure they don't overlap */
+ client_->disconnect();
}
client_->connect();
}
@@ -387,7 +390,7 @@ void MainController::signOut() {
}
void MainController::logout() {
- if (client_ && client_->isAvailable()) {
+ if (client_ /*&& client_->isAvailable()*/) {
client_->disconnect();
}
if (rosterController_) {