packages: lighttpd/lighttpd-mod_evasive-status_code.patch - against svn r2504
glen
glen at pld-linux.org
Tue May 12 01:24:52 CEST 2009
Author: glen Date: Mon May 11 23:24:52 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- against svn r2504
---- Files affected:
packages/lighttpd:
lighttpd-mod_evasive-status_code.patch (1.3 -> 1.4)
---- Diffs:
================================================================
Index: packages/lighttpd/lighttpd-mod_evasive-status_code.patch
diff -u packages/lighttpd/lighttpd-mod_evasive-status_code.patch:1.3 packages/lighttpd/lighttpd-mod_evasive-status_code.patch:1.4
--- packages/lighttpd/lighttpd-mod_evasive-status_code.patch:1.3 Fri Sep 19 17:03:44 2008
+++ packages/lighttpd/lighttpd-mod_evasive-status_code.patch Tue May 12 01:24:47 2009
@@ -1,9 +1,9 @@
---- lighttpd-1.4.19/src/mod_evasive.c~ 2008-09-19 17:46:59.000000000 +0300
-+++ lighttpd-1.4.19/src/mod_evasive.c 2008-09-19 17:50:24.307245276 +0300
-@@ -27,11 +27,15 @@
-
+--- lighttpd-1.4.19/src/mod_evasive.c 2008-09-19 17:50:24.307245276 +0300
++++ lighttpd-1.4.22/src/mod_evasive.c 2009-05-12 02:21:58.524447939 +0300
+@@ -28,11 +28,15 @@
typedef struct {
unsigned short max_conns;
+ unsigned short silent;
+ unsigned short http_status_code;
+ unsigned int retry_after;
} plugin_config;
@@ -16,7 +16,7 @@
plugin_config **config_storage;
plugin_config conf;
-@@ -42,6 +46,10 @@
+@@ -46,6 +50,10 @@
p = calloc(1, sizeof(*p));
@@ -27,7 +27,7 @@
return p;
}
-@@ -52,6 +60,8 @@
+@@ -56,6 +64,8 @@
if (!p) return HANDLER_GO_ON;
@@ -36,43 +36,49 @@
if (p->config_storage) {
size_t i;
for (i = 0; i < srv->config_context->used; i++) {
-@@ -73,6 +83,8 @@
-
- config_values_t cv[] = {
- { "evasive.max-conns-per-ip", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
-+ { "evasive.http-status-code", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
-+ { "evasive.retry-after", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
+@@ -73,8 +83,10 @@
+ size_t i = 0;
+
+ config_values_t cv[] = {
+- { "evasive.max-conns-per-ip", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
+- { "evasive.silent", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
++ { "evasive.max-conns-per-ip", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
++ { "evasive.silent", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
++ { "evasive.http-status-code", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
++ { "evasive.retry-after", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-
-@@ -84,9 +94,13 @@
+
+@@ -84,10 +96,14 @@
plugin_config *s;
s = calloc(1, sizeof(plugin_config));
- s->max_conns = 0;
+- s->silent = 0;
+ s->max_conns = 0;
++ s->silent = 0;
+ s->http_status_code = 503;
+ s->retry_after = 0;
cv[0].destination = &(s->max_conns);
-+ cv[1].destination = &(s->http_status_code);
-+ cv[2].destination = &(s->retry_after);
++ cv[2].destination = &(s->http_status_code);
++ cv[3].destination = &(s->retry_after);
p->config_storage[i] = s;
-@@ -105,6 +119,8 @@
- plugin_config *s = p->config_storage[0];
+@@ -107,6 +123,8 @@
PATCH(max_conns);
+ PATCH(silent);
+ PATCH(http_status_code);
+ PATCH(retry_after);
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
-@@ -118,6 +136,10 @@
-
- if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.max-conns-per-ip"))) {
+@@ -124,6 +142,10 @@
PATCH(max_conns);
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.silent"))) {
+ PATCH(silent);
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.http-status-code"))) {
+ PATCH(http_status_code);
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.retry-after"))) {
@@ -80,7 +86,7 @@
}
}
}
-@@ -198,8 +198,10 @@
+@@ -192,8 +214,10 @@
inet_ntop_cache_get_ip(srv, &(con->dst_addr)),
"turned away. Too many connections.");
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/lighttpd/lighttpd-mod_evasive-status_code.patch?r1=1.3&r2=1.4&f=u
More information about the pld-cvs-commit
mailing list