Subversion Repositories Tewi

Rev

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

Rev 24 Rev 33
Line 1... Line 1...
1
/* $Id: config.c 24 2024-09-14 14:09:58Z nishi $ */
1
/* $Id: config.c 33 2024-09-16 12:52: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 81... Line 81...
81
	config.root.root = NULL;
81
	config.root.root = NULL;
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.vhost_count = 0;
87
	config.vhost_count = 0;
87
	config.module_count = 0;
88
	config.module_count = 0;
88
	config.extension = NULL;
89
	config.extension = NULL;
89
	config.server_root = cm_strdup(PREFIX);
90
	config.server_root = cm_strdup(PREFIX);
90
	gethostname(config.hostname, 1024);
91
	gethostname(config.hostname, 1024);
Line 181... Line 182...
181
								current = &config.vhosts[config.vhost_count++];
182
								current = &config.vhosts[config.vhost_count++];
182
								current->dir_count = 0;
183
								current->dir_count = 0;
183
								current->mime_count = 0;
184
								current->mime_count = 0;
184
								current->icon_count = 0;
185
								current->icon_count = 0;
185
								current->index_count = 0;
186
								current->index_count = 0;
-
 
187
								current->readme_count = 0;
186
								int i;
188
								int i;
187
								current->name = cm_strdup(vhost);
189
								current->name = cm_strdup(vhost);
188
								current->port = -1;
190
								current->port = -1;
189
								for(i = 0; vhost[i] != 0; i++) {
191
								for(i = 0; vhost[i] != 0; i++) {
190
									if(vhost[i] == ':') {
192
									if(vhost[i] == ':') {
Line 286... Line 288...
286
						}
288
						}
287
					} else if(cm_strcaseequ(r[0], "DirectoryIndex")) {
289
					} else if(cm_strcaseequ(r[0], "DirectoryIndex")) {
288
						for(i = 1; r[i] != NULL; i++) {
290
						for(i = 1; r[i] != NULL; i++) {
289
							current->indexes[current->index_count++] = cm_strdup(r[i]);
291
							current->indexes[current->index_count++] = cm_strdup(r[i]);
290
						}
292
						}
-
 
293
					} else if(cm_strcaseequ(r[0], "Readme")) {
-
 
294
						for(i = 1; r[i] != NULL; i++) {
-
 
295
							current->readmes[current->readme_count++] = cm_strdup(r[i]);
-
 
296
						}
291
					} else {
297
					} else {
292
						if(r[0] != NULL) {
298
						if(r[0] != NULL) {
293
							cm_log("Config", "Unknown directive `%s' at line %d", r[0], ln);
299
							cm_log("Config", "Unknown directive `%s' at line %d", r[0], ln);
294
						}
300
						}
295
						stop = 1;
301
						stop = 1;