structure when it only needs access to csp->iob.
-const char jcc_rcs[] = "$Id: jcc.c,v 1.176 2008/05/10 11:37:57 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.177 2008/05/10 11:51:12 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.177 2008/05/10 11:51:12 fabiankeil
+ * Make the "read the rest of the headers" loop a bit more readable.
+ *
* Revision 1.176 2008/05/10 11:37:57 fabiankeil
* - Instead of logging when the IIS5 hack is enabled, log when it fails.
* - Remove useless comment.
int continue_hack_in_da_house = 0;
char * header;
- while (((header = get_header(csp)) != NULL) || continue_hack_in_da_house)
+ while (((header = get_header(csp->iob)) != NULL) || continue_hack_in_da_house)
{
if (header == NULL)
{
return;
}
- req = get_header(csp);
+ req = get_header(csp->iob);
} while ((NULL != req) && ('\0' == *req));
init_list(headers);
for (;;)
{
- p = get_header(csp);
+ p = get_header(csp->iob);
if (p == NULL)
{
-const char parsers_rcs[] = "$Id: parsers.c,v 1.125 2008/04/17 14:40:49 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.126 2008/05/03 16:40:45 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.126 2008/05/03 16:40:45 fabiankeil
+ * Change content_filters_enabled()'s parameter from
+ * csp->action to action so it can be also used in the
+ * CGI code. Don't bother checking if there are filters
+ * loaded, as that's somewhat besides the point.
+ *
* Revision 1.125 2008/04/17 14:40:49 fabiankeil
* Provide get_http_time() with the buffer size so it doesn't
* have to blindly assume that the buffer is big enough.
* Description : This (odd) routine will parse the csp->iob
*
* Parameters :
- * 1 : csp = Current client state (buffers, headers, etc...)
+ * 1 : iob = The I/O buffer to parse, usually csp->iob.
*
* Returns : Any one of the following:
*
* a complete header line.
*
*********************************************************************/
-char *get_header(struct client_state *csp)
+char *get_header(struct iob *iob)
{
- struct iob *iob;
char *p, *q, *ret;
- iob = csp->iob;
if ((iob->cur == NULL)
|| ((p = strchr(iob->cur, '\n')) == NULL))
#ifndef PARSERS_H_INCLUDED
#define PARSERS_H_INCLUDED
-#define PARSERS_H_VERSION "$Id: parsers.h,v 1.41 2008/04/16 16:38:21 fabiankeil Exp $"
+#define PARSERS_H_VERSION "$Id: parsers.h,v 1.42 2008/04/17 14:40:49 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.h,v $
*
* Revisions :
* $Log: parsers.h,v $
+ * Revision 1.42 2008/04/17 14:40:49 fabiankeil
+ * Provide get_http_time() with the buffer size so it doesn't
+ * have to blindly assume that the buffer is big enough.
+ *
* Revision 1.41 2008/04/16 16:38:21 fabiankeil
* Don't pass the whole csp structure to flush_socket()
* when it only needs a file descriptor and a buffer.
extern int flush_socket(jb_socket fd, struct iob *iob);
extern jb_err add_to_iob(struct client_state *csp, char *buf, int n);
extern jb_err decompress_iob(struct client_state *csp);
-extern char *get_header(struct client_state *csp);
+extern char *get_header(struct iob *iob);
extern char *get_header_value(const struct list *header_list, const char *header_name);
extern jb_err sed(const struct parsers pats[], const add_header_func_ptr more_headers[], struct client_state *csp);
extern void get_http_time(int time_offset, char *buf, size_t buffer_size);