diff options
| author | auth <[email protected]> | 2020-07-11 17:09:27 +0200 |
|---|---|---|
| committer | auth <[email protected]> | 2020-07-11 17:09:27 +0200 |
| commit | f9b06df544c8134b5982b76f2d24aa93289f6d71 (patch) | |
| tree | 052961cb2d76b7999a722745b120d4fcd0977860 /server/src/client/client.h | |
| parent | More assembler implementations. (diff) | |
| download | loader-f9b06df544c8134b5982b76f2d24aa93289f6d71.tar.xz loader-f9b06df544c8134b5982b76f2d24aa93289f6d71.zip | |
Added blacklist implementation on server.
Overall code cleanup and optimization.
Diffstat (limited to 'server/src/client/client.h')
| -rw-r--r-- | server/src/client/client.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/server/src/client/client.h b/server/src/client/client.h index 141ac67..a3d558d 100644 --- a/server/src/client/client.h +++ b/server/src/client/client.h @@ -24,8 +24,10 @@ class client { void cleanup() { close(m_socket); - SSL_shutdown(m_ssl); - SSL_free(m_ssl); + if (m_ssl) { + SSL_shutdown(m_ssl); + SSL_free(m_ssl); + } m_socket = -1; } @@ -63,8 +65,9 @@ class client { int& get_socket() { return m_socket; } auto& get_ip() { return m_ip; } - auto& get_session() { return m_session_id; } - operator bool() const { return m_ssl && m_socket > 0; } + operator bool() const { return m_socket > 0; } + auto &operator()() { return m_session_id; } + }; }; // namespace tcp
\ No newline at end of file |