49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
/*
** Abort the current page request if the load average of the host
** computer is too high. Admin and Setup users are exempt from this
** restriction.
*/
void load_control(void){
double mxLoad = atof(db_get("max-loadavg", 0));
if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
login_check_credentials();
if(g.perm.Admin || g.perm.Setup){
return;
}
style_set_current_feature("test");
style_header("Server Overload");
@ <h2>The server load is currently too high.
@ Please try again later.</h2>
@ <p>Current load average: %f(load_average()).<br />
@ Load average limit: %f(mxLoad)</p>
|
>
>
>
|
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
/*
** Abort the current page request if the load average of the host
** computer is too high. Admin and Setup users are exempt from this
** restriction.
*/
void load_control(void){
double mxLoad = atof(db_get("max-loadavg", 0));
#if 1
/* Disable this block only to test load restrictions */
if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
login_check_credentials();
if(g.perm.Admin || g.perm.Setup){
return;
}
#endif
style_set_current_feature("test");
style_header("Server Overload");
@ <h2>The server load is currently too high.
@ Please try again later.</h2>
@ <p>Current load average: %f(load_average()).<br />
@ Load average limit: %f(mxLoad)</p>
|