ruby-lsapi 4.0 → 4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/ext/lsapi/lsapidef.h +4 -2
- data/ext/lsapi/lsapilib.c +1129 -99
- data/ext/lsapi/lsapilib.h +45 -16
- data/ext/lsapi/lsruby.c +2 -2
- metadata +23 -36
data/ext/lsapi/lsapilib.h
CHANGED
@@ -106,7 +106,8 @@ typedef struct lsapi_request
|
|
106
106
|
char * m_pRequestMethod;
|
107
107
|
int m_totalLen;
|
108
108
|
int m_reqState;
|
109
|
-
|
109
|
+
off_t m_reqBodyLen;
|
110
|
+
off_t m_reqBodyRead;
|
110
111
|
int m_bufProcessed;
|
111
112
|
int m_bufRead;
|
112
113
|
|
@@ -114,6 +115,7 @@ typedef struct lsapi_request
|
|
114
115
|
|
115
116
|
struct lsapi_resp_header m_respHeader;
|
116
117
|
short m_respHeaderLen[LSAPI_MAX_RESP_HEADERS];
|
118
|
+
void * m_pAppData;
|
117
119
|
|
118
120
|
}LSAPI_Request;
|
119
121
|
|
@@ -158,22 +160,27 @@ int LSAPI_ForeachSpecialEnv_r( LSAPI_Request * pReq,
|
|
158
160
|
char * LSAPI_GetEnv_r( LSAPI_Request * pReq, const char * name );
|
159
161
|
|
160
162
|
|
161
|
-
|
163
|
+
ssize_t LSAPI_ReadReqBody_r( LSAPI_Request * pReq, char * pBuf, size_t len );
|
162
164
|
|
163
165
|
int LSAPI_ReqBodyGetChar_r( LSAPI_Request * pReq );
|
164
166
|
|
165
|
-
int LSAPI_ReqBodyGetLine_r( LSAPI_Request * pReq, char * pBuf,
|
167
|
+
int LSAPI_ReqBodyGetLine_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen, int *getLF );
|
166
168
|
|
167
169
|
|
168
170
|
int LSAPI_FinalizeRespHeaders_r( LSAPI_Request * pReq );
|
169
171
|
|
170
|
-
|
172
|
+
ssize_t LSAPI_Write_r( LSAPI_Request * pReq, const char * pBuf, size_t len );
|
171
173
|
|
172
|
-
|
174
|
+
ssize_t LSAPI_sendfile_r( LSAPI_Request * pReq, int fdIn, off_t* off, size_t size );
|
175
|
+
|
176
|
+
ssize_t LSAPI_Write_Stderr_r( LSAPI_Request * pReq, const char * pBuf, size_t len );
|
173
177
|
|
174
178
|
int LSAPI_Flush_r( LSAPI_Request * pReq );
|
175
179
|
|
176
|
-
int LSAPI_AppendRespHeader_r( LSAPI_Request *
|
180
|
+
int LSAPI_AppendRespHeader_r( LSAPI_Request * pReq, const char * pBuf, int len );
|
181
|
+
|
182
|
+
int LSAPI_AppendRespHeader2_r( LSAPI_Request * pReq, const char * pHeaderName,
|
183
|
+
const char * pHeaderValue );
|
177
184
|
|
178
185
|
static inline int LSAPI_SetRespStatus_r( LSAPI_Request * pReq, int code )
|
179
186
|
{
|
@@ -183,6 +190,21 @@ static inline int LSAPI_SetRespStatus_r( LSAPI_Request * pReq, int code )
|
|
183
190
|
return 0;
|
184
191
|
}
|
185
192
|
|
193
|
+
static inline int LSAPI_SetAppData_r( LSAPI_Request * pReq, void * data )
|
194
|
+
{
|
195
|
+
if ( !pReq )
|
196
|
+
return -1;
|
197
|
+
pReq->m_pAppData = data;
|
198
|
+
return 0;
|
199
|
+
}
|
200
|
+
|
201
|
+
static inline void * LSAPI_GetAppData_r( LSAPI_Request * pReq )
|
202
|
+
{
|
203
|
+
if ( !pReq )
|
204
|
+
return NULL;
|
205
|
+
return pReq->m_pAppData;
|
206
|
+
}
|
207
|
+
|
186
208
|
static inline char * LSAPI_GetQueryString_r( LSAPI_Request * pReq )
|
187
209
|
{
|
188
210
|
if ( pReq )
|
@@ -216,17 +238,17 @@ static inline char * LSAPI_GetRequestMethod_r( LSAPI_Request * pReq)
|
|
216
238
|
|
217
239
|
|
218
240
|
|
219
|
-
static inline
|
241
|
+
static inline off_t LSAPI_GetReqBodyLen_r( LSAPI_Request * pReq )
|
220
242
|
{
|
221
243
|
if ( pReq )
|
222
|
-
return pReq->
|
244
|
+
return pReq->m_reqBodyLen;
|
223
245
|
return -1;
|
224
246
|
}
|
225
247
|
|
226
|
-
static inline
|
248
|
+
static inline off_t LSAPI_GetReqBodyRemain_r( LSAPI_Request * pReq )
|
227
249
|
{
|
228
250
|
if ( pReq )
|
229
|
-
return pReq->
|
251
|
+
return pReq->m_reqBodyLen - pReq->m_reqBodyRead;
|
230
252
|
return -1;
|
231
253
|
}
|
232
254
|
|
@@ -270,13 +292,13 @@ static inline char * LSAPI_GetScriptName()
|
|
270
292
|
static inline char * LSAPI_GetRequestMethod()
|
271
293
|
{ return LSAPI_GetRequestMethod_r( &g_req ); }
|
272
294
|
|
273
|
-
static inline
|
295
|
+
static inline off_t LSAPI_GetReqBodyLen()
|
274
296
|
{ return LSAPI_GetReqBodyLen_r( &g_req ); }
|
275
297
|
|
276
|
-
static inline
|
298
|
+
static inline off_t LSAPI_GetReqBodyRemain()
|
277
299
|
{ return LSAPI_GetReqBodyRemain_r( &g_req ); }
|
278
300
|
|
279
|
-
static inline
|
301
|
+
static inline ssize_t LSAPI_ReadReqBody( char * pBuf, size_t len )
|
280
302
|
{ return LSAPI_ReadReqBody_r( &g_req, pBuf, len ); }
|
281
303
|
|
282
304
|
static inline int LSAPI_ReqBodyGetChar()
|
@@ -290,10 +312,15 @@ static inline int LSAPI_ReqBodyGetLine( char * pBuf, int len, int *getLF )
|
|
290
312
|
static inline int LSAPI_FinalizeRespHeaders(void)
|
291
313
|
{ return LSAPI_FinalizeRespHeaders_r( &g_req ); }
|
292
314
|
|
293
|
-
static inline
|
315
|
+
static inline ssize_t LSAPI_Write( const char * pBuf, ssize_t len )
|
294
316
|
{ return LSAPI_Write_r( &g_req, pBuf, len ); }
|
295
317
|
|
296
|
-
static inline
|
318
|
+
static inline ssize_t LSAPI_sendfile( int fdIn, off_t* off, size_t size )
|
319
|
+
{
|
320
|
+
return LSAPI_sendfile_r(&g_req, fdIn, off, size );
|
321
|
+
}
|
322
|
+
|
323
|
+
static inline ssize_t LSAPI_Write_Stderr( const char * pBuf, ssize_t len )
|
297
324
|
{ return LSAPI_Write_Stderr_r( &g_req, pBuf, len ); }
|
298
325
|
|
299
326
|
static inline int LSAPI_Flush()
|
@@ -329,12 +356,14 @@ void LSAPI_Set_Server_Max_Idle_Secs( int serverMaxIdle );
|
|
329
356
|
|
330
357
|
void LSAPI_Set_Max_Process_Time( int secs );
|
331
358
|
|
332
|
-
|
359
|
+
int LSAPI_Init_Env_Parameters( fn_select_t fp );
|
333
360
|
|
334
361
|
void LSAPI_Set_Slow_Req_Msecs( int msecs );
|
335
362
|
|
336
363
|
int LSAPI_Get_Slow_Req_Msecs( );
|
337
364
|
|
365
|
+
int LSAPI_is_suEXEC_Daemon();
|
366
|
+
|
338
367
|
#if defined (c_plusplus) || defined (__cplusplus)
|
339
368
|
}
|
340
369
|
#endif
|
data/ext/lsapi/lsruby.c
CHANGED
@@ -591,9 +591,9 @@ void Init_lsapi()
|
|
591
591
|
rb_tainted_str_new("CGI/1.2", 7));
|
592
592
|
|
593
593
|
/* Do not need those environments after initialization */
|
594
|
-
remove_env = rb_str_new( "RAILS_ROOT", 10 );
|
594
|
+
/* remove_env = rb_str_new( "RAILS_ROOT", 10 );
|
595
595
|
rb_funcall( env_copy, rb_intern( "delete" ), 1, remove_env );
|
596
|
-
|
596
|
+
*/
|
597
597
|
|
598
598
|
rb_define_global_function("eval_string_wrap", lsapi_eval_string_wrap, 1);
|
599
599
|
|
metadata
CHANGED
@@ -1,68 +1,55 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lsapi
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '4.1'
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- LiteSpeed Technologies Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
date: 2010-02-10 00:00:00 -05:00
|
13
|
-
default_executable:
|
11
|
+
date: 2013-01-30 00:00:00.000000000 Z
|
14
12
|
dependencies: []
|
15
|
-
|
16
13
|
description:
|
17
14
|
email: info@litespeedtech.com
|
18
15
|
executables: []
|
19
|
-
|
20
|
-
extensions:
|
16
|
+
extensions:
|
21
17
|
- ext/lsapi/extconf.rb
|
22
|
-
extra_rdoc_files:
|
18
|
+
extra_rdoc_files:
|
23
19
|
- README
|
24
|
-
files:
|
20
|
+
files:
|
25
21
|
- README
|
26
|
-
- examples
|
27
22
|
- examples/testlsapi.rb
|
28
23
|
- examples/lsapi_with_cgi.rb
|
29
|
-
- ext
|
30
|
-
- ext/lsapi
|
31
24
|
- ext/lsapi/extconf.rb
|
32
25
|
- ext/lsapi/lsapidef.h
|
33
26
|
- ext/lsapi/lsapilib.c
|
34
27
|
- ext/lsapi/lsapilib.h
|
35
28
|
- ext/lsapi/lsruby.c
|
36
|
-
- rails
|
37
29
|
- rails/dispatch.lsapi
|
38
|
-
- scripts
|
39
30
|
- scripts/lsruby_runner.rb
|
40
31
|
- setup.rb
|
41
|
-
has_rdoc: false
|
42
32
|
homepage: http://www.litespeedtech.com/
|
33
|
+
licenses: []
|
34
|
+
metadata: {}
|
43
35
|
post_install_message:
|
44
36
|
rdoc_options: []
|
45
|
-
|
46
|
-
require_paths:
|
37
|
+
require_paths:
|
47
38
|
- lib
|
48
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
-
requirements:
|
50
|
-
- -
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version:
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
version: "0"
|
59
|
-
version:
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
60
49
|
requirements: []
|
61
|
-
|
62
50
|
rubyforge_project: ruby-lsapi
|
63
|
-
rubygems_version:
|
51
|
+
rubygems_version: 2.0.6
|
64
52
|
signing_key:
|
65
|
-
specification_version:
|
53
|
+
specification_version: 4
|
66
54
|
summary: A ruby extension for fast communication with LiteSpeed Web Server.
|
67
55
|
test_files: []
|
68
|
-
|