summaryrefslogtreecommitdiff
path: root/snac.c
diff options
context:
space:
mode:
authorGravatar grunfink2025-10-13 13:07:06 +0200
committerGravatar grunfink2025-10-13 13:07:06 +0200
commit212284c792c86fca52e0172a4d097abc5bb45252 (patch)
tree4fe9ebc3859eec9edb46388a606cb6d54898c64a /snac.c
parentUpdated RELEASE_NOTES. (diff)
downloadpenes-snac2-212284c792c86fca52e0172a4d097abc5bb45252.tar.gz
penes-snac2-212284c792c86fca52e0172a4d097abc5bb45252.tar.xz
penes-snac2-212284c792c86fca52e0172a4d097abc5bb45252.zip
xs_http.h: new file.
Diffstat (limited to 'snac.c')
-rw-r--r--snac.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/snac.c b/snac.c
index a35cd06..31f524f 100644
--- a/snac.c
+++ b/snac.c
@@ -14,6 +14,7 @@
14#include "xs_socket.h" 14#include "xs_socket.h"
15#include "xs_unix_socket.h" 15#include "xs_unix_socket.h"
16#include "xs_url.h" 16#include "xs_url.h"
17#include "xs_http.h"
17#include "xs_httpd.h" 18#include "xs_httpd.h"
18#include "xs_mime.h" 19#include "xs_mime.h"
19#include "xs_regex.h" 20#include "xs_regex.h"
@@ -58,13 +59,6 @@ int mkdirx(const char *pathname)
58} 59}
59 60
60 61
61int valid_status(int status)
62/* is this HTTP status valid? */
63{
64 return status >= 200 && status <= 299;
65}
66
67
68xs_str *tid(int offset) 62xs_str *tid(int offset)
69/* returns a time-based Id */ 63/* returns a time-based Id */
70{ 64{
@@ -176,16 +170,3 @@ int check_password(const char *uid, const char *passwd, const char *hash)
176 170
177 return ret; 171 return ret;
178} 172}
179
180
181const char *http_status_text(int status)
182/* translate status codes to canonical status texts */
183{
184 switch (status) {
185 case 599: return "Timeout";
186#define HTTP_STATUS(code, name, text) case HTTP_STATUS_ ## name: return #text;
187#include "http_codes.h"
188#undef HTTP_STATUS
189 default: return "Unknown";
190 }
191}