summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/xmpp_component.cpp13
-rw-r--r--src/xmpp/xmpp_component.hpp6
2 files changed, 13 insertions, 6 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index 1e8f9e0..6af67a4 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -37,7 +37,7 @@ static std::set<std::string> kickable_errors{
};
XmppComponent::XmppComponent(std::shared_ptr<Poller> poller, const std::string& hostname, const std::string& secret):
- SocketHandler(poller),
+ TCPSocketHandler(poller),
ever_auth(false),
last_auth(false),
served_hostname(hostname),
@@ -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 ce594ec..daadbec 100644
--- a/src/xmpp/xmpp_component.hpp
+++ b/src/xmpp/xmpp_component.hpp
@@ -2,7 +2,7 @@
# define XMPP_COMPONENT_INCLUDED
#include <xmpp/adhoc_commands_handler.hpp>
-#include <network/socket_handler.hpp>
+#include <network/tcp_socket_handler.hpp>
#include <xmpp/xmpp_parser.hpp>
#include <bridge/bridge.hpp>
@@ -30,7 +30,7 @@
*
* TODO: implement XEP-0225: Component Connections
*/
-class XmppComponent: public SocketHandler
+class XmppComponent: public TCPSocketHandler
{
public:
explicit XmppComponent(std::shared_ptr<Poller> poller, const std::string& hostname, const std::string& secret);
@@ -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;
/**