blob: fbafb581cc3397e38a9f140a089d4c830e94d20c (
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#ifndef __common_net_h
#define __common_net_h
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <errno.h>
#include "../net.h"
#include "../lua.h"
#include "../io.h"
#include "../table.h"
#include "../types/str.h"
#include "../types/parray.h"
#include "../types/map.h"
#define max_con 200
//2^42
#define MAX_HEADER_SIZE (1<<20)
#define BUFFER_SIZE 20000
#define HTTP_BUFFER_SIZE 4098
#define max_content_length 200000
static int ports[65535] = { 0 };
static parray_t* paths = NULL;
enum file_status {
_ignore, BARRIER_READ, FILE_HEADER, FILE_BODY, NORMAL
};
struct file_parse {
enum file_status status;
str *current, *old, *boundary, *boundary_id;
int dash_count, table_idx;
};
typedef struct {
int fd;
int port;
lua_State* L;
struct sockaddr_in cli;
} thread_arg_struct;
struct lchar {
char* c;
int len;
char req[20];
};
struct sarray_t {
struct lchar** cs;
int len;
};
extern map_t* mime_type;
#endif
|