From 75ac7b1cb0f8608b9ea6124ea2bd2ba7eb16a7ec Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 14 Sep 2010 07:13:10 +0000 Subject: [PATCH] Rename execute_content_filter() to execute_content_filters() and remove the second argument. --- filters.c | 13 +++++++++---- filters.h | 4 ++-- jcc.c | 6 +++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/filters.c b/filters.c index ed5a3736..7c5632a6 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.129 2010/05/01 18:20:50 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.130 2010/05/24 11:38:22 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -1947,20 +1947,23 @@ static jb_err prepare_for_filtering(struct client_state *csp) /********************************************************************* * - * Function : execute_content_filter + * Function : execute_content_filters * * Description : Executes a given content filter. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) - * 2 : content_filter = The filter function to execute * * Returns : Pointer to the modified buffer, or * NULL if filtering failed or wasn't necessary. * *********************************************************************/ -char *execute_content_filter(struct client_state *csp, filter_function_ptr content_filter) +char *execute_content_filters(struct client_state *csp) { + filter_function_ptr content_filter; + + assert(content_filters_enabled(csp->action)); + if (0 == csp->iob->eod - csp->iob->cur) { /* @@ -1986,6 +1989,8 @@ char *execute_content_filter(struct client_state *csp, filter_function_ptr conte return NULL; } + content_filter = get_filter_function(csp); + return ((*content_filter)(csp)); } diff --git a/filters.h b/filters.h index b9763958..2faa2272 100644 --- a/filters.h +++ b/filters.h @@ -1,6 +1,6 @@ #ifndef FILTERS_H_INCLUDED #define FILTERS_H_INCLUDED -#define FILTERS_H_VERSION "$Id: filters.h,v 1.37 2009/05/16 13:27:20 fabiankeil Exp $" +#define FILTERS_H_VERSION "$Id: filters.h,v 1.38 2010/05/01 18:20:50 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.h,v $ @@ -103,7 +103,7 @@ extern const struct forward_spec *forward_url(struct client_state *csp, */ typedef char *(*filter_function_ptr)(); -extern char *execute_content_filter(struct client_state *csp, filter_function_ptr content_filter); +extern char *execute_content_filters(struct client_state *csp); extern filter_function_ptr get_filter_function(struct client_state *csp); extern char *execute_single_pcrs_command(char *subject, const char *pcrs_command, int *hits); diff --git a/jcc.c b/jcc.c index d6a41ae5..b01736d0 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.326 2010/07/29 14:32:08 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.327 2010/09/03 17:40:37 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -2051,9 +2051,9 @@ static void chat(struct client_state *csp) */ if (content_filter) { - p = execute_content_filter(csp, content_filter); + p = execute_content_filters(csp); /* - * If the content filter fails, use the original + * If content filtering fails, use the original * buffer and length. * (see p != NULL ? p : csp->iob->cur below) */ -- 2.39.2