Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:bajizs_cnt
apache2-mod_cband
cband-ap24.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File cband-ap24.patch of Package apache2-mod_cband
--- mod-cband-0.9.7.5.orig/src/mod_cband.c +++ mod-cband-0.9.7.5/src/mod_cband.c @@ -1323,6 +1323,11 @@ int mod_cband_get_dst(request_rec *r) patricia_node_t *node; prefix_t p; char *leaf; +#if AP_MODULE_MAGIC_AT_LEAST(20111130, 0) + char *ip = r->useragent_ip; +#else + char *ip = r->connection->remote_ip; +#endif if (config->tree == NULL) return -1; @@ -1330,7 +1335,8 @@ int mod_cband_get_dst(request_rec *r) p.bitlen = 32; p.ref_count = 0; p.family = AF_INET; - p.add.sin.s_addr = inet_addr(r->connection->remote_ip); + p.add.sin.s_addr = inet_addr(ip); + p.add.sin.s_addr = inet_addr(ip); node = patricia_search_best(config->tree, &p); @@ -1339,7 +1345,7 @@ int mod_cband_get_dst(request_rec *r) if (leaf) { #ifdef DEBUG - fprintf(stderr,"%s leaf %s\n",r->connection->remote_ip,leaf); + fprintf(stderr,"%s leaf %s\n", ip,leaf); fflush(stderr); #endif return atoi(leaf); @@ -1358,11 +1364,17 @@ int mod_cband_get_remote_host(struct con if (entry == NULL) return -1; - - if (c->remote_ip != NULL) - addr = inet_addr(c->remote_ip); +#if AP_MODULE_MAGIC_AT_LEAST(20111130, 0) + if(c->client_ip != NULL) addr = inet_addr(c->client_ip); +#else + if (c->remote_ip != NULL) addr = inet_addr(c->remote_ip); +#endif else +#if AP_MODULE_MAGIC_AT_LEAST(20111130, 0) + addr = c->client_addr->sa.sin.sin_addr.s_addr; +#else addr = c->remote_addr->sa.sin.sin_addr.s_addr; +#endif time_now = apr_time_now(); hosts = config->remote_hosts.hosts; @@ -3703,7 +3715,11 @@ static void *mod_cband_create_config(apr return (void *)config; } +#ifdef AP_DECLARE_MODULE +AP_DECLARE_MODULE(cband) = +#else module AP_MODULE_DECLARE_DATA cband_module = +#endif { STANDARD20_MODULE_STUFF, NULL,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor