diff options
| author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2004-08-13 21:03:11 +0000 | 
|---|---|---|
| committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2004-08-13 21:03:11 +0000 | 
| commit | 1d2e4fc2c3123d9d9503f71f7e5b7468ed81be16 (patch) | |
| tree | ce86258307316f8a45c1351ce9258b17ee3f0809 /src | |
| parent | 9d0466784892c7768c68e0bd02cf76db2ab1185a (diff) | |
| download | tinyproxy-1d2e4fc2c3123d9d9503f71f7e5b7468ed81be16.tar.gz tinyproxy-1d2e4fc2c3123d9d9503f71f7e5b7468ed81be16.zip  | |
Change the code to use the new config_parse() method rather than the
flex/bison based configuration system.
Diffstat (limited to '')
| -rw-r--r-- | src/tinyproxy.c | 19 | 
1 files changed, 12 insertions, 7 deletions
diff --git a/src/tinyproxy.c b/src/tinyproxy.c index 578a10a..8c57a32 100644 --- a/src/tinyproxy.c +++ b/src/tinyproxy.c @@ -1,4 +1,4 @@ -/* $Id: tinyproxy.c,v 1.47 2004-01-26 19:11:51 rjkaes Exp $ +/* $Id: tinyproxy.c,v 1.48 2004-08-13 21:03:11 rjkaes Exp $   *   * The initialize routine. Basically sets up all the initial stuff (logfile,   * listening socket, config options, etc.) and then sits there and loops @@ -26,6 +26,7 @@  #include "anonymous.h"  #include "buffer.h" +#include "conffile.h"  #include "daemon.h"  #include "heap.h"  #include "filter.h" @@ -38,9 +39,6 @@  void takesig(int sig); -extern int yyparse(void); -extern FILE *yyin; -  /*    * Global Structures   */ @@ -155,6 +153,7 @@ main(int argc, char **argv)  	unsigned int godaemon = TRUE; /* boolean */  	struct passwd *thisuser = NULL;  	struct group *thisgroup = NULL; +        FILE* config_file;  	/*  	 * Disable the creation of CORE files right up front. @@ -212,14 +211,20 @@ main(int argc, char **argv)  	/*  	 * Read in the settings from the config file.  	 */ -	yyin = fopen(config.config_file, "r"); -	if (!yyin) { +        config_file = fopen(config.config_file, "r"); +        if (!config_file) {  		fprintf(stderr,  			"%s: Could not open configuration file \"%s\".\n",  			argv[0], config.config_file);  		exit(EX_SOFTWARE);  	} -	yyparse(); +        config_compile(); +        if (config_parse(&config, config_file) != 0) { +                fprintf(stderr, +                        "Unable to parse configuration file.  Not starting.\n"); +                exit(EX_SOFTWARE); +        } +        fclose(config_file);  	/* Open the log file if not using syslog */  	if (config.syslog == FALSE) {  | 
