It lets Privoxy exit after checking whether or not the
configuration seems valid. The limitations noted in
TODO #22 and #23 still apply.
Logging the problem to the logfile if one is configured
and --no-daemon isn't used could be considered non-intuitive
and might also clobber messages emitted by an already running
instance.
Based on a patch by Ramkumar Chinchani.
-const char jcc_rcs[] = "$Id: jcc.c,v 1.411 2012/10/29 12:00:50 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.412 2012/10/29 12:04:42 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
static void usage(const char *myname)
{
printf("Privoxy version " VERSION " (" HOME_PAGE_URL ")\n"
static void usage(const char *myname)
{
printf("Privoxy version " VERSION " (" HOME_PAGE_URL ")\n"
+ "Usage: %s [--config-test] "
#if defined(unix)
"[--chroot] "
#endif /* defined(unix) */
#if defined(unix)
"[--chroot] "
#endif /* defined(unix) */
#endif
{
int argc_pos = 0;
#endif
{
int argc_pos = 0;
+ int do_config_test = 0;
unsigned int random_seed;
#ifdef unix
struct passwd *pw = NULL;
unsigned int random_seed;
#ifdef unix
struct passwd *pw = NULL;
}
#endif /* defined(unix) */
}
#endif /* defined(unix) */
+ else if (strcmp(argv[argc_pos], "--config-test") == 0)
+ {
+ do_config_test = 1;
+ }
+
else if (argc_pos + 1 != argc)
{
/*
else if (argc_pos + 1 != argc)
{
/*
# endif /* def _WIN_CONSOLE */
#endif /* def _WIN32 */
# endif /* def _WIN_CONSOLE */
#endif /* def _WIN32 */
+ if (do_config_test) {
+ exit(NULL == load_config());
+ }
/* Initialize the CGI subsystem */
cgi_init_error_messages();
/* Initialize the CGI subsystem */
cgi_init_error_messages();