mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-28 08:44:06 +02:00
move http into http/
This commit is contained in:
parent
10fcc0fa51
commit
7d4dc46b80
@ -7,4 +7,5 @@
|
|||||||
-pedantic
|
-pedantic
|
||||||
-pedantic-errors
|
-pedantic-errors
|
||||||
-Wno-unused-parameter
|
-Wno-unused-parameter
|
||||||
|
-Wno-unused-function
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "http_server.h"
|
#include "http.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../controllers.h"
|
#include "../controllers.h"
|
||||||
#include "../http_server.h"
|
#include "../http.h"
|
||||||
#include "../models_json.h"
|
#include "../models_json.h"
|
||||||
|
|
||||||
void route_get_index(HttpCtx* ctx)
|
void route_get_index(HttpCtx* ctx)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../controllers.h"
|
#include "../controllers.h"
|
||||||
#include "../http_server.h"
|
#include "../http.h"
|
||||||
#include "../models_json.h"
|
#include "../models_json.h"
|
||||||
#include "../str_util.h"
|
#include "../str_util.h"
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../controllers.h"
|
#include "../controllers.h"
|
||||||
#include "../http_server.h"
|
#include "../http.h"
|
||||||
#include "../models_json.h"
|
#include "../models_json.h"
|
||||||
#include "../str_util.h"
|
#include "../str_util.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../controllers.h"
|
#include "../controllers.h"
|
||||||
#include "../http_server.h"
|
#include "../http.h"
|
||||||
#include "../models_json.h"
|
#include "../models_json.h"
|
||||||
#include "../str_util.h"
|
#include "../str_util.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "http_server.h"
|
#include "../http.h"
|
||||||
|
#include "../str_util.h"
|
||||||
#include "http_server_internal.h"
|
#include "http_server_internal.h"
|
||||||
#include "str_util.h"
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
@ -269,7 +269,8 @@ static inline void worker_handle_request(Worker* worker, Client* client)
|
|||||||
(void)worker;
|
(void)worker;
|
||||||
|
|
||||||
uint8_t* buffer = calloc(MAX_HEADER_BUFFER_SIZE, sizeof(char));
|
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) {
|
if (bytes_received == -1) {
|
||||||
fprintf(stderr, "error: could not receive request\n");
|
fprintf(stderr, "error: could not receive request\n");
|
||||||
@ -312,7 +313,8 @@ static inline void worker_handle_request(Worker* worker, Client* client)
|
|||||||
|
|
||||||
// HACK
|
// HACK
|
||||||
// TODO: We should treat the input as a stream rather than a block.
|
// 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);
|
size_t defacto_length = strlen(body);
|
||||||
int attempts = 0;
|
int attempts = 0;
|
||||||
const int arbitrary_max_attempts = 10;
|
const int arbitrary_max_attempts = 10;
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "collection.h"
|
#include "../collection.h"
|
||||||
#include "http_server.h"
|
#include "../http.h"
|
||||||
#include <bits/pthreadtypes.h>
|
#include <bits/pthreadtypes.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
@ -1,6 +1,6 @@
|
|||||||
#include "controllers.h"
|
#include "controllers.h"
|
||||||
#include "db_sqlite.h"
|
#include "db_sqlite.h"
|
||||||
#include "http_server.h"
|
#include "http.h"
|
||||||
#include "json.h"
|
#include "json.h"
|
||||||
#include "models.h"
|
#include "models.h"
|
||||||
#include "models_json.h"
|
#include "models_json.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user