diff options
author | Olaf van der Spek <olafvdspek@gmail.com> | 2010-06-02 13:07:07 +0000 |
---|---|---|
committer | Olaf van der Spek <olafvdspek@gmail.com> | 2010-06-02 13:07:07 +0000 |
commit | 6991a4052527352a421f5f2faf7fa917223ee3c6 (patch) | |
tree | e750bde0bb52387a7363ba2ff5a89efdd72c072f | |
parent | f4a027f8a763254b42d97b862ef55fa009cdd190 (diff) | |
download | lighttpd-6991a4052527352a421f5f2faf7fa917223ee3c6.tar.gz |
Upstream 1.4.27rc1-r2724
-rw-r--r-- | NEWS | 11 | ||||
-rw-r--r-- | SConstruct | 2 | ||||
-rwxr-xr-x | configure | 20 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/Makefile.in | 2 | ||||
-rw-r--r-- | src/connections.c | 5 | ||||
-rw-r--r-- | src/mod_compress.c | 37 | ||||
-rw-r--r-- | src/mod_proxy.c | 16 | ||||
-rw-r--r-- | src/network.c | 5 | ||||
-rw-r--r-- | src/response.c | 6 |
12 files changed, 77 insertions, 37 deletions
@@ -3,7 +3,16 @@ NEWS ==== -- 1.4.26 - +- 1.4.27 - + * Fix handling return value of SSL_CTX_set_options (fixes #2157, thx mlcreech) + * Fix mod_proxy HUP handling (send final chunk, fix usage counter) + * mod_proxy: close connection on write error (fixes #2114) + * Check uri instead of physical path for directory redirect + * Fix detecting git repository (fixes #2173, thx ncopa) + * [mod_compress] Fix segfault when etags are disabled (fixes #2169) + * Reset uri.authority before TLS servername handling, reset all "keep-alive" data in connection_del (fixes #2125) + +- 1.4.26 - 2010-02-07 * Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105) * Remove dependency on automake >= 1.11 with m4_ifdef check * mod_accesslog: support %e (fixes #2113, thx presbrey) @@ -5,7 +5,7 @@ import string from stat import * package = 'lighttpd' -version = '1.4.26' +version = '1.4.27' def checkCHeaders(autoconf, hdrs): p = re.compile('[^A-Z0-9]') @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for lighttpd 1.4.26. +# Generated by GNU Autoconf 2.65 for lighttpd 1.4.27. # # Report bugs to <contact@lighttpd.net>. # @@ -701,8 +701,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='lighttpd' PACKAGE_TARNAME='lighttpd' -PACKAGE_VERSION='1.4.26' -PACKAGE_STRING='lighttpd 1.4.26' +PACKAGE_VERSION='1.4.27' +PACKAGE_STRING='lighttpd 1.4.27' PACKAGE_BUGREPORT='contact@lighttpd.net' PACKAGE_URL='' @@ -1483,7 +1483,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures lighttpd 1.4.26 to adapt to many kinds of systems. +\`configure' configures lighttpd 1.4.27 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lighttpd 1.4.26:";; + short | recursive ) echo "Configuration of lighttpd 1.4.27:";; esac cat <<\_ACEOF @@ -1687,7 +1687,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lighttpd configure 1.4.26 +lighttpd configure 1.4.27 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2347,7 +2347,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by lighttpd $as_me 1.4.26, which was +It was created by lighttpd $as_me 1.4.27, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -3271,7 +3271,7 @@ fi # Define the identity of the package. PACKAGE='lighttpd' - VERSION='1.4.26' + VERSION='1.4.27' cat >>confdefs.h <<_ACEOF @@ -15580,7 +15580,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by lighttpd $as_me 1.4.26, which was +This file was extended by lighttpd $as_me 1.4.27, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15646,7 +15646,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -lighttpd config.status 1.4.26 +lighttpd config.status 1.4.27 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 6f72eeb..12da8ca 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl -*- Autoconf -*- dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT([lighttpd], [1.4.26], [contact@lighttpd.net]) +AC_INIT([lighttpd], [1.4.27], [contact@lighttpd.net]) AC_CONFIG_SRCDIR([src/server.c]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/debian/changelog b/debian/changelog index 84045f3..32f5dd3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +lighttpd (1.4.27~rc1-1) UNRELEASED; urgency=low + + * New upstream release + + -- Olaf van der Spek <olaf@router> Wed, 02 Jun 2010 15:03:11 +0200 + lighttpd (1.4.26-3) UNRELEASED; urgency=low * NOT RELEASED YET diff --git a/src/Makefile.am b/src/Makefile.am index 328931b..3cffe12 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,7 +19,7 @@ versionstamp: REVISION=""; \ fi; \ fi; \ - if test -z "$$REVISION" -a -x "`which git`"; then \ + if test -z "$$REVISION" -a -d "$(top_srcdir)/.git" -a -x "`which git`"; then \ REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \ fi; \ if test -n "$$REVISION"; then \ diff --git a/src/Makefile.in b/src/Makefile.in index 1af1f5f..8aff0fb 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1795,7 +1795,7 @@ versionstamp: REVISION=""; \ fi; \ fi; \ - if test -z "$$REVISION" -a -x "`which git`"; then \ + if test -z "$$REVISION" -a -d "$(top_srcdir)/.git" -a -x "`which git`"; then \ REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \ fi; \ if test -n "$$REVISION"; then \ diff --git a/src/connections.c b/src/connections.c index 27e9a98..aa7ea5c 100644 --- a/src/connections.c +++ b/src/connections.c @@ -82,6 +82,11 @@ static int connection_del(server *srv, connection *con) { if (-1 == con->ndx) return -1; + buffer_reset(con->uri.authority); + buffer_reset(con->uri.path); + buffer_reset(con->uri.query); + buffer_reset(con->request.orig_uri); + i = con->ndx; /* not last element */ diff --git a/src/mod_compress.c b/src/mod_compress.c index 1293950..748fc65 100644 --- a/src/mod_compress.c +++ b/src/mod_compress.c @@ -744,6 +744,7 @@ PHYSICALPATH_FUNC(mod_compress_physical) { int accept_encoding = 0; char *value = ds->value->ptr; int matched_encodings = 0; + int use_etag = sce->etag != NULL && sce->etag->ptr != NULL; /* get client side support encodings */ #ifdef USE_ZLIB @@ -770,12 +771,14 @@ PHYSICALPATH_FUNC(mod_compress_physical) { mtime = strftime_cache_get(srv, sce->st.st_mtime); /* try matching original etag of uncompressed version */ - etag_mutate(con->physical.etag, sce->etag); - if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) { - response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type)); - response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime)); - response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); - return HANDLER_FINISHED; + if (use_etag) { + etag_mutate(con->physical.etag, sce->etag); + if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) { + response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type)); + response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime)); + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); + return HANDLER_FINISHED; + } } /* select best matching encoding */ @@ -790,22 +793,26 @@ PHYSICALPATH_FUNC(mod_compress_physical) { compression_name = dflt_deflate; } - /* try matching etag of compressed version */ - buffer_copy_string_buffer(srv->tmp_buf, sce->etag); - buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("-")); - buffer_append_string(srv->tmp_buf, compression_name); - etag_mutate(con->physical.etag, srv->tmp_buf); + if (use_etag) { + /* try matching etag of compressed version */ + buffer_copy_string_buffer(srv->tmp_buf, sce->etag); + buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("-")); + buffer_append_string(srv->tmp_buf, compression_name); + etag_mutate(con->physical.etag, srv->tmp_buf); + } if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) { response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name)); response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type)); response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime)); - response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); + if (use_etag) { + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); + } return HANDLER_FINISHED; } /* deflate it */ - if (p->conf.compress_cache_dir->used) { + if (use_etag && p->conf.compress_cache_dir->used) { if (0 != deflate_file_to_file(srv, con, p, con->physical.path, sce, compression_type)) return HANDLER_GO_ON; } else { @@ -814,7 +821,9 @@ PHYSICALPATH_FUNC(mod_compress_physical) { } response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name)); response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime)); - response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); + if (use_etag) { + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); + } response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type)); /* let mod_staticfile handle the cached compressed files, physical path was modified */ return p->conf.compress_cache_dir->used ? HANDLER_GO_ON : HANDLER_FINISHED; diff --git a/src/mod_proxy.c b/src/mod_proxy.c index 6a8b8b1..257dd39 100644 --- a/src/mod_proxy.c +++ b/src/mod_proxy.c @@ -349,6 +349,10 @@ static void proxy_connection_close(server *srv, handler_ctx *hctx) { srv->cur_fds--; } + if (hctx->host) { + hctx->host->usage--; + } + handler_ctx_free(hctx); con->plugin_ctx[p->id] = NULL; } @@ -848,11 +852,11 @@ static handler_t proxy_write_request(server *srv, handler_ctx *hctx) { if (-1 == ret) { /* error on our side */ log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno); - return HANDLER_WAIT_FOR_EVENT; + return HANDLER_ERROR; } else if (-2 == ret) { /* remote close */ log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed, remote connection close:", strerror(errno), errno); - return HANDLER_WAIT_FOR_EVENT; + return HANDLER_ERROR; } if (hctx->wb->bytes_out == hctx->wb->bytes_in) { @@ -989,8 +993,6 @@ static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) { case 0: break; case 1: - hctx->host->usage--; - /* we are done */ proxy_connection_close(srv, hctx); @@ -1077,8 +1079,11 @@ static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) { return HANDLER_FINISHED; } - con->file_finished = 1; + if (!con->file_finished) { + http_chunk_append_mem(srv, con, NULL, 0); + } + con->file_finished = 1; proxy_connection_close(srv, hctx); joblist_append(srv, con); } else if (revents & FDEVENT_ERR) { @@ -1086,6 +1091,7 @@ static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) { log_error_write(srv, __FILE__, __LINE__, "sd", "proxy-FDEVENT_ERR, but no HUP", revents); + con->file_finished = 1; joblist_append(srv, con); proxy_connection_close(srv, hctx); } diff --git a/src/network.c b/src/network.c index 4b07618..a744e4d 100644 --- a/src/network.c +++ b/src/network.c @@ -82,6 +82,9 @@ static int network_ssl_servername_callback(SSL *ssl, int *al, server *srv) { buffer_copy_string(con->tlsext_server_name, servername); buffer_to_lower(con->tlsext_server_name); + /* Sometimes this is still set, confusing COMP_HTTP_HOST */ + buffer_reset(con->uri.authority); + config_cond_cache_reset(srv, con); config_setup_connection(srv, con); @@ -525,7 +528,7 @@ int network_init(server *srv) { if (!s->ssl_use_sslv2) { /* disable SSLv2 */ - if (SSL_OP_NO_SSLv2 != SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv2)) { + if (!(SSL_OP_NO_SSLv2 & SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv2))) { log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:", ERR_error_string(ERR_get_error(), NULL)); return -1; diff --git a/src/response.c b/src/response.c index 7ba5281..e829cfd 100644 --- a/src/response.c +++ b/src/response.c @@ -136,6 +136,8 @@ static void https_add_ssl_entries(connection *con) { X509 *xs; X509_NAME *xn; X509_NAME_ENTRY *xe; + int i, nentries; + if ( SSL_get_verify_result(con->ssl) != X509_V_OK || !(xs = SSL_get_peer_certificate(con->ssl)) @@ -144,7 +146,7 @@ static void https_add_ssl_entries(connection *con) { } xn = X509_get_subject_name(xs); - for (int i = 0, nentries = X509_NAME_entry_count(xn); i < nentries; ++i) { + for (i = 0, nentries = X509_NAME_entry_count(xn); i < nentries; ++i) { int xobjnid; const char * xobjsn; data_string *envds; @@ -581,7 +583,7 @@ handler_t http_response_prepare(server *srv, connection *con) { }; #endif if (S_ISDIR(sce->st.st_mode)) { - if (con->physical.path->ptr[con->physical.path->used - 2] != '/') { + if (con->uri.path->ptr[con->uri.path->used - 2] != '/') { /* redirect to .../ */ http_response_redirect_to_directory(srv, con); |