Subversion Repositories Tewi

Rev

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

Rev 61 Rev 123
Line 1... Line 1...
1
/* $Id: config.c 61 2024-09-18 12:45:02Z nishi $ */
1
/* $Id: config.c 123 2024-09-22 13:43:47Z 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 82... Line 82...
82
	config.root.mime_count = 0;
82
	config.root.mime_count = 0;
83
	config.root.dir_count = 0;
83
	config.root.dir_count = 0;
84
	config.root.icon_count = 0;
84
	config.root.icon_count = 0;
85
	config.root.index_count = 0;
85
	config.root.index_count = 0;
86
	config.root.readme_count = 0;
86
	config.root.readme_count = 0;
-
 
87
	config.root.hideport = 0;
87
	config.vhost_count = 0;
88
	config.vhost_count = 0;
88
	config.module_count = 0;
89
	config.module_count = 0;
89
	config.extension = NULL;
90
	config.extension = NULL;
90
	config.server_root = cm_strdup(PREFIX);
91
	config.server_root = cm_strdup(PREFIX);
91
	gethostname(config.hostname, 1024);
92
	gethostname(config.hostname, 1024);
Line 183... Line 184...
183
								current->dir_count = 0;
184
								current->dir_count = 0;
184
								current->mime_count = 0;
185
								current->mime_count = 0;
185
								current->icon_count = 0;
186
								current->icon_count = 0;
186
								current->index_count = 0;
187
								current->index_count = 0;
187
								current->readme_count = 0;
188
								current->readme_count = 0;
-
 
189
								current->hideport = -1;
188
								int i;
190
								int i;
189
								current->name = cm_strdup(vhost);
191
								current->name = cm_strdup(vhost);
190
								current->port = -1;
192
								current->port = -1;
191
								for(i = 0; vhost[i] != 0; i++) {
193
								for(i = 0; vhost[i] != 0; i++) {
192
									if(vhost[i] == ':') {
194
									if(vhost[i] == ':') {
Line 214... Line 216...
214
							int j;
216
							int j;
215
							for(j = 0; config.ports[j] != -1; j++)
217
							for(j = 0; config.ports[j] != -1; j++)
216
								;
218
								;
217
							config.ports[j] = port;
219
							config.ports[j] = port;
218
						}
220
						}
-
 
221
					} else if(cm_strcaseequ(r[0], "HidePort")) {
-
 
222
						current->hideport = 1;
-
 
223
					} else if(cm_strcaseequ(r[0], "ShowPort")) {
-
 
224
						current->hideport = 0;
219
					} else if(cm_strcaseequ(r[0], "SSLKey")) {
225
					} else if(cm_strcaseequ(r[0], "SSLKey")) {
220
						if(r[1] == NULL) {
226
						if(r[1] == NULL) {
221
							cm_log("Config", "Missing path at line %d", ln);
227
							cm_log("Config", "Missing path at line %d", ln);
222
							stop = 1;
228
							stop = 1;
223
						} else {
229
						} else {