diff --git a/httpd/src/http/http.c b/httpd/src/http/http.c index e69de29..6cb59d0 100644 --- a/httpd/src/http/http.c +++ b/httpd/src/http/http.c @@ -0,0 +1,10 @@ +#include "http.h" + +struct http_request *parse_request(struct string *req) +{} + +struct http_response *generate_response(struct http_request *req) +{} + +struct string *format_response(struct http_response *resp) +{} diff --git a/httpd/src/http/http.h b/httpd/src/http/http.h index 95a9cc6..f52bb72 100644 --- a/httpd/src/http/http.h +++ b/httpd/src/http/http.h @@ -45,5 +45,35 @@ struct http_response struct http_header *headers; // Headers linked list }; +// === Functions + +/* @brief Parses the HTTP request and splits it into a request structure + * + * @params req + * + * @return A pointer to the structure containing the request infos on success, + * NULL otherwise + */ + struct http_request* parse_request(struct string* req); + +/* @brief Generates a response to the given request + * + * @params req + * + * @return A pointer to the generated response struct on success, + * NULL otherwise + */ + struct http_response* generate_response(struct http_request* req); + +/* @brief Formats the given response structure into a valid HTTP response + * string + * + * @params resp + * + * @return A pointer to the string containing the response on success, + * NULL otherwise + */ + struct string* format_response(struct http_response* resp); + #endif // ! HTTP_H diff --git a/httpd/src/logger/logs.c b/httpd/src/logger/logs.c index acbe9ec..b3bc6f2 100644 --- a/httpd/src/logger/logs.c +++ b/httpd/src/logger/logs.c @@ -5,7 +5,7 @@ #include #include -#include "../utils/fmt_time/fmt_time.h" +#include "../utils/time/fmt_time.h" // === Static variables