diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-05-27 13:24:44 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-05-27 17:34:56 (GMT) |
commit | 109e50103d757d880e7ce390482951111dad1e22 (patch) | |
tree | cbb9cdb9f63eda164727a24653c8ef8bdf283a46 /Swift | |
parent | 0bdb45be4aa66dcc478d5f061096b1adbaa3ab2c (diff) | |
download | swift-contrib-109e50103d757d880e7ce390482951111dad1e22.zip swift-contrib-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')
-rw-r--r-- | Swift/Controllers/MainController.cpp | 5 |
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_) { |