diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-11-10 22:06:59 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-11-10 22:06:59 (GMT) |
commit | f76e39f30966279a10a9ba97271cebdc3cba2c4d (patch) | |
tree | 486514e62ce717b607b9af8a13db3b0fceddf46c /Swiften/Session | |
parent | 80a67051508b7a2f59e0ded9d1dd4df490d44ec2 (diff) | |
download | swift-f76e39f30966279a10a9ba97271cebdc3cba2c4d.zip swift-f76e39f30966279a10a9ba97271cebdc3cba2c4d.tar.bz2 |
Fix error messages.
Diffstat (limited to 'Swiften/Session')
-rw-r--r-- | Swiften/Session/BasicSessionStream.cpp | 9 | ||||
-rw-r--r-- | Swiften/Session/SessionStream.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp index 807470e..e0fbce7 100644 --- a/Swiften/Session/BasicSessionStream.cpp +++ b/Swiften/Session/BasicSessionStream.cpp @@ -113,9 +113,14 @@ void BasicSessionStream::handleTLSError() { onError(boost::shared_ptr<Error>(new Error(Error::TLSError))); } -void BasicSessionStream::handleConnectionError(const boost::optional<Connection::Error>&) { +void BasicSessionStream::handleConnectionError(const boost::optional<Connection::Error>& error) { available = false; - onError(boost::shared_ptr<Error>(new Error(Error::ConnectionError))); + if (error == Connection::ReadError) { + onError(boost::shared_ptr<Error>(new Error(Error::ConnectionReadError))); + } + else { + onError(boost::shared_ptr<Error>(new Error(Error::ConnectionWriteError))); + } } void BasicSessionStream::handleDataRead(const ByteArray& data) { diff --git a/Swiften/Session/SessionStream.h b/Swiften/Session/SessionStream.h index 6bba237..1252c5a 100644 --- a/Swiften/Session/SessionStream.h +++ b/Swiften/Session/SessionStream.h @@ -17,7 +17,8 @@ namespace Swift { ParseError, TLSError, InvalidTLSCertificateError, - ConnectionError + ConnectionReadError, + ConnectionWriteError }; Error(Type type) : type(type) {} |