Subversion Repositories Tewi

Rev

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

Rev 22 Rev 24
Line 1... Line 1...
1
/* $Id: config.c 22 2024-09-14 13:25:38Z nishi $ */
1
/* $Id: config.c 24 2024-09-14 14:09:58Z 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 80... Line 80...
80
	config.root.sslcert = NULL;
80
	config.root.sslcert = NULL;
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.vhost_count = 0;
86
	config.vhost_count = 0;
86
	config.module_count = 0;
87
	config.module_count = 0;
87
	config.extension = NULL;
88
	config.extension = NULL;
88
	config.server_root = cm_strdup(PREFIX);
89
	config.server_root = cm_strdup(PREFIX);
89
	gethostname(config.hostname, 1024);
90
	gethostname(config.hostname, 1024);
Line 179... Line 180...
179
								vhost = cm_strdup(r[1]);
180
								vhost = cm_strdup(r[1]);
180
								current = &config.vhosts[config.vhost_count++];
181
								current = &config.vhosts[config.vhost_count++];
181
								current->dir_count = 0;
182
								current->dir_count = 0;
182
								current->mime_count = 0;
183
								current->mime_count = 0;
183
								current->icon_count = 0;
184
								current->icon_count = 0;
-
 
185
								current->index_count = 0;
184
								int i;
186
								int i;
185
								current->name = cm_strdup(vhost);
187
								current->name = cm_strdup(vhost);
186
								current->port = -1;
188
								current->port = -1;
187
								for(i = 0; vhost[i] != 0; i++) {
189
								for(i = 0; vhost[i] != 0; i++) {
188
									if(vhost[i] == ':') {
190
									if(vhost[i] == ':') {
Line 280... Line 282...
280
							} else {
282
							} else {
281
								stop = 1;
283
								stop = 1;
282
								break;
284
								break;
283
							}
285
							}
284
						}
286
						}
-
 
287
					} else if(cm_strcaseequ(r[0], "DirectoryIndex")) {
-
 
288
						for(i = 1; r[i] != NULL; i++) {
-
 
289
							current->indexes[current->index_count++] = cm_strdup(r[i]);
-
 
290
						}
285
					} else {
291
					} else {
286
						if(r[0] != NULL) {
292
						if(r[0] != NULL) {
287
							cm_log("Config", "Unknown directive `%s' at line %d", r[0], ln);
293
							cm_log("Config", "Unknown directive `%s' at line %d", r[0], ln);
288
						}
294
						}
289
						stop = 1;
295
						stop = 1;