summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Session')
-rw-r--r--Swiften/Session/BasicSessionStream.cpp9
-rw-r--r--Swiften/Session/SessionStream.h3
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) {}