move http into http/

This commit is contained in:
SimonFJ20 2025-03-13 13:56:28 +01:00
parent 10fcc0fa51
commit 7d4dc46b80
11 changed files with 15 additions and 12 deletions

View File

@ -7,4 +7,5 @@
-pedantic
-pedantic-errors
-Wno-unused-parameter
-Wno-unused-function

View File

@ -1,7 +1,7 @@
#pragma once
#include "db.h"
#include "http_server.h"
#include "http.h"
#include <stdio.h>
#include <string.h>

View File

@ -1,5 +1,5 @@
#include "../controllers.h"
#include "../http_server.h"
#include "../http.h"
#include "../models_json.h"
void route_get_index(HttpCtx* ctx)

View File

@ -1,5 +1,5 @@
#include "../controllers.h"
#include "../http_server.h"
#include "../http.h"
#include "../models_json.h"
#include "../str_util.h"

View File

@ -1,5 +1,5 @@
#include "../controllers.h"
#include "../http_server.h"
#include "../http.h"
#include "../models_json.h"
#include "../str_util.h"
#include <string.h>

View File

@ -1,5 +1,5 @@
#include "../controllers.h"
#include "../http_server.h"
#include "../http.h"
#include "../models_json.h"
#include "../str_util.h"
#include <string.h>

View File

@ -1,6 +1,6 @@
#include "http_server.h"
#include "../http.h"
#include "../str_util.h"
#include "http_server_internal.h"
#include "str_util.h"
#include <ctype.h>
#include <netinet/in.h>
#include <pthread.h>
@ -269,7 +269,8 @@ static inline void worker_handle_request(Worker* worker, Client* client)
(void)worker;
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);
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");
@ -312,7 +313,8 @@ static inline void worker_handle_request(Worker* worker, Client* client)
// HACK
// TODO: We should treat the input as a stream rather than a block.
// Look at either @camper0008's stream example or other HTTP-server implementations.
// Look at either @camper0008's stream example or other HTTP-server
// implementations.
size_t defacto_length = strlen(body);
int attempts = 0;
const int arbitrary_max_attempts = 10;

View File

@ -1,7 +1,7 @@
#pragma once
#include "collection.h"
#include "http_server.h"
#include "../collection.h"
#include "../http.h"
#include <bits/pthreadtypes.h>
#include <netinet/in.h>
#include <pthread.h>

View File

@ -1,6 +1,6 @@
#include "controllers.h"
#include "db_sqlite.h"
#include "http_server.h"
#include "http.h"
#include "json.h"
#include "models.h"
#include "models_json.h"