diff options
author | cflip <cflip@cflip.net> | 2022-07-07 12:06:33 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-07-07 12:06:33 -0600 |
commit | 82c2af5878bb4c695a48c2d0707dffdb9356fce3 (patch) | |
tree | 16a6a6fe1a1584bde55935892f02ff89b6f5eedb /src/ClientConnection.cpp | |
parent | 76e6c3d690caac3faa664b7b8b79cbc7c6a58394 (diff) |
Add some more abstractions to HttpResponse
Diffstat (limited to 'src/ClientConnection.cpp')
-rw-r--r-- | src/ClientConnection.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/ClientConnection.cpp b/src/ClientConnection.cpp index 3bf93c3..da0cf9f 100644 --- a/src/ClientConnection.cpp +++ b/src/ClientConnection.cpp @@ -26,24 +26,19 @@ void ClientConnection::dump_request_data() } } -bool ClientConnection::send(const HttpResponse& response, const char* message) +bool ClientConnection::send(const HttpResponse& response) { if (!m_is_open) return false; - std::stringstream ss; - ss << response.to_string() - << "\r\n\r\n" - << message; - - std::string result = ss.str(); + std::string result = response.to_string(); write(m_socket_fd, result.c_str(), result.length()); return true; } -void ClientConnection::close() +void ClientConnection::close_connection() { m_is_open = false; - ::close(m_socket_fd); + close(m_socket_fd); } |