-const char jcc_rcs[] = "$Id: jcc.c,v 1.62 2002/02/20 23:17:23 jongfoster Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.65 2002/03/03 14:49:11 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.65 2002/03/03 14:49:11 oes
+ * Fixed CLF logging: Now uses client's original HTTP request
+ *
+ * Revision 1.64 2002/03/03 09:18:03 joergs
+ * Made jumbjuster work on AmigaOS again.
+ *
+ * Revision 1.63 2002/03/02 04:14:50 david__schmidt
+ * Clean up a little CRLF unpleasantness that suddenly appeared
+ *
* Revision 1.62 2002/02/20 23:17:23 jongfoster
* Detecting some out-of memory conditions and exiting with a log message.
*
struct client_state clients[1];
struct file_list files[1];
-short int MustReload = 0;
-
#ifdef FEATURE_STATISTICS
int urls_read = 0; /* total nr of urls read inc rejected */
int urls_rejected = 0; /* total nr of urls rejected */
"(copyright_or_otherwise)_applying_to_any_cookie._";
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__OS2__) && !defined(AMIGA)
/*********************************************************************
*
* Function : SIG_handler
switch( signal )
{
case SIGHUP:
- MustReload = 1;
+ log_error(LOG_LEVEL_INFO, "ignoring HUP signal (%d)", signal);
break;
case SIGTERM:
log_error(LOG_LEVEL_INFO, "exiting by signal %d .. bye", signal);
}
}
+ /*
+ * Save a copy of the original request for logging
+ */
+ http->ocmd = strdup(http->cmd);
+
+ if (http->ocmd == NULL)
+ {
+ log_error(LOG_LEVEL_FATAL, "Out of memory copying HTTP request line");
+ }
+
/*
* (Re)build the HTTP request for non-SSL requests.
* If forwarding, use the whole URL, else, use only the path.
/* Log (FIXME: All intercept reasons apprear as "crunch" with Status 200) */
log_error(LOG_LEVEL_GPC, "%s%s crunch!", http->hostport, http->path);
- log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 200 3", csp->ip_addr_str, http->cmd);
+ log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 200 3", csp->ip_addr_str, http->ocmd);
/* Clean up and return */
free_http_response(rsp);
rsp = error_response(csp, "no-such-domain", errno);
log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 404 0",
- csp->ip_addr_str, http->cmd);
+ csp->ip_addr_str, http->ocmd);
}
else
{
rsp = error_response(csp, "connect-failed", errno);
log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 503 0",
- csp->ip_addr_str, http->cmd);
+ csp->ip_addr_str, http->ocmd);
}
http->hostport);
log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 503 0",
- csp->ip_addr_str, http->cmd);
+ csp->ip_addr_str, http->ocmd);
rsp = error_response(csp, "connect-failed", errno);
* client, flush the rest, and get out of the way.
*/
log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 200 2\n",
- csp->ip_addr_str, http->cmd);
+ csp->ip_addr_str, http->ocmd);
if (write_socket(csp->cfd, CSUCCEED, sizeof(CSUCCEED)-1) < 0)
{
log_error(LOG_LEVEL_ERROR, "read from: %s failed: %E", http->host);
log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 503 0",
- csp->ip_addr_str, http->cmd);
+ csp->ip_addr_str, http->ocmd);
rsp = error_response(csp, "connect-failed", errno);
}
log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 200 %d",
- csp->ip_addr_str, http->cmd, byte_count);
+ csp->ip_addr_str, http->ocmd, byte_count);
}
int argc_pos = 1;
configfile =
-#ifdef AMIGA
- "AmiTCP:db/junkbuster/config"
-#elif !defined(_WIN32)
+#if !defined(_WIN32)
"config"
#else
"config.txt"
#endif
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__OS2__) && !defined(AMIGA)
{
int sig;
struct sigaction action;