Subversion Repositories Tewi

Rev

Rev 127 | Rev 138 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 127 Rev 128
Line 1... Line 1...
1
/* $Id: config.c 127 2024-09-23 09:39:28Z nishi $ */
1
/* $Id: config.c 128 2024-09-23 10:19:19Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "tw_config.h"
5
#include "tw_config.h"
6
#include "tw_module.h"
6
#include "tw_module.h"
Line 87... Line 87...
87
	config.root.hideport = 0;
87
	config.root.hideport = 0;
88
	config.vhost_count = 0;
88
	config.vhost_count = 0;
89
	config.module_count = 0;
89
	config.module_count = 0;
90
	config.extension = NULL;
90
	config.extension = NULL;
91
	config.server_root = cm_strdup(PREFIX);
91
	config.server_root = cm_strdup(PREFIX);
-
 
92
	config.server_admin = cm_strdup(SERVER_ADMIN);
92
	gethostname(config.hostname, 1024);
93
	gethostname(config.hostname, 1024);
-
 
94
	chdir(config.server_root);
93
}
95
}
94
 
96
 
95
int tw_config_read(const char* path) {
97
int tw_config_read(const char* path) {
96
	cm_log("Config", "Reading %s", path);
98
	cm_log("Config", "Reading %s", path);
97
	char cbuf[2];
99
	char cbuf[2];
Line 245... Line 247...
245
						} else {
247
						} else {
246
							chdir(r[1]);
248
							chdir(r[1]);
247
							free(config.server_root);
249
							free(config.server_root);
248
							config.server_root = cm_strdup(r[1]);
250
							config.server_root = cm_strdup(r[1]);
249
						}
251
						}
-
 
252
					} else if(cm_strcaseequ(r[0], "ServerAdmin")) {
-
 
253
						if(r[1] == NULL) {
-
 
254
							cm_log("Config", "Missing email at line %d", ln);
-
 
255
							stop = 1;
-
 
256
						} else {
-
 
257
							free(config.server_admin);
-
 
258
							config.server_admin = cm_strdup(r[1]);
-
 
259
						}
250
					} else if(cm_strcaseequ(r[0], "DocumentRoot")) {
260
					} else if(cm_strcaseequ(r[0], "DocumentRoot")) {
251
						if(r[1] == NULL) {
261
						if(r[1] == NULL) {
252
							cm_log("Config", "Missing path at line %d", ln);
262
							cm_log("Config", "Missing path at line %d", ln);
253
							stop = 1;
263
							stop = 1;
254
						} else {
264
						} else {