php-internal-docs
8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
lsapidef.h
Go to the documentation of this file.
1
/*
2
+----------------------------------------------------------------------+
3
| Copyright (c) The PHP Group |
4
+----------------------------------------------------------------------+
5
| This source file is subject to version 3.01 of the PHP license, |
6
| that is bundled with this package in the file LICENSE, and is |
7
| available through the world-wide-web at the following url: |
8
| https://www.php.net/license/3_01.txt |
9
| If you did not receive a copy of the PHP license and are unable to |
10
| obtain it through the world-wide-web, please send a note to |
11
| license@php.net so we can mail you a copy immediately. |
12
+----------------------------------------------------------------------+
13
| Author: George Wang <gwang@litespeedtech.com> |
14
+----------------------------------------------------------------------+
15
*/
16
17
/*
18
Copyright (c) 2002-2015, Lite Speed Technologies Inc.
19
All rights reserved.
20
21
Redistribution and use in source and binary forms, with or without
22
modification, are permitted provided that the following conditions are
23
met:
24
25
* Redistributions of source code must retain the above copyright
26
notice, this list of conditions and the following disclaimer.
27
* Redistributions in binary form must reproduce the above
28
copyright notice, this list of conditions and the following
29
disclaimer in the documentation and/or other materials provided
30
with the distribution.
31
* Neither the name of the Lite Speed Technologies Inc nor the
32
names of its contributors may be used to endorse or promote
33
products derived from this software without specific prior
34
written permission.
35
36
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
37
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
38
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
39
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
40
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
43
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
*/
48
49
50
#ifndef _LSAPIDEF_H_
51
#define _LSAPIDEF_H_
52
53
#include <inttypes.h>
54
55
#if defined (c_plusplus) || defined (__cplusplus)
56
extern
"C"
{
57
#endif
58
59
enum
60
{
61
H_ACCEPT
= 0,
62
H_ACC_CHARSET
,
63
H_ACC_ENCODING
,
64
H_ACC_LANG
,
65
H_AUTHORIZATION
,
66
H_CONNECTION
,
67
H_CONTENT_TYPE
,
68
H_CONTENT_LENGTH
,
69
H_COOKIE
,
70
H_COOKIE2
,
71
H_HOST
,
72
H_PRAGMA
,
73
H_REFERER
,
74
H_USERAGENT
,
75
H_CACHE_CTRL
,
76
H_IF_MODIFIED_SINCE
,
77
H_IF_MATCH
,
78
H_IF_NO_MATCH
,
79
H_IF_RANGE
,
80
H_IF_UNMOD_SINCE
,
81
H_KEEP_ALIVE
,
82
H_RANGE
,
83
H_X_FORWARDED_FOR
,
84
H_VIA
,
85
H_TRANSFER_ENCODING
86
87
};
88
#define LSAPI_SOCK_FILENO 0
89
90
#define LSAPI_VERSION_B0 'L'
91
#define LSAPI_VERSION_B1 'S'
92
93
/* Values for m_flag in lsapi_packet_header */
94
#define LSAPI_ENDIAN_LITTLE 0
95
#define LSAPI_ENDIAN_BIG 1
96
#define LSAPI_ENDIAN_BIT 1
97
98
#if defined(__i386__)||defined( __x86_64 )||defined( __x86_64__ )
99
#define LSAPI_ENDIAN LSAPI_ENDIAN_LITTLE
100
#else
101
#define LSAPI_ENDIAN LSAPI_ENDIAN_BIG
102
#endif
103
104
/* Values for m_type in lsapi_packet_header */
105
#define LSAPI_BEGIN_REQUEST 1
106
#define LSAPI_ABORT_REQUEST 2
107
#define LSAPI_RESP_HEADER 3
108
#define LSAPI_RESP_STREAM 4
109
#define LSAPI_RESP_END 5
110
#define LSAPI_STDERR_STREAM 6
111
#define LSAPI_REQ_RECEIVED 7
112
#define LSAPI_CONN_CLOSE 8
113
#define LSAPI_INTERNAL_ERROR 9
114
115
116
#define LSAPI_MAX_HEADER_LEN (1024 * 256)
117
#define LSAPI_MAX_DATA_PACKET_LEN 16384
118
119
#define LSAPI_RESP_HTTP_HEADER_MAX 32768
120
#define LSAPI_PACKET_HEADER_LEN 8
121
122
123
struct
lsapi_packet_header
124
{
125
char
m_versionB0
;
/* LSAPI protocol version */
126
char
m_versionB1
;
127
char
m_type
;
128
char
m_flag
;
129
union
130
{
131
int32_t
m_iLen
;
/* include this header */
132
char
m_bytes
[4];
133
}
m_packetLen
;
134
};
135
136
/*
137
LSAPI request header packet
138
139
1. struct lsapi_req_header
140
2. struct lsapi_http_header_index
141
3. lsapi_header_offset * unknownHeaders
142
4. org http request header
143
5. request body if available
144
*/
145
146
struct
lsapi_req_header
147
{
148
struct
lsapi_packet_header
m_pktHeader
;
149
150
int32_t
m_httpHeaderLen
;
151
int32_t
m_reqBodyLen
;
152
int32_t
m_scriptFileOff
;
/* path to the script file. */
153
int32_t
m_scriptNameOff
;
/* decrypted URI, without pathinfo, */
154
int32_t
m_queryStringOff
;
/* Query string inside env */
155
int32_t
m_requestMethodOff
;
156
int32_t
m_cntUnknownHeaders
;
157
int32_t
m_cntEnv
;
158
int32_t
m_cntSpecialEnv
;
159
} ;
160
161
162
struct
lsapi_http_header_index
163
{
164
uint16_t
m_headerLen
[
H_TRANSFER_ENCODING
+1];
165
int32_t
m_headerOff
[
H_TRANSFER_ENCODING
+1];
166
} ;
167
168
struct
lsapi_header_offset
169
{
170
int32_t
nameOff
;
171
int32_t
nameLen
;
172
int32_t
valueOff
;
173
int32_t
valueLen
;
174
} ;
175
176
struct
lsapi_resp_info
177
{
178
int32_t
m_cntHeaders
;
179
int32_t
m_status
;
180
};
181
182
struct
lsapi_resp_header
183
{
184
struct
lsapi_packet_header
m_pktHeader
;
185
struct
lsapi_resp_info
m_respInfo
;
186
};
187
188
#if defined (c_plusplus) || defined (__cplusplus)
189
}
190
#endif
191
192
193
#endif
H_AUTHORIZATION
@ H_AUTHORIZATION
Definition
lsapidef.h:65
H_X_FORWARDED_FOR
@ H_X_FORWARDED_FOR
Definition
lsapidef.h:83
H_USERAGENT
@ H_USERAGENT
Definition
lsapidef.h:74
H_CONTENT_LENGTH
@ H_CONTENT_LENGTH
Definition
lsapidef.h:68
H_IF_MODIFIED_SINCE
@ H_IF_MODIFIED_SINCE
Definition
lsapidef.h:76
H_CONTENT_TYPE
@ H_CONTENT_TYPE
Definition
lsapidef.h:67
H_KEEP_ALIVE
@ H_KEEP_ALIVE
Definition
lsapidef.h:81
H_CONNECTION
@ H_CONNECTION
Definition
lsapidef.h:66
H_IF_RANGE
@ H_IF_RANGE
Definition
lsapidef.h:79
H_CACHE_CTRL
@ H_CACHE_CTRL
Definition
lsapidef.h:75
H_RANGE
@ H_RANGE
Definition
lsapidef.h:82
H_ACC_LANG
@ H_ACC_LANG
Definition
lsapidef.h:64
H_IF_UNMOD_SINCE
@ H_IF_UNMOD_SINCE
Definition
lsapidef.h:80
H_VIA
@ H_VIA
Definition
lsapidef.h:84
H_IF_NO_MATCH
@ H_IF_NO_MATCH
Definition
lsapidef.h:78
H_ACC_ENCODING
@ H_ACC_ENCODING
Definition
lsapidef.h:63
H_TRANSFER_ENCODING
@ H_TRANSFER_ENCODING
Definition
lsapidef.h:85
H_ACC_CHARSET
@ H_ACC_CHARSET
Definition
lsapidef.h:62
H_COOKIE
@ H_COOKIE
Definition
lsapidef.h:69
H_REFERER
@ H_REFERER
Definition
lsapidef.h:73
H_COOKIE2
@ H_COOKIE2
Definition
lsapidef.h:70
H_PRAGMA
@ H_PRAGMA
Definition
lsapidef.h:72
H_IF_MATCH
@ H_IF_MATCH
Definition
lsapidef.h:77
H_HOST
@ H_HOST
Definition
lsapidef.h:71
H_ACCEPT
@ H_ACCEPT
Definition
lsapidef.h:61
lsapi_header_offset
Definition
lsapidef.h:169
lsapi_header_offset::valueOff
int32_t valueOff
Definition
lsapidef.h:172
lsapi_header_offset::nameOff
int32_t nameOff
Definition
lsapidef.h:170
lsapi_header_offset::valueLen
int32_t valueLen
Definition
lsapidef.h:173
lsapi_header_offset::nameLen
int32_t nameLen
Definition
lsapidef.h:171
lsapi_http_header_index
Definition
lsapidef.h:163
lsapi_http_header_index::m_headerOff
int32_t m_headerOff[H_TRANSFER_ENCODING+1]
Definition
lsapidef.h:165
lsapi_http_header_index::m_headerLen
uint16_t m_headerLen[H_TRANSFER_ENCODING+1]
Definition
lsapidef.h:164
lsapi_packet_header
Definition
lsapidef.h:124
lsapi_packet_header::m_iLen
int32_t m_iLen
Definition
lsapidef.h:131
lsapi_packet_header::m_flag
char m_flag
Definition
lsapidef.h:128
lsapi_packet_header::m_type
char m_type
Definition
lsapidef.h:127
lsapi_packet_header::m_versionB1
char m_versionB1
Definition
lsapidef.h:126
lsapi_packet_header::m_bytes
char m_bytes[4]
Definition
lsapidef.h:132
lsapi_packet_header::m_packetLen
union lsapi_packet_header::@157307050311307165054220164115327273221010377301 m_packetLen
lsapi_packet_header::m_versionB0
char m_versionB0
Definition
lsapidef.h:125
lsapi_req_header
Definition
lsapidef.h:147
lsapi_req_header::m_scriptNameOff
int32_t m_scriptNameOff
Definition
lsapidef.h:153
lsapi_req_header::m_cntEnv
int32_t m_cntEnv
Definition
lsapidef.h:157
lsapi_req_header::m_httpHeaderLen
int32_t m_httpHeaderLen
Definition
lsapidef.h:150
lsapi_req_header::m_requestMethodOff
int32_t m_requestMethodOff
Definition
lsapidef.h:155
lsapi_req_header::m_scriptFileOff
int32_t m_scriptFileOff
Definition
lsapidef.h:152
lsapi_req_header::m_cntSpecialEnv
int32_t m_cntSpecialEnv
Definition
lsapidef.h:158
lsapi_req_header::m_cntUnknownHeaders
int32_t m_cntUnknownHeaders
Definition
lsapidef.h:156
lsapi_req_header::m_reqBodyLen
int32_t m_reqBodyLen
Definition
lsapidef.h:151
lsapi_req_header::m_queryStringOff
int32_t m_queryStringOff
Definition
lsapidef.h:154
lsapi_req_header::m_pktHeader
struct lsapi_packet_header m_pktHeader
Definition
lsapidef.h:148
lsapi_resp_header
Definition
lsapidef.h:183
lsapi_resp_header::m_pktHeader
struct lsapi_packet_header m_pktHeader
Definition
lsapidef.h:184
lsapi_resp_header::m_respInfo
struct lsapi_resp_info m_respInfo
Definition
lsapidef.h:185
lsapi_resp_info
Definition
lsapidef.h:177
lsapi_resp_info::m_status
int32_t m_status
Definition
lsapidef.h:179
lsapi_resp_info::m_cntHeaders
int32_t m_cntHeaders
Definition
lsapidef.h:178
sapi
litespeed
lsapidef.h
Generated on Sat Aug 23 2025 01:46:13 for php-internal-docs by
1.13.2