From bcea88142033f37bffeca4df096fb7795ebf7020 Mon Sep 17 00:00:00 2001 From: cflip Date: Mon, 19 Sep 2022 21:46:12 -0600 Subject: Add ClangFormat configuration and reformat files --- src/ClientConnection.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ClientConnection.cpp') diff --git a/src/ClientConnection.cpp b/src/ClientConnection.cpp index 8982780..6a0670c 100644 --- a/src/ClientConnection.cpp +++ b/src/ClientConnection.cpp @@ -1,9 +1,9 @@ #include "ClientConnection.h" -#include +#include #include #include -#include +#include ClientConnection::ClientConnection(int socket) : m_socket_fd(socket) @@ -15,12 +15,12 @@ HttpRequest ClientConnection::read_request() // 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]; + char buffer[BUFFER_SIZE + 1]; int n; memset(buffer, 0, BUFFER_SIZE); - while ((n = read(m_socket_fd, buffer, BUFFER_SIZE-1)) > 0) { - if (buffer[n-1] == '\n') + while ((n = read(m_socket_fd, buffer, BUFFER_SIZE - 1)) > 0) { + if (buffer[n - 1] == '\n') break; memset(buffer, 0, BUFFER_SIZE); -- cgit v1.2.3