/*
- * $Id: client_side.cc,v 1.190 1998/01/05 19:53:29 wessels Exp $
+ * $Id: client_side.cc,v 1.191 1998/01/06 05:12:07 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
static int CheckQuickAbort2(const clientHttpRequest *);
static int clientCheckTransferDone(clientHttpRequest *);
static void CheckQuickAbort(clientHttpRequest *);
-#if CHECK_FAILURE_IS_BROKE
-static void checkFailureRatio(log_type, hier_code);
-#endif
+static void checkFailureRatio(err_type, hier_code);
static void clientProcessMiss(clientHttpRequest *);
static void clientAppendReplyHeader(char *, const char *, size_t *, size_t);
size_t clientBuildReplyHeader(clientHttpRequest *, char *, size_t *, char *, size_t);
redirectUnregister(http->uri, http);
if (http->acl_checklist)
aclChecklistFree(http->acl_checklist);
-#if CHECK_FAILURE_IS_BROKE
- checkFailureRatio(http->log_type, http->al.hier.code);
-#endif
+ if (request)
+ checkFailureRatio(request->err_type, http->al.hier.code);
safe_free(http->uri);
safe_free(http->log_uri);
safe_free(http->al.headers.reply);
* Duane W., Sept 16, 1996
*/
-#if CHECK_FAILURE_IS_BROKE
static void
-checkFailureRatio(log_type rcode, hier_code hcode)
+checkFailureRatio(err_type etype, hier_code hcode)
{
- static double fail_ratio = 0.0;
- static double magic_factor = 100;
+ static double magic_factor = 100.0;
double n_good;
double n_bad;
if (hcode == HIER_NONE)
return;
- n_good = magic_factor / (1.0 + fail_ratio);
+ n_good = magic_factor / (1.0 + request_failure_ratio);
n_bad = magic_factor - n_good;
- switch (rcode) {
+ switch (etype) {
case ERR_DNS_FAIL:
case ERR_CONNECT_FAIL:
case ERR_READ_ERROR:
default:
n_good++;
}
- fail_ratio = n_bad / n_good;
+ request_failure_ratio = n_bad / n_good;
if (hit_only_mode_until > squid_curtime)
return;
- if (fail_ratio < 1.0)
+ if (request_failure_ratio < 1.0)
return;
- debug(12, 0) ("Failure Ratio at %4.2f\n", fail_ratio);
+ debug(12, 0) ("Failure Ratio at %4.2f\n", request_failure_ratio);
debug(12, 0) ("Going into hit-only-mode for %d minutes...\n",
FAILURE_MODE_TIME / 60);
hit_only_mode_until = squid_curtime + FAILURE_MODE_TIME;
- fail_ratio = 0.8; /* reset to something less than 1.0 */
+ request_failure_ratio = 0.8; /* reset to something less than 1.0 */
}
-#endif
void
clientHttpConnectionsOpen(void)
/*
- * $Id: errorpage.cc,v 1.113 1997/12/27 18:15:05 kostas Exp $
+ * $Id: errorpage.cc,v 1.114 1998/01/06 05:12:08 wessels Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
int len;
debug(4, 3) ("errorSend: FD %d, err=%p\n", fd, err);
assert(fd >= 0);
+ /*
+ * ugh, this is how we make sure error codes get back to
+ * the client side for logging and error tracking.
+ */
+ if (err->request)
+ err->request->err_type = err->type;
buf = errorBuildBuf(err, &len);
EBIT_SET(err->flags, ERR_FLAG_CBDATA);
cbdataAdd(err);
/*
- * $Id: stat.cc,v 1.181 1998/01/05 05:14:16 wessels Exp $
+ * $Id: stat.cc,v 1.182 1998/01/06 05:12:10 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
Counter.icp.pkts_recv);
storeAppendPrintf(sentry, "{\tNumber of ICP messages sent:\t%u}\n",
Counter.icp.pkts_sent);
+ storeAppendPrintf(sentry, "{\tRequest failure ratio:\t%5.2f%%\n",
+ request_failure_ratio);
storeAppendPrintf(sentry, "{\tHTTP requests per minute:\t%.1f}\n",
Counter.client_http.requests / (runtime / 60.0));