From 8dbdf132ea82a567d7cef856469fd47c511b4191 Mon Sep 17 00:00:00 2001 From: cflip Date: Tue, 30 May 2023 12:31:34 -0600 Subject: Refactor response building code This new strategy involves finding the local file path for the given URI, determining what method to use to fulfill the request (read file from disk, use php-cgi, or error), then it writes the response to the client socket. --- http.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'http.h') diff --git a/http.h b/http.h index 1e97820..3cdc062 100644 --- a/http.h +++ b/http.h @@ -11,8 +11,8 @@ enum http_req_method { }; enum http_res_code { - HTTP_RESPONSE_OK = 200, - HTTP_RESPONSE_NOTFOUND = 404 + HTTP_RESPONSE_OK, + HTTP_RESPONSE_NOTFOUND }; struct http_request { @@ -23,6 +23,6 @@ struct http_request { struct http_request http_parse_request(const char *); void http_free_request(struct http_request *); -int http_build_response(char *, enum http_res_code, const char *, size_t); +void http_response_statusline(enum http_res_code, int); #endif -- cgit v1.2.3