-const char jcc_rcs[] = "$Id: jcc.c,v 1.133 2007/05/04 11:23:19 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.134 2007/05/16 14:59:46 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.134 2007/05/16 14:59:46 fabiankeil
+ * - Fix config file loading on Unix if no config file is specified.
+ * Since r1.97 Privoxy would always interpret the last argument as
+ * config file, even if it's a valid command line option.
+ * - Abort in case of unrecognized command line options. Closes #1719696.
+ * - Remove a bunch of unnecessary strcpy() calls (yay for c&p without thinking).
+ * - Replace the remaining strcpy() and strcat() calls with strlcpy() and strcat().
+ *
* Revision 1.133 2007/05/04 11:23:19 fabiankeil
* - Don't rerun crunchers that only depend on the request URL.
* - Don't count redirects and CGI requests as "blocked requests".
for (;;)
{
- len = read_socket(csp->cfd, buf, sizeof(buf)-1);
+ len = read_socket(csp->cfd, buf, sizeof(buf) - 1);
if (len <= 0) break; /* error! */
{
if ( ( ( p = get_header(csp) ) != NULL) && ( *p == '\0' ) )
{
- len = read_socket(csp->cfd, buf, sizeof(buf));
+ len = read_socket(csp->cfd, buf, sizeof(buf) - 1);
if (len <= 0)
{
log_error(LOG_LEVEL_ERROR, "read from client failed: %E");
/* Write the answer to the client */
- if(rsp != NULL)
+ if (rsp != NULL)
{
send_crunch_response(csp, rsp);
}
if (FD_ISSET(csp->cfd, &rfds))
{
- len = read_socket(csp->cfd, buf, sizeof(buf));
+ len = read_socket(csp->cfd, buf, sizeof(buf) - 1);
if (len <= 0)
{
void usage(const char *myname)
{
printf("Privoxy version " VERSION " (" HOME_PAGE_URL ")\n"
- "Usage: %s [--help] [--version] "
+ "Usage: %s "
+#if defined(unix)
+ "[--chroot] "
+#endif /* defined(unix) */
+ "[--help] "
#if defined(unix)
"[--no-daemon] [--pidfile pidfile] [--user user[.group]] "
#endif /* defined(unix) */
- "[configfile]\n"
+ "[--version] [configfile]\n"
"Aborting\n", myname);
exit(2);