diff options
-rw-r--r-- | plop.c | 2 | ||||
-rw-r--r-- | request.c | 13 | ||||
-rw-r--r-- | request.h | 1 |
3 files changed, 8 insertions, 8 deletions
@@ -113,7 +113,7 @@ int handle_client(lua_State * L, struct pollfd * pfd, struct request ** request, lua_getglobal((*request)->lua, "Handler"); lua_insert((*request)->lua, 1); lua_pushlstring((*request)->lua, (*request)->data, (*request)->length); - lua_call((*request)->lua, 3, 1); + lua_call((*request)->lua, 4, 1); size_t length; const char * body = lua_tolstring((*request)->lua, -1, &length); @@ -217,11 +217,11 @@ int parse_step_path(struct request * request) // TODO: Return -1 if version is unsupported, meaning other than HTTP/1.1 int parse_step_version(struct request * request) { - if (0 >= request->version.start) + if (0 >= request->temp.start) { - request->version.start = read_until_word(request); + request->temp.start = read_until_word(request); - if (0 == request->version.start) + if (0 == request->temp.start) { return 0; } @@ -234,10 +234,11 @@ int parse_step_version(struct request * request) return 0; } - request->version.length = request->position - request->version.start; - request->step = parse_step_header_name; + request->temp.length = request->position - request->temp.start; - return parse_step_header_name(request); + lua_pushlstring(request->lua, request->data + request->temp.start, request->temp.length); + + PROCEED_TO(parse_step_header_name); } /// Parses and verifies name of a single header from the request. @@ -23,7 +23,6 @@ struct request lua_State * lua; int reference; struct span temp; - struct span version; struct header * headerv; int headerc; struct span body; |