From 212284c792c86fca52e0172a4d097abc5bb45252 Mon Sep 17 00:00:00 2001 From: grunfink Date: Mon, 13 Oct 2025 13:07:06 +0200 Subject: xs_http.h: new file. --- snac.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'snac.c') diff --git a/snac.c b/snac.c index a35cd06..31f524f 100644 --- a/snac.c +++ b/snac.c @@ -14,6 +14,7 @@ #include "xs_socket.h" #include "xs_unix_socket.h" #include "xs_url.h" +#include "xs_http.h" #include "xs_httpd.h" #include "xs_mime.h" #include "xs_regex.h" @@ -58,13 +59,6 @@ int mkdirx(const char *pathname) } -int valid_status(int status) -/* is this HTTP status valid? */ -{ - return status >= 200 && status <= 299; -} - - xs_str *tid(int offset) /* returns a time-based Id */ { @@ -176,16 +170,3 @@ int check_password(const char *uid, const char *passwd, const char *hash) return ret; } - - -const char *http_status_text(int status) -/* translate status codes to canonical status texts */ -{ - switch (status) { - case 599: return "Timeout"; -#define HTTP_STATUS(code, name, text) case HTTP_STATUS_ ## name: return #text; -#include "http_codes.h" -#undef HTTP_STATUS - default: return "Unknown"; - } -} -- cgit