summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-10-18 12:39:38 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-10-18 12:42:23 (GMT)
commitcc3828e7f77074064f92ddf306765da0780fa823 (patch)
tree6d819df0c04fb20c5a740f7d1f0921a333b0947b /Swiften/Client
parentd66625d2118fdcfa24e6426588ecdeb102a42966 (diff)
downloadswift-cc3828e7f77074064f92ddf306765da0780fa823.zip
swift-cc3828e7f77074064f92ddf306765da0780fa823.tar.bz2
Use the oldest error when closing streams.
Stops new errors overwriting cert validation errors and preventing Swift from prompting the user to trust the cert.
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/ClientSession.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp
index 791ee75..fd001a1 100644
--- a/Swiften/Client/ClientSession.cpp
+++ b/Swiften/Client/ClientSession.cpp
@@ -420,7 +420,9 @@ void ClientSession::finishSession(Error::Type error) {
void ClientSession::finishSession(boost::shared_ptr<Swift::Error> error) {
state = Finishing;
- error_ = error;
+ if (!error_) {
+ error_ = error;
+ }
assert(stream->isOpen());
if (stanzaAckResponder_) {
stanzaAckResponder_->handleAckRequestReceived();