-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrequest.h
More file actions
47 lines (32 loc) · 904 Bytes
/
request.h
File metadata and controls
47 lines (32 loc) · 904 Bytes
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
#ifndef __LOONG_SSO_REQUEST_H__
#define __LOONG_SSO_REQUEST_H__
struct request;
typedef void PF(int fd, struct request *req);
typedef enum {
HTTP_METHOD_GET,
HTTP_METHOD_POST,
HTTP_METHOD_HEAD,
HTTP_METHOD_UNKNOWN
} http_method_t;
struct request
{
int fd;
sds buf;
time_t now;
size_t sentlen;
HTTP_STATE state;
char *pool_id; //pool key name
char *path;
char ip[16];
lua_State *vm;
int ref;
http_method_t http_method;
PF *handler;
struct request *link; //Á¬½Ó³ØµÄRedisÁ´½Ó
struct llhead entry;
};
bool request_initialize(int fd, PF *handler);
void request_delete(int fd, struct request *req);
bool request_new(int fd, PF *handler, char *ip);
void request_change(int fd, struct request *req, PF *handler, fdevent_t filter);
#endif