From 6ac53d4c783340ae9139c7f4dcfe9bfddace5892 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 25 Sep 2016 02:57:21 +0200 Subject: runserver: reimplemented http server without libevent yeah, this patch implements a "complete" http server for static files. It is not the best code possible, and would be easily DDoS'able if used in production, as it spawns a thread for each request, without limiting. I'm sickish and this is the best code I can deliver now. At least it works! ;) --- src/blogc-runserver/httpd-utils.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/blogc-runserver/httpd-utils.h (limited to 'src/blogc-runserver/httpd-utils.h') diff --git a/src/blogc-runserver/httpd-utils.h b/src/blogc-runserver/httpd-utils.h new file mode 100644 index 0000000..b9af852 --- /dev/null +++ b/src/blogc-runserver/httpd-utils.h @@ -0,0 +1,19 @@ +/* + * blogc: A blog compiler. + * Copyright (C) 2015-2016 Rafael G. Martins + * + * This program can be distributed under the terms of the BSD License. + * See the file LICENSE. + */ + +#ifndef _HTTPD_UTILS_H +#define _HTTPD_UTILS_H + +#define READLINE_BUFFER_SIZE 1024 + +char* br_readline(int socket); +int br_hextoi(const char c); +char* br_urldecode(const char *str); +const char* br_get_extension(const char *filename); + +#endif /* _HTTPD_UTILS_H */ -- cgit v1.2.3-18-g5258