-const char jcc_rcs[] = "$Id: jcc.c,v 1.231 2009/03/08 14:19:23 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.232 2009/03/08 19:29:16 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.232 2009/03/08 19:29:16 fabiankeil
+ * Reinitialize the timeout structure every time before passing
+ * it to select(). Apparently some implementations mess with it.
+ * Probably fixes #2669131 reported by cyberpatrol.
+ *
* Revision 1.231 2009/03/08 14:19:23 fabiankeil
* Fix justified (but harmless) compiler warnings
* on platforms where sizeof(int) < sizeof(long).
int max_forwarded_connect_retries = csp->config->forwarded_connect_retries;
const struct forward_spec *fwd;
struct http_request *http;
- int len = 0; /* for buffer sizes (and negative error codes) */
+ long len = 0; /* for buffer sizes (and negative error codes) */
/* Function that does the content filtering for the current request */
filter_function_ptr content_filter = NULL;
if (add_to_iob(csp, buf, len))
{
size_t hdrlen;
- int flushed;
+ long flushed;
log_error(LOG_LEVEL_INFO,
"Flushing header and buffers. Stepping back from filtering.");
-const char parsers_rcs[] = "$Id: parsers.c,v 1.152 2009/03/01 18:43:48 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.153 2009/03/07 13:09:17 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.153 2009/03/07 13:09:17 fabiankeil
+ * Change csp->expected_content and_csp->expected_content_length from
+ * size_t to unsigned long long to reduce the likelihood of integer
+ * overflows that would let us close the connection prematurely.
+ * Bug found while investigating #2669131, reported by cyberpatrol.
+ *
* Revision 1.152 2009/03/01 18:43:48 fabiankeil
* Help clang understand that we aren't dereferencing
* NULL pointers here.
* file, the results are not portable.
*
*********************************************************************/
-int flush_socket(jb_socket fd, struct iob *iob)
+long flush_socket(jb_socket fd, struct iob *iob)
{
- int len = iob->eod - iob->cur;
+ long len = iob->eod - iob->cur;
if (len <= 0)
{
* or buffer limit reached.
*
*********************************************************************/
-jb_err add_to_iob(struct client_state *csp, char *buf, int n)
+jb_err add_to_iob(struct client_state *csp, char *buf, long n)
{
struct iob *iob = csp->iob;
size_t used, offset, need, want;
#ifndef PARSERS_H_INCLUDED
#define PARSERS_H_INCLUDED
-#define PARSERS_H_VERSION "$Id: parsers.h,v 1.47 2008/05/21 20:12:11 fabiankeil Exp $"
+#define PARSERS_H_VERSION "$Id: parsers.h,v 1.48 2008/05/30 15:57:23 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.h,v $
*
* Revisions :
* $Log: parsers.h,v $
+ * Revision 1.48 2008/05/30 15:57:23 fabiankeil
+ * Remove now-useless reference to debug.
+ *
* Revision 1.47 2008/05/21 20:12:11 fabiankeil
* The whole point of strclean() is to modify the
* first parameter, so don't mark it immutable,
#define FILTER_CLIENT_HEADERS 0
#define FILTER_SERVER_HEADERS 1
-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 long flush_socket(jb_socket fd, struct iob *iob);
+extern jb_err add_to_iob(struct client_state *csp, char *buf, long n);
extern jb_err decompress_iob(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);