summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-07-15 15:39:25 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-07-15 15:39:25 +0200
commit11a31db2d5bcc158bb8902e74f192dbc82827f53 (patch)
tree045aa047a7a63c80c501d9f8be30e3cb2ac95ce8 /src/xmpp
parent4582f1079767f53bb6bd9b96c358ea3c641aaa96 (diff)
downloadbiboumi-11a31db2d5bcc158bb8902e74f192dbc82827f53.tar.gz
biboumi-11a31db2d5bcc158bb8902e74f192dbc82827f53.tar.bz2
biboumi-11a31db2d5bcc158bb8902e74f192dbc82827f53.tar.xz
biboumi-11a31db2d5bcc158bb8902e74f192dbc82827f53.zip
Send the reason of the connection close to the user
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/xmpp_component.cpp11
-rw-r--r--src/xmpp/xmpp_component.hpp2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index 51d65aa..6af67a4 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -108,9 +108,16 @@ void XmppComponent::on_connected()
this->send_pending_data();
}
-void XmppComponent::on_connection_close()
+void XmppComponent::on_connection_close(const std::string& error)
{
- log_info("XMPP server closed connection");
+ if (error.empty())
+ {
+ log_info("XMPP server closed connection");
+ }
+ else
+ {
+ log_info("XMPP server closed connection: " << error);
+ }
}
void XmppComponent::parse_in_buffer(const size_t size)
diff --git a/src/xmpp/xmpp_component.hpp b/src/xmpp/xmpp_component.hpp
index 42cdb8a..daadbec 100644
--- a/src/xmpp/xmpp_component.hpp
+++ b/src/xmpp/xmpp_component.hpp
@@ -38,7 +38,7 @@ public:
void on_connection_failed(const std::string& reason) override final;
void on_connected() override final;
- void on_connection_close() override final;
+ void on_connection_close(const std::string& error) override final;
void parse_in_buffer(const size_t size) override final;
/**