summaryrefslogtreecommitdiff
path: root/src/ClientConnection.cpp
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2022-09-19 21:46:12 -0600
committercflip <cflip@cflip.net>2022-09-19 21:46:12 -0600
commitbcea88142033f37bffeca4df096fb7795ebf7020 (patch)
treed1f990532092327c3269ac3bed86eec6061a3067 /src/ClientConnection.cpp
parentb8766fcef6dcc40bd46584015375ea76518c6201 (diff)
Add ClangFormat configuration and reformat files
Diffstat (limited to 'src/ClientConnection.cpp')
-rw-r--r--src/ClientConnection.cpp10
1 files changed, 5 insertions, 5 deletions
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 <unistd.h>
+#include <cstring>
#include <iostream>
#include <sstream>
-#include <cstring>
+#include <unistd.h>
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);