diff options
author | cflip <cflip@cflip.net> | 2022-09-19 21:53:40 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-09-19 21:58:21 -0600 |
commit | 8ce7db9ba907ad4e826c826af898e1864f25f7bb (patch) | |
tree | 813b6862c25277856952f279f0614c0ce10d8053 /src/ClientConnection.cpp | |
parent | bcea88142033f37bffeca4df096fb7795ebf7020 (diff) |
Add ClangTidy configuration and apply fixes
Diffstat (limited to 'src/ClientConnection.cpp')
-rw-r--r-- | src/ClientConnection.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ClientConnection.cpp b/src/ClientConnection.cpp index 6a0670c..c434212 100644 --- a/src/ClientConnection.cpp +++ b/src/ClientConnection.cpp @@ -10,13 +10,13 @@ ClientConnection::ClientConnection(int socket) { } -HttpRequest ClientConnection::read_request() +HttpRequest ClientConnection::read_request() const { // TODO: Clean up this code to ensure it works with multiple lines // and not risk a buffer overflow. constexpr int BUFFER_SIZE = 4096; char buffer[BUFFER_SIZE + 1]; - int n; + int n = 0; memset(buffer, 0, BUFFER_SIZE); while ((n = read(m_socket_fd, buffer, BUFFER_SIZE - 1)) > 0) { @@ -29,7 +29,7 @@ HttpRequest ClientConnection::read_request() return HttpRequest(buffer); } -bool ClientConnection::send(const HttpResponse& response) +bool ClientConnection::send(const HttpResponse& response) const { if (!m_is_open) return false; |