diff options
author | cflip <cflip@cflip.net> | 2022-07-07 13:09:11 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-07-07 13:10:00 -0600 |
commit | c2cc2e5c759863229ce9d48d014243f6e7260353 (patch) | |
tree | 6be10b768b5f43af91840ae5c7cfecccff662d41 /src/ClientConnection.cpp | |
parent | 82c2af5878bb4c695a48c2d0707dffdb9356fce3 (diff) |
Create an HttpRequest class
Diffstat (limited to 'src/ClientConnection.cpp')
-rw-r--r-- | src/ClientConnection.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ClientConnection.cpp b/src/ClientConnection.cpp index da0cf9f..d54b4ee 100644 --- a/src/ClientConnection.cpp +++ b/src/ClientConnection.cpp @@ -9,8 +9,10 @@ ClientConnection::ClientConnection(int socket) { } -void ClientConnection::dump_request_data() +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]; int n; @@ -24,6 +26,8 @@ void ClientConnection::dump_request_data() memset(buffer, 0, BUFFER_SIZE); } + + return HttpRequest(buffer); } bool ClientConnection::send(const HttpResponse& response) |