Subversion Repositories Tewi

Rev

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

Rev 18 Rev 19
Line 1... Line 1...
1
/* $Id: config.c 18 2024-09-14 00:42:40Z nishi $ */
1
/* $Id: config.c 19 2024-09-14 00:51:41Z 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 32... Line 32...
32
		config.ports[i] = -1;
32
		config.ports[i] = -1;
33
	}
33
	}
34
	for(i = 0; i < MAX_VHOSTS; i++) {
34
	for(i = 0; i < MAX_VHOSTS; i++) {
35
		config.vhosts[i].sslkey = NULL;
35
		config.vhosts[i].sslkey = NULL;
36
		config.vhosts[i].sslcert = NULL;
36
		config.vhosts[i].sslcert = NULL;
-
 
37
		config.vhosts[i].root = NULL;
37
	}
38
	}
38
	config.root.sslkey = NULL;
39
	config.root.sslkey = NULL;
39
	config.root.sslcert = NULL;
40
	config.root.sslcert = NULL;
-
 
41
	config.root.root = NULL;
40
	config.vhost_count = 0;
42
	config.vhost_count = 0;
41
	config.module_count = 0;
43
	config.module_count = 0;
42
	config.extension = NULL;
44
	config.extension = NULL;
43
	config.server_root = cm_strdup(PREFIX);
45
	config.server_root = cm_strdup(PREFIX);
44
	gethostname(config.hostname, 1024);
46
	gethostname(config.hostname, 1024);
Line 127... Line 129...
127
							stop = 1;
129
							stop = 1;
128
						} else {
130
						} else {
129
							if(current->sslcert != NULL) free(current->sslcert);
131
							if(current->sslcert != NULL) free(current->sslcert);
130
							current->sslcert = cm_strdup(r[1]);
132
							current->sslcert = cm_strdup(r[1]);
131
						}
133
						}
-
 
134
					} else if(cm_strcaseequ(r[0], "DocumentRoot")) {
-
 
135
						if(r[1] == NULL) {
-
 
136
							cm_log("Config", "Missing path at line %d", ln);
-
 
137
							stop = 1;
-
 
138
						} else {
-
 
139
							if(current->root != NULL) free(current->root);
-
 
140
							current->root = cm_strdup(r[1]);
-
 
141
						}
132
					} else if(cm_strcaseequ(r[0], "ServerRoot")) {
142
					} else if(cm_strcaseequ(r[0], "ServerRoot")) {
133
						if(r[1] == NULL) {
143
						if(r[1] == NULL) {
134
							cm_log("Config", "Missing path at line %d", ln);
144
							cm_log("Config", "Missing path at line %d", ln);
135
							stop = 1;
145
							stop = 1;
136
						} else {
146
						} else {