summaryrefslogtreecommitdiffhomepage
path: root/request.c
diff options
context:
space:
mode:
Diffstat (limited to 'request.c')
-rw-r--r--request.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/request.c b/request.c
index e8f47b0..3e67ff8 100644
--- a/request.c
+++ b/request.c
@@ -160,15 +160,18 @@ static int read_rest_of_line(struct request * request)
/// \return -1 if an error has occured, 0 if too little data available or total number of bytes processed
int parse_step_method(struct request * request)
{
- request->method.length = read_until_char(request, ' ');
+ request->temp.start = 0;
+ // TODO: Consider reworking read_* functions to be more aware of word boundaries.
+ request->temp.length = read_until_char(request, ' ');
- if (0 == request->method.length)
+ if (0 == request->temp.length)
{
return 0;
}
- request->step = parse_step_path;
+ lua_pushlstring(request->lua, request->data + request->temp.start, request->temp.length);
+ request->step = parse_step_path;
return parse_step_path(request);
}