uhttpd: - rewrite large parts of the server, use uloop event driven structure - suppo...
[openwrt/openwrt.git] / package / uhttpd / src / uhttpd-lua.h
index 2d2f73c1c2ab86482ff0401a4d28c5bca27f21c1..9a10933fc7539f198441726ee3f57ec26c97c521 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * uhttpd - Tiny single-threaded httpd - Lua header
  *
- *   Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
+ *   Copyright (C) 2010-2012 Jo-Philipp Wich <xm@subsignal.org>
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
 #define UH_LUA_ERR_PARAM   -3
 
 
-lua_State * uh_lua_init(const struct config *conf);
-
-void uh_lua_request(
-       struct client *cl, struct http_request *req, lua_State *L
-);
+struct uh_lua_state {
+       int rfd;
+       int wfd;
+       struct client *cl;
+       char httpbuf[UH_LIMIT_MSGHEAD];
+       int content_length;
+       bool data_sent;
+};
 
+lua_State * uh_lua_init(const struct config *conf);
+bool uh_lua_request(struct client *cl, lua_State *L);
 void uh_lua_close(lua_State *L);
 
 #endif