Project

General

Profile

Bug #228 » lighttpd-1.4.1-runtime-module-dir.diff

Allows modules directory to be configured at run-time -- Aaron Walker <ka0ttic - Anonymous, 2005-08-25 01:53

View differences:

lighttpd-1.4.1/src/base.h 2005-08-23 09:05:49.000000000 -0400
buffer *event_handler;
buffer *modules_dir;
array *modules;
unsigned short max_worker;
lighttpd-1.4.1/src/plugin.c 2005-08-23 09:05:49.000000000 -0400
buffer_reset(srv->tmp_buf);
/* for make distcheck */
if (NULL != (inst = strstr(LIBRARY_DIR, "/_inst/lib"))) {
buffer_copy_string_len(srv->tmp_buf, LIBRARY_DIR, strlen(LIBRARY_DIR) - strlen(inst));
if (NULL != (inst = strstr(srv->srvconf.modules_dir->ptr, "/_inst/lib"))) {
buffer_copy_string_len(srv->tmp_buf, srv->srvconf.modules_dir->ptr,
strlen(srv->srvconf.modules_dir->ptr) - strlen(inst));
buffer_append_string(srv->tmp_buf, "/_build/src/.libs");
buffer_append_string(srv->tmp_buf, inst + strlen("/_inst/lib") );
} else {
buffer_copy_string(srv->tmp_buf, LIBRARY_DIR);
buffer_copy_string_buffer(srv->tmp_buf, srv->srvconf.modules_dir);
}
buffer_append_string(srv->tmp_buf, "/");
buffer_append_string(srv->tmp_buf, modules);
lighttpd-1.4.1/src/server.c 2005-08-23 09:14:07.000000000 -0400
assert(srv->stat_cache);
srv->srvconf.modules = array_init();
srv->srvconf.modules_dir = buffer_init_string(LIBRARY_DIR);
/* use syslog */
srv->errorlog_fd = -1;
......
CLEAN(srvconf.bindhost);
CLEAN(srvconf.event_handler);
CLEAN(srvconf.pid_file);
CLEAN(srvconf.modules_dir);
CLEAN(tmp_chunk_len);
#undef CLEAN
......
" - a light and fast webserver\n" \
"usage:\n" \
" -f <name> filename of the config-file\n" \
" -m <name> module directory (default: "LIBRARY_DIR")\n" \
" -p print the parsed config-file in internal form, and exit\n" \
" -t test the config-file, and exit\n" \
" -D don't go to background (default: go to background)\n" \
......
#endif
srv->srvconf.dont_daemonize = 0;
while(-1 != (o = getopt(argc, argv, "f:hvDpt"))) {
while(-1 != (o = getopt(argc, argv, "f:m:hvDpt"))) {
switch(o) {
case 'f':
if (config_read(srv, optarg)) {
......
return -1;
}
break;
case 'm':
buffer_copy_string(srv->srvconf.modules_dir, optarg);
break;
case 'p': print_config = 1; break;
case 't': test_config = 1; break;
case 'D': srv->srvconf.dont_daemonize = 1; break;
(1-1/2)