Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > e232714dcf8c855f3f0ee1ae8326d035 > files > 5

apache-mod_dnsbl-0.10-3mdv2008.0.src.rpm

--- mod_dnsbl.c	2004-03-19 01:49:13.000000000 +0100
+++ mod_dnsbl.c.oden	2007-01-02 18:06:52.000000000 +0100
@@ -25,7 +25,6 @@
 #ifdef AP_SERVER_MAJORVERSION
 /* Apache 2 specific stuff */
 #define APLOG_STATUS    0,
-#include <apr_compat.h>
 #include <apr_strings.h>
 #include <apr_base64.h>
 #include <apr_hooks.h>
@@ -34,7 +33,6 @@
 #define apr_pool_t	pool
 #define apr_table_t	table
 #define apr_cpystrn	strncpy
-#define apr_pcalloc	ap_pcalloc
 #define	apr_array_header_t	array_header
 #define APLOG_STATUS
 #define AP_INIT_FLAG(directive, function, what, where, comment)         \
@@ -425,7 +423,7 @@
 	}
 
 	/* look up the address in the rule tables			*/
-	action = ap_table_get(rec->actions, addr);
+	action = apr_table_get(rec->actions, addr);
 	ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APLOG_STATUS r,
 	    "[%d] %s has class ip %s, action = %s", (int)getpid(), name,
 	    addr, (action) ? action : "not found");
@@ -435,16 +433,16 @@
 	     continue;
 
 	/* legal actions so far ar block and pass			*/
-	ap_table_set(r->notes, "dnsbl:action", action);
+	apr_table_set(r->notes, "dnsbl:action", action);
 	if (dnsbl_check_actionstring(r, action, "noscan")) {
-	    ap_table_set(r->notes, "dnsbl:scan", "no");
+	    apr_table_set(r->notes, "dnsbl:scan", "no");
 	}
 	if (dnsbl_check_actionstring(r, action, "scan")) {
-	    ap_table_set(r->notes, "dnsbl:scan", "yes");
+	    apr_table_set(r->notes, "dnsbl:scan", "yes");
 	}
 	if (dnsbl_check_actionstring(r, action, "block")) {
 		/* output reason page */
-		reason = ap_table_get(rec->reasons, addr);
+		reason = apr_table_get(rec->reasons, addr);
 		dnsbl_handler(r, (reason) ? reason : addr);
 		rc = HTTP_FORBIDDEN;
 		goto cleanup;
@@ -454,7 +452,7 @@
 		goto cleanup;
 	}
 	if (dnsbl_check_actionstring(r, action, "skipauth")) {
-		ap_table_set(r->notes, "dnsbl:skipauth", "yes");
+		apr_table_set(r->notes, "dnsbl:skipauth", "yes");
 		rc = OK;	/* skip authentication */
 		goto cleanup;
 	}
@@ -553,7 +551,7 @@
     rec = dnsbl_getconfig(r);
     if (!rec->authoritative)
 	return DECLINED;
-    action = ap_table_get(r->notes, "dnsbl:skipauth");
+    action = apr_table_get(r->notes, "dnsbl:skipauth");
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APLOG_STATUS r,
 	"[%d] found action %s", (int)getpid(), action);
     if (NULL == action)
@@ -580,9 +578,9 @@
 	    "no actions table");
 	return "no actions table for configuration";
     }
-    ap_table_set(rec->actions, address, action);
+    apr_table_set(rec->actions, address, action);
     if (reason)
-	ap_table_set(rec->reasons, address, reason);
+	apr_table_set(rec->reasons, address, reason);
     return NULL;
 }
 
@@ -611,7 +609,7 @@
 	parms->server->module_config, &dnsbl_module);
     ap_log_error(APLOG_MARK, APLOG_DEBUG, APLOG_STATUS 0,
 	"setting template to %s", value);
-    rec->template = ap_pstrdup(parms->pool, value);
+    rec->template = apr_pstrdup(parms->pool, value);
     if (stat(rec->template, &sb) < 0) {
 	ap_log_error(APLOG_MARK, APLOG_ERR, APLOG_STATUS 0,
 	    "template file %s not found", rec->template);
@@ -626,7 +624,7 @@
 	parms->server->module_config, &dnsbl_module);
     ap_log_error(APLOG_MARK, APLOG_DEBUG, APLOG_STATUS 0,
 	"setting contact address to %s", value);
-    rec->contact = ap_pstrdup(parms->pool, value);
+    rec->contact = apr_pstrdup(parms->pool, value);
     return NULL;
 }
 
@@ -637,8 +635,8 @@
     char	**newsuffix;
     ap_log_error(APLOG_MARK, APLOG_DEBUG, APLOG_STATUS 0,
 	"adding suffix %s", value);
-    newsuffix = (char **)ap_push_array(rec->suffix);
-    *newsuffix = ap_pstrdup(parms->pool, value);
+    newsuffix = (char **)apr_array_push(rec->suffix);
+    *newsuffix = apr_pstrdup(parms->pool, value);
     return NULL;
 }
 
@@ -719,9 +717,9 @@
 					sizeof(dnsbl_config_rec));
     cfg->template = NULL;
     cfg->contact = "root@localhost";
-    cfg->actions = ap_make_table(p, 0);
-    cfg->reasons = ap_make_table(p, 0);
-    cfg->suffix = ap_make_array(p, 3, sizeof(char *));
+    cfg->actions = apr_table_make(p, 0);
+    cfg->reasons = apr_table_make(p, 0);
+    cfg->suffix = apr_array_make(p, 3, sizeof(char *));
     cfg->defaultaction = DNSBL_PASS;
     cfg->authoritative = 0;
     cfg->recurse = 0;
@@ -732,7 +730,7 @@
 static void	*dnsbl_merge_server_config(apr_pool_t *p, void *pp, void *cp) {
     dnsbl_config_rec	*parent = (dnsbl_config_rec *)pp;
     dnsbl_config_rec	*child = (dnsbl_config_rec *)cp;
-    dnsbl_config_rec	*merged = (dnsbl_config_rec *)ap_pcalloc(p,
+    dnsbl_config_rec	*merged = (dnsbl_config_rec *)apr_pcalloc(p,
 					sizeof(dnsbl_config_rec));
     /* merge string valued fields */
     merged->template = (child->template) ? child->template : parent->template;
@@ -741,8 +739,8 @@
     merged->contact = (child->contact) ? child->contact : parent->contact;
 
     /* merge the parent table with the child table */
-    merged->actions = ap_overlay_tables(p, parent->actions, child->actions);
-    merged->reasons = ap_overlay_tables(p, parent->reasons, child->reasons);
+    merged->actions = apr_table_overlay(p, parent->actions, child->actions);
+    merged->reasons = apr_table_overlay(p, parent->reasons, child->reasons);
     return merged;
 }