@@ -69,15 +69,15 @@ static int limits_handler(request_rec *r) {
69
69
return DECLINED ;
70
70
#ifdef APACHE2
71
71
ap_log_error (APLOG_MARK , APLOG_DEBUG , OK , r -> server ,
72
- "current limits IP: %d UID: %d Load: %.2f cAVG: %.2f T: %d" ,
72
+ "mod_limits: current limits IP: %d UID: %d Load: %.2f cAVG: %.2f T: %d" ,
73
73
limits -> ip ,
74
74
limits -> uid ,
75
75
limits -> loadavg ,
76
76
limits -> curavg [0 ],
77
77
(int ) limits -> lastavg );
78
78
#else
79
79
ap_log_error (APLOG_MARK , APLOG_DEBUG , r -> server ,
80
- "current limits IP: %d UID: %d Load: %.2f cAVG: %.2f T: %d" ,
80
+ "mod_limits: current limits IP: %d UID: %d Load: %.2f cAVG: %.2f T: %d" ,
81
81
limits -> ip ,
82
82
limits -> uid ,
83
83
limits -> loadavg ,
@@ -96,7 +96,7 @@ static int limits_handler(request_rec *r) {
96
96
if (limits -> curavg [0 ] > limits -> loadavg ) {
97
97
#ifdef APACHE2
98
98
ap_log_error (APLOG_MARK , APLOG_INFO , OK , r -> server ,
99
- "%s client rejected because current load %.2f > %.2f" ,
99
+ "mod_limits: %s client rejected because current load %.2f > %.2f" ,
100
100
#ifdef APACHE24
101
101
r -> connection -> client_ip , limits -> curavg [0 ], limits -> loadavg );
102
102
#else
@@ -106,7 +106,7 @@ static int limits_handler(request_rec *r) {
106
106
apr_table_setn (r -> subprocess_env , "LIMITED" , "1" );
107
107
#else
108
108
ap_log_error (APLOG_MARK , APLOG_INFO , r -> server ,
109
- "%s client rejected because current load %.2f > %.2f" ,
109
+ "mod_limits: %s client rejected because current load %.2f > %.2f" ,
110
110
r -> connection -> remote_ip , limits -> curavg [0 ], limits -> loadavg );
111
111
/* set an environment variable */
112
112
ap_table_setn (r -> subprocess_env , "LIMITED" , "1" );
@@ -135,9 +135,9 @@ static int limits_handler(request_rec *r) {
135
135
if (ip_count > limits -> ip ) {
136
136
ap_log_error (APLOG_MARK , APLOG_INFO , OK , r -> server ,
137
137
#ifdef APACHE24
138
- "%s client exceeded connection limit" , r -> connection -> client_ip );
138
+ "mod_limits: %s client exceeded connection limit" , r -> connection -> client_ip );
139
139
#else
140
- "%s client exceeded connection limit" , r -> connection -> remote_ip );
140
+ "mod_limits: %s client exceeded connection limit" , r -> connection -> remote_ip );
141
141
#endif // APACHE24
142
142
/* set an environment variable */
143
143
apr_table_setn (r -> subprocess_env , "LIMITED" , "1" );
@@ -149,9 +149,9 @@ static int limits_handler(request_rec *r) {
149
149
150
150
ap_log_error (APLOG_MARK , APLOG_DEBUG , OK , r -> server ,
151
151
#ifdef APACHE24
152
- "%s connection count: %d" , r -> connection -> client_ip , ip_count );
152
+ "mod_limits: %s connection count: %d" , r -> connection -> client_ip , ip_count );
153
153
#else
154
- "%s connection count: %d" , r -> connection -> remote_ip , ip_count );
154
+ "mod_limits: %s connection count: %d" , r -> connection -> remote_ip , ip_count );
155
155
#endif // APACHE24
156
156
#else
157
157
for (i = 0 ; i < HARD_SERVER_LIMIT ; ++ i ) {
@@ -162,7 +162,7 @@ static int limits_handler(request_rec *r) {
162
162
ip_count ++ ;
163
163
if (ip_count > limits -> ip ) {
164
164
ap_log_error (APLOG_MARK , APLOG_INFO , r -> server ,
165
- "%s client exceeded connection limit" , r -> connection -> remote_ip );
165
+ "mod_limits: %s client exceeded connection limit" , r -> connection -> remote_ip );
166
166
/* set an environment variable */
167
167
ap_table_setn (r -> subprocess_env , "LIMITED" , "1" );
168
168
/* return 503 */
@@ -171,7 +171,7 @@ static int limits_handler(request_rec *r) {
171
171
}
172
172
173
173
ap_log_error (APLOG_MARK , APLOG_DEBUG , r -> server ,
174
- "%s connection count: %d" , r -> connection -> remote_ip , ip_count );
174
+ "mod_limits: %s connection count: %d" , r -> connection -> remote_ip , ip_count );
175
175
#endif // APACHE2
176
176
177
177
return OK ;
@@ -221,25 +221,25 @@ static const char *cfg_checkavg(cmd_parms *cmd, void *mconfig, const char *arg)
221
221
static command_rec limits_cmds [] = {
222
222
#ifdef APACHE2
223
223
AP_INIT_TAKE1 (
224
- "MaxConnsPerIP " , cfg_perip , NULL , RSRC_CONF ,
224
+ "LimitMaxConnsPerIP " , cfg_perip , NULL , RSRC_CONF ,
225
225
"maximum simultaneous connections per IP address" ),
226
226
AP_INIT_TAKE1 (
227
- "MaxConnsPerUid " , cfg_peruid , NULL , RSRC_CONF ,
227
+ "LimitMaxConnsPerUid " , cfg_peruid , NULL , RSRC_CONF ,
228
228
"maximum simultaneous connections per user" ),
229
229
AP_INIT_TAKE1 (
230
- "MaxLoadAVG " , cfg_loadavg , NULL , RSRC_CONF ,
230
+ "LimitMaxLoadAVG " , cfg_loadavg , NULL , RSRC_CONF ,
231
231
"maximum permitted load average" ),
232
232
AP_INIT_TAKE1 (
233
- "CheckLoadAvg " , cfg_checkavg , NULL , RSRC_CONF ,
233
+ "LimitCheckLoadAvg " , cfg_checkavg , NULL , RSRC_CONF ,
234
234
"maximum simultaneous connections per user" ),
235
235
#else
236
- {"MaxConnsPerIP " , cfg_perip , NULL , RSRC_CONF , TAKE1 ,
236
+ {"LimitMaxConnsPerIP " , cfg_perip , NULL , RSRC_CONF , TAKE1 ,
237
237
"maximum simultaneous connections per IP address" },
238
- {"MaxConnsPerUid " , cfg_peruid , NULL , RSRC_CONF , TAKE1 ,
238
+ {"LimitMaxConnsPerUid " , cfg_peruid , NULL , RSRC_CONF , TAKE1 ,
239
239
"maximum simultaneous connections per user" },
240
- { "MaxLoadAVG " , cfg_loadavg , NULL , RSRC_CONF , TAKE1 ,
240
+ { "LimitMaxLoadAVG " , cfg_loadavg , NULL , RSRC_CONF , TAKE1 ,
241
241
"maximum permitted load average" },
242
- { "CheckLoadAvg " , cfg_checkavg , NULL , RSRC_CONF , TAKE1 ,
242
+ { "LimitCheckLoadAvg " , cfg_checkavg , NULL , RSRC_CONF , TAKE1 ,
243
243
"maximum simultaneous connections per user" },
244
244
#endif
245
245
{NULL }
0 commit comments