-const char filters_rcs[] = "$Id: filters.c,v 1.73 2006/12/23 16:01:02 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.74 2006/12/24 17:37:38 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
*
* Revisions :
* $Log: filters.c,v $
+ * Revision 1.74 2006/12/24 17:37:38 fabiankeil
+ * Adjust comment in pcrs_filter_response()
+ * to recent pcrs changes. Hohoho.
+ *
* Revision 1.73 2006/12/23 16:01:02 fabiankeil
* Don't crash if pcre returns an error code
* that pcrs didn't expect. Fixes BR 1621173.
p = strdup("");
for (tl = csp->config->trust_list; (t = *tl) != NULL ; tl++)
{
- sprintf(buf, "<li>%s</li>\n", t->spec);
+ snprintf(buf, sizeof(buf), "<li>%s</li>\n", t->spec);
string_append(&p, buf);
}
err = map(exports, "trusted-referrers", 1, p, 0);
p = strdup("");
for (l = csp->config->trust_info->first; l ; l = l->next)
{
- sprintf(buf, "<li> <a href=\"%s\">%s</a><br>\n",l->str, l->str);
+ snprintf(buf, sizeof(buf), "<li> <a href=\"%s\">%s</a><br>\n", l->str, l->str);
string_append(&p, buf);
}
err = map(exports, "trust-info", 1, p, 0);
{
return(NULL);
}
- size = csp->iob->eod - csp->iob->cur;
+ size = (size_t)(csp->iob->eod - csp->iob->cur);
/*
* Need to check the set of re_filterfiles...
{
struct binbuffer *in, *out;
char *p;
- size_t size = csp->iob->eod - csp->iob->cur;
+ size_t size;
+
+ size = (size_t)(csp->iob->eod - csp->iob->cur);
/*
* If the body has a "chunked" transfer-encoding,
*********************************************************************/
char *jpeg_inspect_response(struct client_state *csp)
{
- struct binbuffer *in = NULL, *out = NULL;
+ struct binbuffer *in = NULL;
+ struct binbuffer *out = NULL;
char *p = NULL;
- size_t size = csp->iob->eod - csp->iob->cur;
+ size_t size;
+
+ size = (size_t)(csp->iob->eod - csp->iob->cur);
/*
* If the body has a "chunked" transfer-encoding,
* went wrong
*
*********************************************************************/
-int remove_chunked_transfer_coding(char *buffer, const size_t size)
+size_t remove_chunked_transfer_coding(char *buffer, const size_t size)
{
size_t newsize = 0;
unsigned int chunksize = 0;
#ifndef FILTERS_H_INCLUDED
#define FILTERS_H_INCLUDED
-#define FILTERS_H_VERSION "$Id: filters.h,v 1.22 2006/07/18 14:48:46 david__schmidt Exp $"
+#define FILTERS_H_VERSION "$Id: filters.h,v 1.23 2006/11/28 15:19:43 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.h,v $
*
* Revisions :
* $Log: filters.h,v $
+ * Revision 1.23 2006/11/28 15:19:43 fabiankeil
+ * Implemented +redirect{s@foo@bar@} to generate
+ * a redirect based on a rewritten version of the
+ * original URL.
+ *
* Revision 1.22 2006/07/18 14:48:46 david__schmidt
* Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
* with what was really the latest development (the v_3_0_branch branch)
extern char *pcrs_filter_response(struct client_state *csp);
extern char *gif_deanimate_response(struct client_state *csp);
extern char *jpeg_inspect_response(struct client_state *csp);
-extern int remove_chunked_transfer_coding(char *buffer, const size_t size);
+extern size_t remove_chunked_transfer_coding(char *buffer, const size_t size);
extern char *execute_single_pcrs_command(char *subject, const char *pcrs_command, int *hits);
extern char *rewrite_url(char *old_url, const char *pcrs_command);
extern char *get_last_url(char *subject, const char *redirect_mode);