diff options
author | louiz’ <louiz@louiz.org> | 2016-11-11 02:54:48 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-11-11 02:54:48 +0100 |
commit | 0c8adc85f7373a85de8b3edc6cac87d5f7389bb3 (patch) | |
tree | aefa90f4325424716b1304b4eac42d43371df1ca /src/irc/irc_client.cpp | |
parent | c41d003cbf3b14b83e0f9bf6c4787c3bd60bb7ee (diff) | |
download | biboumi-0c8adc85f7373a85de8b3edc6cac87d5f7389bb3.tar.gz biboumi-0c8adc85f7373a85de8b3edc6cac87d5f7389bb3.tar.bz2 biboumi-0c8adc85f7373a85de8b3edc6cac87d5f7389bb3.tar.xz biboumi-0c8adc85f7373a85de8b3edc6cac87d5f7389bb3.zip |
Move all the connect() logic from TCPSocketHandler into a subclass
This way, TCPSocketHandler only deal with the message sending/receiving, not
the connect() or anything else. This will be used for implementing servers
(because when a client is accepted, we don’t need all the connect() and dns
resolution stuff).
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r-- | src/irc/irc_client.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index b0d3a47..b13e5ab 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -131,7 +131,7 @@ IrcClient::IrcClient(std::shared_ptr<Poller> poller, const std::string& hostname const std::string& nickname, const std::string& username, const std::string& realname, const std::string& user_hostname, Bridge& bridge): - TCPSocketHandler(poller), + TCPClientSocketHandler(poller), hostname(hostname), user_hostname(user_hostname), username(username), @@ -338,7 +338,7 @@ void IrcClient::parse_in_buffer(const size_t) if (pos == std::string::npos) break ; IrcMessage message(this->in_buf.substr(0, pos)); - this->in_buf = this->in_buf.substr(pos + 2, std::string::npos); + this->consume_in_buffer(pos + 2); log_debug("IRC RECEIVING: (", this->get_hostname(), ") ", message); // Call the standard callback (if any), associated with the command |