increase buffer and move to heap

This commit is contained in:
sfj 2025-03-13 11:32:31 +01:00
parent f7f8cf9e80
commit 1e8c110fc0
2 changed files with 3 additions and 3 deletions

View File

@ -268,8 +268,8 @@ static inline void worker_handle_request(Worker* worker, Client* client)
{
(void)worker;
uint8_t buffer[MAX_HEADER_BUFFER_SIZE] = { 0 };
ssize_t bytes_received = recv(client->file, &buffer, sizeof(buffer), 0);
uint8_t* buffer = calloc(MAX_HEADER_BUFFER_SIZE, sizeof(char));
ssize_t bytes_received = recv(client->file, buffer, MAX_HEADER_BUFFER_SIZE * sizeof(char), 0);
if (bytes_received == -1) {
fprintf(stderr, "error: could not receive request\n");

View File

@ -44,7 +44,7 @@ static inline void* worker_thread_fn(void* data);
static inline void worker_listen(Worker* worker);
static inline void worker_handle_request(Worker* worker, Client* req);
#define MAX_HEADER_BUFFER_SIZE 8192
#define MAX_HEADER_BUFFER_SIZE 65536
#define MAX_PATH_LEN 128 - 1
#define MAX_QUERY_LEN 128 - 1