Subversion Repositories Tewi

Rev

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

Rev 161 Rev 174
Line 1... Line 1...
1
/* $Id: config.c 161 2024-09-25 13:35:04Z nishi $ */
1
/* $Id: config.c 174 2024-09-26 21:21:44Z 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 103... Line 103...
103
	config.defined[0] = NULL;
103
	config.defined[0] = NULL;
104
	gethostname(config.hostname, 1024);
104
	gethostname(config.hostname, 1024);
105
#ifdef HAS_CHROOT
105
#ifdef HAS_CHROOT
106
	tw_add_define("HAS_CHROOT");
106
	tw_add_define("HAS_CHROOT");
107
#endif
107
#endif
-
 
108
#ifndef NO_SSL
-
 
109
	tw_add_define("HAS_SSL");
-
 
110
#endif
108
}
111
}
109
 
112
 
110
int tw_config_read(const char* path) {
113
int tw_config_read(const char* path) {
111
	cm_log("Config", "Reading %s", path);
114
	cm_log("Config", "Reading %s", path);
112
	char cbuf[2];
115
	char cbuf[2];
Line 242... Line 245...
242
						} else {
245
						} else {
243
							free(vhost);
246
							free(vhost);
244
							vhost = NULL;
247
							vhost = NULL;
245
							current = &config.root;
248
							current = &config.root;
246
						}
249
						}
247
					} else if(cm_strcaseequ(r[0], "Listen") || cm_strcaseequ(r[0], "ListenSSL")) {
250
					} else if(cm_strcaseequ(r[0], "Listen")
-
 
251
#ifndef NO_SSL
-
 
252
						  || cm_strcaseequ(r[0], "ListenSSL")
-
 
253
#endif
-
 
254
					) {
248
						for(i = 1; r[i] != NULL; i++) {
255
						for(i = 1; r[i] != NULL; i++) {
249
							uint64_t port = atoi(r[i]);
256
							uint64_t port = atoi(r[i]);
250
							cm_log("Config", "Going to listen at port %d%s", (int)port, cm_strcaseequ(r[0], "ListenSSL") ? " with SSL" : "");
257
							cm_log("Config", "Going to listen at port %d%s", (int)port, cm_strcaseequ(r[0], "ListenSSL") ? " with SSL" : "");
251
							if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1ULL << 32);
258
							if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1ULL << 32);
252
							int j;
259
							int j;