/*
- * $Id: cache_cf.cc,v 1.271 1998/04/08 05:44:11 wessels Exp $
+ * $Id: cache_cf.cc,v 1.272 1998/04/08 21:38:35 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
t->pattern = (char *) xstrdup(pattern);
t->compiled_pattern = comp;
t->min = min;
- t->pct = pct;
+ t->pct = pct * QUICK_ABORT_100PCT / 100;
t->max = max;
t->next = NULL;
while (*head)
/*
- * $Id: client_side.cc,v 1.263 1998/04/08 19:28:47 wessels Exp $
+ * $Id: client_side.cc,v 1.264 1998/04/08 21:38:36 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
static int
CheckQuickAbort2(const clientHttpRequest * http)
{
- long curlen;
- long minlen;
- long expectlen;
+ int curlen;
+ int minlen;
+ int expectlen;
if (!EBIT_TEST(http->request->flags, REQ_CACHABLE))
return 1;
if (http->entry->mem_obj == NULL)
return 1;
expectlen = http->entry->mem_obj->reply->content_length;
- curlen = http->entry->mem_obj->inmem_hi;
- minlen = Config.quickAbort.min;
+ curlen = (int) http->entry->mem_obj->inmem_hi;
+ minlen = (int) Config.quickAbort.min;
if (minlen < 0)
/* disabled */
return 0;
if ((expectlen - curlen) > Config.quickAbort.max)
/* too much left to go */
return 1;
- if ((curlen / (expectlen / 128U)) > Config.quickAbort.pct)
+ if (expectlen < 128)
+ /* avoid FPE */
+ return 0;
+ if ((curlen / (expectlen / QUICK_ABORT_100PCT)) > Config.quickAbort.pct)
/* past point of no return */
return 0;
return 1;
#define PINGER_PAYLOAD_SZ 8192
+#define QUICK_ABORT_100PCT 128
+
#define COUNT_INTERVAL 60
/*
* keep 60 minutes' worth of per-minute readings (+ current reading)