Change the code to use the new config_parse() method rather than the
flex/bison based configuration system.
This commit is contained in:
parent
9d04667848
commit
1d2e4fc2c3
@ -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,
|
* The initialize routine. Basically sets up all the initial stuff (logfile,
|
||||||
* listening socket, config options, etc.) and then sits there and loops
|
* listening socket, config options, etc.) and then sits there and loops
|
||||||
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "anonymous.h"
|
#include "anonymous.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
|
#include "conffile.h"
|
||||||
#include "daemon.h"
|
#include "daemon.h"
|
||||||
#include "heap.h"
|
#include "heap.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
@ -38,9 +39,6 @@
|
|||||||
|
|
||||||
void takesig(int sig);
|
void takesig(int sig);
|
||||||
|
|
||||||
extern int yyparse(void);
|
|
||||||
extern FILE *yyin;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global Structures
|
* Global Structures
|
||||||
*/
|
*/
|
||||||
@ -155,6 +153,7 @@ main(int argc, char **argv)
|
|||||||
unsigned int godaemon = TRUE; /* boolean */
|
unsigned int godaemon = TRUE; /* boolean */
|
||||||
struct passwd *thisuser = NULL;
|
struct passwd *thisuser = NULL;
|
||||||
struct group *thisgroup = NULL;
|
struct group *thisgroup = NULL;
|
||||||
|
FILE* config_file;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable the creation of CORE files right up front.
|
* 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.
|
* Read in the settings from the config file.
|
||||||
*/
|
*/
|
||||||
yyin = fopen(config.config_file, "r");
|
config_file = fopen(config.config_file, "r");
|
||||||
if (!yyin) {
|
if (!config_file) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s: Could not open configuration file \"%s\".\n",
|
"%s: Could not open configuration file \"%s\".\n",
|
||||||
argv[0], config.config_file);
|
argv[0], config.config_file);
|
||||||
exit(EX_SOFTWARE);
|
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 */
|
/* Open the log file if not using syslog */
|
||||||
if (config.syslog == FALSE) {
|
if (config.syslog == FALSE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user