From 16cadaab87d25fc026ac777746eabbff3030f0cc Mon Sep 17 00:00:00 2001 From: Arno Töll Date: Wed, 21 Nov 2012 23:03:59 +0100 Subject: Imported Upstream version 1.4.28 --- src/configfile.c | 54 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 23 deletions(-) (limited to 'src/configfile.c') diff --git a/src/configfile.c b/src/configfile.c index 3037185..0ee96b6 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -100,6 +100,9 @@ static int config_insert(server *srv) { { "ssl.verifyclient.depth", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 58 */ { "ssl.verifyclient.username", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 59 */ { "ssl.verifyclient.exportcert", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 60 */ + + { "server.set-v6only", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 61 */ + { "server.host", "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET }, { "server.docroot", "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET }, { "server.virtual-root", "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET }, @@ -170,6 +173,7 @@ static int config_insert(server *srv) { s->is_ssl = 0; s->ssl_use_sslv2 = 0; s->use_ipv6 = 0; + s->set_v6only = 1; s->defer_accept = 0; #ifdef HAVE_LSTAT s->follow_symlink = 1; @@ -180,7 +184,7 @@ static int config_insert(server *srv) { s->etag_use_mtime = 1; s->etag_use_size = 1; s->range_requests = 1; - s->force_lowercase_filenames = 0; + s->force_lowercase_filenames = (i == 0) ? 2 : 0; /* we wan't to detect later if user changed this for global section */ s->global_kbytes_per_second = 0; s->global_bytes_per_second_cnt = 0; s->global_bytes_per_second_cnt_ptr = &s->global_bytes_per_second_cnt; @@ -194,6 +198,7 @@ static int config_insert(server *srv) { cv[7].destination = s->server_tag; cv[8].destination = &(s->use_ipv6); + cv[61].destination = &(s->set_v6only); cv[54].destination = &(s->defer_accept); @@ -1171,9 +1176,8 @@ int config_set_defaults(server *srv) { struct ev_map { fdevent_handler_t et; const char *name; } event_handlers[] = { - /* - poll is most reliable + /* - epoll is most reliable * - select works everywhere - * - linux-* are experimental */ #ifdef USE_LINUX_EPOLL { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" }, @@ -1184,8 +1188,8 @@ int config_set_defaults(server *srv) { #ifdef USE_SELECT { FDEVENT_HANDLER_SELECT, "select" }, #endif -#ifdef USE_LINUX_SIGIO - { FDEVENT_HANDLER_LINUX_RTSIG, "linux-rtsig" }, +#ifdef USE_LIBEV + { FDEVENT_HANDLER_LIBEV, "libev" }, #endif #ifdef USE_SOLARIS_DEVPOLL { FDEVENT_HANDLER_SOLARIS_DEVPOLL,"solaris-devpoll" }, @@ -1230,35 +1234,39 @@ int config_set_defaults(server *srv) { buffer_to_lower(srv->tmp_buf); - if (0 == stat(srv->tmp_buf->ptr, &st1)) { - int is_lower = 0; + if (2 == s->force_lowercase_filenames) { /* user didn't configure it in global section? */ + s->force_lowercase_filenames = 0; /* default to 0 */ - is_lower = buffer_is_equal(srv->tmp_buf, s->document_root); + if (0 == stat(srv->tmp_buf->ptr, &st1)) { + int is_lower = 0; - /* lower-case existed, check upper-case */ - buffer_copy_string_buffer(srv->tmp_buf, s->document_root); + is_lower = buffer_is_equal(srv->tmp_buf, s->document_root); - buffer_to_upper(srv->tmp_buf); + /* lower-case existed, check upper-case */ + buffer_copy_string_buffer(srv->tmp_buf, s->document_root); - /* we have to handle the special case that upper and lower-casing results in the same filename - * as in server.document-root = "/" or "/12345/" */ + buffer_to_upper(srv->tmp_buf); - if (is_lower && buffer_is_equal(srv->tmp_buf, s->document_root)) { - /* lower-casing and upper-casing didn't result in - * an other filename, no need to stat(), - * just assume it is case-sensitive. */ + /* we have to handle the special case that upper and lower-casing results in the same filename + * as in server.document-root = "/" or "/12345/" */ - s->force_lowercase_filenames = 0; - } else if (0 == stat(srv->tmp_buf->ptr, &st2)) { + if (is_lower && buffer_is_equal(srv->tmp_buf, s->document_root)) { + /* lower-casing and upper-casing didn't result in + * an other filename, no need to stat(), + * just assume it is case-sensitive. */ - /* upper case exists too, doesn't the FS handle this ? */ + s->force_lowercase_filenames = 0; + } else if (0 == stat(srv->tmp_buf->ptr, &st2)) { - /* upper and lower have the same inode -> case-insensitve FS */ + /* upper case exists too, doesn't the FS handle this ? */ - if (st1.st_ino == st2.st_ino) { /* upper and lower have the same inode -> case-insensitve FS */ - s->force_lowercase_filenames = 1; + if (st1.st_ino == st2.st_ino) { + /* upper and lower have the same inode -> case-insensitve FS */ + + s->force_lowercase_filenames = 1; + } } } } -- cgit v1.2.3