summaryrefslogtreecommitdiffhomepage
path: root/request.h
blob: b08236c3be8a7e6dcc12d41f5964a584891f1169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include <lua.h>

struct span
{
	int start;
	int length;
};

struct request
{
	int (* step)(struct request *);
	char * data;
	int length;
	int position;
	lua_State * lua;
	int reference;
	struct span temp;
	int expected_data_length;
	int fd;
};

struct request * new_request(lua_State *);
void free_request(lua_State *, struct request *);

int parse_request(lua_State *, int, struct request **);

int parse_step_method(struct request *);
int parse_step_path(struct request *);
int parse_step_version(struct request *);
int parse_step_header_name(struct request *);
int parse_step_header_value(struct request *);
int parse_step_data(struct request *);