--- mod_clamav.c 2004-04-29 00:48:43.000000000 +0200 +++ mod_clamav.c.oden 2005-12-14 03:09:03.000000000 +0100 @@ -17,7 +17,6 @@ #include "ap_config.h" #include "apr_strings.h" #include "apr_time.h" -#include "apr_compat.h" #include <clamav.h> #include <fcntl.h> #include <errno.h> @@ -148,7 +147,7 @@ typedef struct clamav_safeuri { char pattern[VIRUS_URI_LENGTH]; - regex_t *regex; + ap_regex_t *regex; int matchtype; } clamav_safeuri; @@ -271,9 +270,9 @@ return; /* set the individual notes */ - ap_table_set(notes, MOD_CLAMAV_STATUS_NOTE, status ? status : "-"); - ap_table_set(notes, MOD_CLAMAV_DETAILS_NOTE, details ? details : "-"); - ap_table_set(notes, MOD_CLAMAV_VIRUSNAME_NOTE, virusname ? virusname : "-"); + apr_table_set(notes, MOD_CLAMAV_STATUS_NOTE, status ? status : "-"); + apr_table_set(notes, MOD_CLAMAV_DETAILS_NOTE, details ? details : "-"); + apr_table_set(notes, MOD_CLAMAV_VIRUSNAME_NOTE, virusname ? virusname : "-"); /* build a long status message from the individual parts */ if (status) { @@ -301,7 +300,7 @@ } /* add the status to the notes table */ - ap_table_set(notes, MOD_CLAMAV_LONGSTATUS_NOTE, + apr_table_set(notes, MOD_CLAMAV_LONGSTATUS_NOTE, longstatus ? longstatus : "-"); } /* clamav_set_status_note */ @@ -381,7 +380,7 @@ goto unsafe; /* if mod_dnsbl told us something, we may have no other choice */ - action = ap_table_get(f->r->notes, "dnsbl:scan"); + action = apr_table_get(f->r->notes, "dnsbl:scan"); if (NULL != action) { clamav_ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r, "[%d] checking dnsbl:action: %s", (int)getpid(), action); @@ -964,7 +963,7 @@ ap_rputs(" <tr>\n", r); ap_rprintf(r, " <td>%d</td>\n", (int)(v->pid)); - apr_explode_localtime(&t, v->when); + apr_time_exp_lt(&t, v->when); apr_strftime(when, &ret, sizeof(when), "%d %b %Y %H:%M:%S", &t); ap_rprintf(r, " <td>%s</td>\n", when); ap_rprintf(r, " <td>%s</td>\n", v->req); @@ -1549,7 +1548,9 @@ /* every data bucket that comes in must be written to the file */ clamav_ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r, "[%d] scanning bucket brigade", (int)getpid()); - APR_BRIGADE_FOREACH(e, bb) { + for (e = APR_BRIGADE_FIRST(bb); + e != APR_BRIGADE_SENTINEL(bb); + e = APR_BUCKET_NEXT(e)) { clamav_ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r, "[%d] bucket type: %s (uri %s)", (int)getpid(), e->type->name, (NULL == f->r->uri) ? "(null)" : f->r->uri); @@ -1687,7 +1688,9 @@ } /* at this point we only have EOS buckets left */ - APR_BRIGADE_FOREACH(e, bb) { + for (e = APR_BRIGADE_FIRST(bb); + e != APR_BRIGADE_SENTINEL(bb); + e = APR_BUCKET_NEXT(e)) { /* if we have met an EOS bucket, we should trigger the virus */ /* scanning */ if (APR_BUCKET_IS_EOS(e)) { @@ -1983,7 +1986,7 @@ static const char *clamav_add_safeuri(cmd_parms *parms, void *mconfig, const char *type, const char *safeuri) { clamav_safeuri *p; - regex_t *preg; + ap_regex_t *preg; /* get the module configuration record */ clamav_config_rec *rec = (clamav_config_rec *)mconfig; @@ -2001,7 +2004,7 @@ return "Clamav unrecognized match type"; } - preg = ap_pregcomp(rec->pool, safeuri, REG_EXTENDED); + preg = ap_pregcomp(rec->pool, safeuri, AP_REG_EXTENDED); if (preg == NULL) { return "Clamav error compiling Safeuri regex pattern"; }