client: fix invalid data access through invalid content-length values
[project/uhttpd.git] / uhttpd.h
index fe05f0d9284782dbdf1ec600a41f2042c3fa605e..f77718e3201d055ea167ca1d0bae3a76f32e092f 100644 (file)
--- a/uhttpd.h
+++ b/uhttpd.h
@@ -52,6 +52,13 @@ struct alias {
        char *path;
 };
 
+struct lua_prefix {
+       struct list_head list;
+       const char *handler;
+       const char *prefix;
+       void *ctx;
+};
+
 struct config {
        const char *docroot;
        const char *realm;
@@ -60,8 +67,6 @@ struct config {
        const char *cgi_prefix;
        const char *cgi_docroot_path;
        const char *cgi_path;
-       const char *lua_handler;
-       const char *lua_prefix;
        const char *ubus_prefix;
        const char *ubus_socket;
        int no_symlinks;
@@ -78,6 +83,7 @@ struct config {
        int ubus_cors;
        int cgi_prefix_len;
        struct list_head cgi_alias;
+       struct list_head lua_prefix;
 };
 
 struct auth_realm {
@@ -92,6 +98,9 @@ enum http_method {
        UH_HTTP_MSG_POST,
        UH_HTTP_MSG_HEAD,
        UH_HTTP_MSG_OPTIONS,
+       UH_HTTP_MSG_PUT,
+       UH_HTTP_MSG_PATCH,
+       UH_HTTP_MSG_DELETE,
 };
 
 enum http_version {
@@ -146,7 +155,6 @@ struct path_info {
        const char *name;
        const char *info;
        const char *query;
-       const char *auth;
        bool redirected;
        struct stat stat;
        const struct interpreter *ip;
@@ -300,7 +308,8 @@ void uh_client_read_cb(struct client *cl);
 void uh_client_notify_state(struct client *cl);
 
 void uh_auth_add(const char *path, const char *user, const char *pass);
-bool uh_auth_check(struct client *cl, struct path_info *pi);
+bool uh_auth_check(struct client *cl, const char *path, const char *auth,
+                   char **uptr, char **pptr);
 
 void uh_close_listen_fds(void);
 void uh_close_fds(void);