- added mod_evasive to the autoconf build

- ignore connections from the count which are not yet initialized


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@919 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.11
Jan Kneschke 2006-01-04 23:30:07 +00:00
parent 8a010e16fb
commit 78fe973055
2 changed files with 11 additions and 1 deletions

View File

@ -68,6 +68,12 @@ src += $(common_src)
common_libadd =
endif
lib_LTLIBRARIES += mod_evasive.la
mod_evasive_la_SOURCES = mod_evasive.c
mod_evasive_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_evasive_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_webdav.la
mod_webdav_la_SOURCES = mod_webdav.c
mod_webdav_la_CFLAGS = $(XML_CFLAGS)

View File

@ -141,7 +141,11 @@ URIHANDLER_FUNC(mod_evasive_uri_handler) {
for (j = 0; j < srv->conns->used; j++) {
connection *c = srv->conns->ptr[j];
if (c->dst_addr.ipv4.sin_addr.s_addr == con->dst_addr.ipv4.sin_addr.s_addr) {
/* check if other connections are already actively serving data for the same IP
* we can only ban connections which are already behind the 'read request' state
* */
if (c->dst_addr.ipv4.sin_addr.s_addr == con->dst_addr.ipv4.sin_addr.s_addr &&
c->state > CON_STATE_REQUEST_END) {
conns_by_ip++;
if (conns_by_ip > p->conf.max_conns) {