Subversion Repositories Tewi

Rev

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

Rev 17 Rev 18
Line 1... Line 1...
1
/* $Id: config.c 17 2024-09-13 17:41:07Z nishi $ */
1
/* $Id: config.c 18 2024-09-14 00:42:40Z 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 36... Line 36...
36
		config.vhosts[i].sslcert = NULL;
36
		config.vhosts[i].sslcert = NULL;
37
	}
37
	}
38
	config.root.sslkey = NULL;
38
	config.root.sslkey = NULL;
39
	config.root.sslcert = NULL;
39
	config.root.sslcert = NULL;
40
	config.vhost_count = 0;
40
	config.vhost_count = 0;
-
 
41
	config.module_count = 0;
-
 
42
	config.extension = NULL;
41
	config.server_root = cm_strdup(PREFIX);
43
	config.server_root = cm_strdup(PREFIX);
42
	gethostname(config.hostname, 1024);
44
	gethostname(config.hostname, 1024);
43
}
45
}
44
 
46
 
45
int tw_config_read(const char* path) {
47
int tw_config_read(const char* path) {
Line 137... Line 139...
137
						}
139
						}
138
					} else if(cm_strcaseequ(r[0], "LoadModule")) {
140
					} else if(cm_strcaseequ(r[0], "LoadModule")) {
139
						for(i = 1; r[i] != NULL; i++) {
141
						for(i = 1; r[i] != NULL; i++) {
140
							void* mod = tw_module_load(r[i]);
142
							void* mod = tw_module_load(r[i]);
141
							if(mod != NULL) {
143
							if(mod != NULL) {
-
 
144
								config.modules[config.module_count++] = mod;
142
								if(tw_module_init(mod) != 0) {
145
								if(tw_module_init(mod) != 0) {
143
									stop = 1;
146
									stop = 1;
144
									break;
147
									break;
145
								}
148
								}
146
							} else {
149
							} else {