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/*
18Copyright (c) 2002-2015, Lite Speed Technologies Inc.
19All rights reserved.
20
21Redistribution and use in source and binary forms, with or without
22modification, are permitted provided that the following conditions are
23met:
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
36THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
37"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
38LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
39A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
40OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
43DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46OF 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)
56extern "C" {
57#endif
58
59enum
60{
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
124{
125 char m_versionB0; /* LSAPI protocol version */
127 char m_type;
128 char m_flag;
129 union
130 {
131 int32_t m_iLen; /* include this header */
132 char m_bytes[4];
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
147{
149
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 */
157 int32_t m_cntEnv;
159} ;
160
161
167
169{
170 int32_t nameOff;
171 int32_t nameLen;
172 int32_t valueOff;
173 int32_t valueLen;
174} ;
175
177{
179 int32_t m_status;
180};
181
187
188#if defined (c_plusplus) || defined (__cplusplus)
189}
190#endif
191
192
193#endif
@ H_AUTHORIZATION
Definition lsapidef.h:65
@ H_X_FORWARDED_FOR
Definition lsapidef.h:83
@ H_USERAGENT
Definition lsapidef.h:74
@ H_CONTENT_LENGTH
Definition lsapidef.h:68
@ H_IF_MODIFIED_SINCE
Definition lsapidef.h:76
@ H_CONTENT_TYPE
Definition lsapidef.h:67
@ H_KEEP_ALIVE
Definition lsapidef.h:81
@ H_CONNECTION
Definition lsapidef.h:66
@ H_IF_RANGE
Definition lsapidef.h:79
@ H_CACHE_CTRL
Definition lsapidef.h:75
@ H_RANGE
Definition lsapidef.h:82
@ H_ACC_LANG
Definition lsapidef.h:64
@ H_IF_UNMOD_SINCE
Definition lsapidef.h:80
@ H_VIA
Definition lsapidef.h:84
@ H_IF_NO_MATCH
Definition lsapidef.h:78
@ H_ACC_ENCODING
Definition lsapidef.h:63
@ H_TRANSFER_ENCODING
Definition lsapidef.h:85
@ H_ACC_CHARSET
Definition lsapidef.h:62
@ H_COOKIE
Definition lsapidef.h:69
@ H_REFERER
Definition lsapidef.h:73
@ H_COOKIE2
Definition lsapidef.h:70
@ H_PRAGMA
Definition lsapidef.h:72
@ H_IF_MATCH
Definition lsapidef.h:77
@ H_HOST
Definition lsapidef.h:71
@ H_ACCEPT
Definition lsapidef.h:61
int32_t m_headerOff[H_TRANSFER_ENCODING+1]
Definition lsapidef.h:165
uint16_t m_headerLen[H_TRANSFER_ENCODING+1]
Definition lsapidef.h:164
union lsapi_packet_header::@157307050311307165054220164115327273221010377301 m_packetLen
int32_t m_scriptNameOff
Definition lsapidef.h:153
int32_t m_cntEnv
Definition lsapidef.h:157
int32_t m_httpHeaderLen
Definition lsapidef.h:150
int32_t m_requestMethodOff
Definition lsapidef.h:155
int32_t m_scriptFileOff
Definition lsapidef.h:152
int32_t m_cntSpecialEnv
Definition lsapidef.h:158
int32_t m_cntUnknownHeaders
Definition lsapidef.h:156
int32_t m_reqBodyLen
Definition lsapidef.h:151
int32_t m_queryStringOff
Definition lsapidef.h:154
struct lsapi_packet_header m_pktHeader
Definition lsapidef.h:148
struct lsapi_packet_header m_pktHeader
Definition lsapidef.h:184
struct lsapi_resp_info m_respInfo
Definition lsapidef.h:185
int32_t m_status
Definition lsapidef.h:179
int32_t m_cntHeaders
Definition lsapidef.h:178