diff options
author | louiz’ <louiz@louiz.org> | 2020-02-25 23:30:29 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2020-02-25 23:30:29 +0100 |
commit | c35e1aaa768c2d331ce4699245f820d6bbfcea7c (patch) | |
tree | 3b697303f3a5cc3ecb51da80612deef1775b5d76 /src/network | |
parent | 440e04c6ba1dfae2d6fbb55b120763e3d0da6cd1 (diff) | |
parent | 4b0fb8b37e5d2ff79da1c568ca38d4c8905dc9eb (diff) | |
download | biboumi-c35e1aaa768c2d331ce4699245f820d6bbfcea7c.tar.gz biboumi-c35e1aaa768c2d331ce4699245f820d6bbfcea7c.tar.bz2 biboumi-c35e1aaa768c2d331ce4699245f820d6bbfcea7c.tar.xz biboumi-c35e1aaa768c2d331ce4699245f820d6bbfcea7c.zip |
Merge branch 'v8'
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/tcp_client_socket_handler.cpp | 6 | ||||
-rw-r--r-- | src/network/tcp_client_socket_handler.hpp | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/network/tcp_client_socket_handler.cpp b/src/network/tcp_client_socket_handler.cpp index 6f67f02..7d1029f 100644 --- a/src/network/tcp_client_socket_handler.cpp +++ b/src/network/tcp_client_socket_handler.cpp @@ -260,8 +260,10 @@ std::string TCPClientSocketHandler::get_port() const return this->port; } -bool TCPClientSocketHandler::match_port_pairt(const uint16_t local, const uint16_t remote) const +bool TCPClientSocketHandler::match_port_pair(const uint16_t local, const uint16_t remote) const { + if (!this->is_connected()) + return false; const auto remote_port = static_cast<uint16_t>(std::stoi(this->port)); - return this->is_connected() && local == this->local_port && remote == remote_port; + return local == this->local_port && remote == remote_port; } diff --git a/src/network/tcp_client_socket_handler.hpp b/src/network/tcp_client_socket_handler.hpp index 74caca9..38d8b84 100644 --- a/src/network/tcp_client_socket_handler.hpp +++ b/src/network/tcp_client_socket_handler.hpp @@ -34,7 +34,7 @@ class TCPClientSocketHandler: public TCPSocketHandler /** * Whether or not this connection is using the two given TCP ports. */ - bool match_port_pairt(const uint16_t local, const uint16_t remote) const; + bool match_port_pair(const uint16_t local, const uint16_t remote) const; protected: bool hostname_resolution_failed; |