summaryrefslogtreecommitdiffhomepage
path: root/request.h
blob: 690df883bdcb30945b6791b57bed674f99fee8ba (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
#pragma once

#include <lua.h>

struct connection;

struct span
{
	int start;
	int length;
};

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

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

int parse_request(struct connection *);

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