diff options
Diffstat (limited to 'Swiften/Session/BasicSessionStream.cpp')
-rw-r--r-- | Swiften/Session/BasicSessionStream.cpp | 9 |
1 files changed, 7 insertions, 2 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) { |