ruby-lsapi 2.5 → 2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -4
- data/ext/lsapi/lsapilib.c +5 -4
- data/ext/lsapi/lsruby.c +12 -6
- metadata +4 -3
data/README
CHANGED
@@ -74,7 +74,7 @@ Usually, there is no need to set value of LSAPI_CHILDREN over 100 in most
|
|
74
74
|
server environment.
|
75
75
|
|
76
76
|
|
77
|
-
* LSAPI_EXTRA_CHILDREN (default:
|
77
|
+
* LSAPI_EXTRA_CHILDREN (default: 0)
|
78
78
|
|
79
79
|
LSAPI_EXTRA_CHILDREN controls the maximum number of extra children processes
|
80
80
|
can be started when some or all existing children processes are in
|
@@ -82,9 +82,9 @@ malfunctioning state. Total number of children processes will be reduced to
|
|
82
82
|
LSAPI_CHILDREN level as soon as service is back to normal.
|
83
83
|
|
84
84
|
|
85
|
-
*
|
85
|
+
* LSAPI_MAX_REQS (default value: 10000)
|
86
86
|
|
87
|
-
|
87
|
+
LSAPI_MAX_REQS specifies the maximum number of requests each child
|
88
88
|
process will handle before it exits automatically. This parameter can
|
89
89
|
help reducing memory usage when there are memory leaks in the application.
|
90
90
|
|
@@ -96,7 +96,7 @@ process will wait for a new request before exit. This option help
|
|
96
96
|
releasing system resources taken by idle processes.
|
97
97
|
|
98
98
|
|
99
|
-
* LSAPI_MAX_IDLE_CHILDREN (default value:
|
99
|
+
* LSAPI_MAX_IDLE_CHILDREN (default value: LSAPI_CHILDREN)
|
100
100
|
|
101
101
|
In Self Managed Mode, LSAI_MAX_IDLE_CHILDREN controls how many idle
|
102
102
|
children processes are allowed. Excessive idle children processes
|
data/ext/lsapi/lsapilib.c
CHANGED
@@ -1519,9 +1519,9 @@ int LSAPI_Init_Prefork_Server( int max_children, fn_select_t fp )
|
|
1519
1519
|
|
1520
1520
|
s_ppid = getppid();
|
1521
1521
|
g_prefork_server->m_iMaxChildren = max_children;
|
1522
|
-
g_prefork_server->m_iExtraChildren =
|
1523
|
-
g_prefork_server->m_iMaxIdleChildren = max_children
|
1524
|
-
g_prefork_server->m_iChildrenMaxIdleTime =
|
1522
|
+
g_prefork_server->m_iExtraChildren = 0 ;
|
1523
|
+
g_prefork_server->m_iMaxIdleChildren = max_children + 1;
|
1524
|
+
g_prefork_server->m_iChildrenMaxIdleTime = 300;
|
1525
1525
|
g_prefork_server->m_iMaxReqProcessTime = 300;
|
1526
1526
|
return 0;
|
1527
1527
|
}
|
@@ -1648,7 +1648,8 @@ static void lsapi_check_child_status( long tmCur )
|
|
1648
1648
|
if (( s_max_idle_secs> 0)&&(tmCur - pStatus->m_tmWaitBegin > s_max_idle_secs + 5 ))
|
1649
1649
|
tobekilled = 1;
|
1650
1650
|
}
|
1651
|
-
|
1651
|
+
if ( !tobekilled )
|
1652
|
+
++idle;
|
1652
1653
|
}
|
1653
1654
|
else
|
1654
1655
|
{
|
data/ext/lsapi/lsruby.c
CHANGED
@@ -104,17 +104,20 @@ static int add_env_rails( const char * pKey, int keyLen, const char * pValue, in
|
|
104
104
|
len = valLen - ( p - pValue ) - 1;
|
105
105
|
//valLen = p - pValue;
|
106
106
|
//*p++ = 0;
|
107
|
-
++p;
|
108
107
|
}
|
109
108
|
else
|
110
109
|
{
|
111
|
-
p =
|
110
|
+
p = (char *)pValue + valLen;
|
112
111
|
len = 0;
|
113
112
|
}
|
113
|
+
rb_hash_aset( lsapi_env,rb_tainted_str_new("PATH_INFO", 9),
|
114
|
+
rb_tainted_str_new(pValue, p - pValue));
|
115
|
+
rb_hash_aset( lsapi_env,rb_tainted_str_new("REQUEST_PATH", 12),
|
116
|
+
rb_tainted_str_new(pValue, p - pValue));
|
117
|
+
if ( *p == '?' )
|
118
|
+
++p;
|
114
119
|
rb_hash_aset( lsapi_env,rb_tainted_str_new("QUERY_STRING", 12),
|
115
120
|
rb_tainted_str_new(p, len));
|
116
|
-
rb_hash_aset( lsapi_env,rb_tainted_str_new("PATH_INFO", 9),
|
117
|
-
rb_tainted_str_new(pValue, valLen));
|
118
121
|
}
|
119
122
|
break;
|
120
123
|
case 'S':
|
@@ -585,7 +588,8 @@ void Init_lsapi()
|
|
585
588
|
}
|
586
589
|
if ( p || getenv( "RAILS_ENV" ) )
|
587
590
|
s_fn_add_env = add_env_rails;
|
588
|
-
|
591
|
+
|
592
|
+
|
589
593
|
orig_stdin = rb_stdin;
|
590
594
|
orig_stdout = rb_stdout;
|
591
595
|
orig_stderr = rb_stderr;
|
@@ -593,11 +597,13 @@ void Init_lsapi()
|
|
593
597
|
orig_defout = rb_defout;
|
594
598
|
#endif
|
595
599
|
orig_env = rb_const_get( rb_cObject, rb_intern("ENV") );
|
596
|
-
|
597
600
|
env_copy = rb_funcall( orig_env, rb_intern( "to_hash" ), 0 );
|
598
601
|
|
599
602
|
//tell the garbage collector it is a global variable, do not recycle it.
|
600
603
|
rb_global_variable(&env_copy);
|
604
|
+
|
605
|
+
rb_hash_aset( env_copy,rb_tainted_str_new("GATEWAY_INTERFACE", 17),
|
606
|
+
rb_tainted_str_new("CGI/1.2", 7));
|
601
607
|
|
602
608
|
//Do not need those environments after initialization
|
603
609
|
remove_env = rb_str_new( "RAILS_ROOT", 10 );
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.4
|
3
3
|
specification_version: 1
|
4
4
|
name: ruby-lsapi
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "2.
|
7
|
-
date: 2007-
|
6
|
+
version: "2.6"
|
7
|
+
date: 2007-08-04 00:00:00 -04:00
|
8
8
|
summary: A ruby extension for fast communication with LiteSpeed Web Server.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -25,6 +25,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
30
|
- LiteSpeed Technologies Inc.
|
30
31
|
files:
|