diff options
author | cflip <cflip@cflip.net> | 2023-05-30 12:31:34 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-05-30 12:31:34 -0600 |
commit | 8dbdf132ea82a567d7cef856469fd47c511b4191 (patch) | |
tree | 66d87095b94b90a1a66946c0b514cfbe75ae1f10 /file.h | |
parent | 775c4157994ee0ebe9bd951a99bc5d7558128ba4 (diff) |
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.
Diffstat (limited to 'file.h')
-rw-r--r-- | file.h | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -5,9 +5,17 @@ #include "http.h" -int file_handle_request(struct http_request *, int); +enum serve_method { + SERVE_METHOD_FILE, + SERVE_METHOD_PHP, + SERVE_METHOD_ERROR +}; + +const char *file_path_for_uri(const char *); + +enum serve_method file_method_for_path(const char *, enum http_res_code *); int file_read(const char *, int); -int file_read_cgi(const char *, int); +int file_read_php(const char *, int); #endif |