This repository has been archived by the owner on Mar 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathfcgi_body.h
76 lines (53 loc) · 2.47 KB
/
fcgi_body.h
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef FCGI_BODY_H
#define FCGI_BODY_H
#include <stdint.h>
struct fcgi_body_begin_request {
uint8_t roleB1;
uint8_t roleB0;
uint8_t flags;
uint8_t reserved[5];
};
typedef struct fcgi_body_begin_request *fcgi_body_begin_request_t;
/* mask for flags component of fcgi_body_begin_request_t */
#define FCGI_KEEP_CONN 1
/* values for role component of fcgi_body_begin_request_t */
#define FCGI_RESPONDER 1
#define FCGI_AUTHORIZER 2
#define FCGI_FILTER 3
uint16_t fcgi_body_begin_request_role_get(fcgi_body_begin_request_t begin_request_body);
void fcgi_body_begin_request_role_set(fcgi_body_begin_request_t begin_request_body, uint16_t role);
uint8_t fcgi_body_begin_request_flags_get(fcgi_body_begin_request_t begin_request_body);
void fcgi_body_begin_request_flags_set(fcgi_body_begin_request_t begin_request_body, uint8_t flags);
void fcgi_body_begin_request_reserved_set(fcgi_body_begin_request_t begin_request_body);
void fcgi_body_begin_request_set(fcgi_body_begin_request_t begin_request_body,
uint16_t role, uint8_t flags);
uint16_t fcgi_record_params_calc_len(uint16_t key_len, uint16_t value_len);
uint16_t fcgi_record_params_value_get(uint8_t *data, char **keyP,
uint16_t *key_lenP, char **valueP, uint16_t *value_lenP);
uint16_t fcgi_record_params_value_set(uint8_t *data, const char *key,
uint16_t key_len, const char *value, uint16_t value_len);
uint16_t fcgi_record_params_set(uint8_t *data, char **env);
struct fcgi_body_end_request {
uint8_t app_statusB3;
uint8_t app_statusB2;
uint8_t app_statusB1;
uint8_t app_statusB0;
uint8_t protocol_status;
uint8_t reserved[3];
};
typedef struct fcgi_body_end_request *fcgi_body_end_request_t;
uint32_t fcgi_body_end_request_app_status_get(fcgi_body_end_request_t end_request_body);
void fcgi_body_end_request_app_status_set(fcgi_body_end_request_t end_request_body,
uint32_t app_status);
uint8_t fcgi_body_end_request_protocol_status_get(fcgi_body_end_request_t end_request_body);
void fcgi_body_end_request_protocol_status_set(fcgi_body_end_request_t end_request_body,
uint8_t protocol_status);
void fcgi_body_end_request_reserved_set(fcgi_body_end_request_t end_request_body);
void fcgi_body_end_request_set(fcgi_body_end_request_t end_request_body,
uint32_t app_status, uint8_t protocol_status);
/* values for protocol_status component of fcgi_body_end_request_t */
#define FCGI_REQUEST_COMPLETE 0
#define FCGI_CANT_MPX_CONN 1
#define FCGI_OVERLOADED 2
#define FCGI_UNKNOWN_ROLE 3
#endif