Author: glen Date: Fri Oct 3 09:49:22 2008 GMT Module: SOURCES Tag: HEAD ---- Log message: - up to 2324 (1.4.20 already)
---- Files affected: SOURCES: lighttpd-branch.diff (1.40 -> 1.41) , lighttpd-branch.sh (1.5 -> 1.6) ---- Diffs: ================================================================ Index: SOURCES/lighttpd-branch.diff diff -u SOURCES/lighttpd-branch.diff:1.40 SOURCES/lighttpd-branch.diff:1.41 --- SOURCES/lighttpd-branch.diff:1.40 Fri Sep 19 17:04:06 2008 +++ SOURCES/lighttpd-branch.diff Fri Oct 3 11:49:16 2008 @@ -1,6989 +1,683 @@ -Index: lighttpd.spec.in -=================================================================== ---- lighttpd.spec.in (.../tags/lighttpd-1.4.19) (revision 2303) -+++ lighttpd.spec.in (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -1,83 +0,0 @@ --Summary: A fast webserver with minimal memory-footprint (lighttpd) --Name: lighttpd --Version: @VERSION@ --Release: 1 --Source: http://jan.kneschke.de/projects/lighttpd/download/lighttpd-%version.tar.gz --Packager: Jan Kneschke <[EMAIL PROTECTED]> --License: BSD --Group: Networking/Daemons --URL: http://www.lighttpd.net/ --Requires: pcre >= 3.1 zlib --BuildRequires: libtool zlib-devel --BuildRoot: %{_tmppath}/%{name}-root -- --%description --lighttpd is intented to be a frontend for ad-servers which have to deliver --small files concurrently to many connections. -- --Available rpmbuild rebuild options: ----with: ssl mysql lua memcache -- --%prep --%setup -q -- --%build --rm -rf %{buildroot} --%configure \ -- %{?_with_mysql: --with-mysql} \ -- %{?_with_lua: --with-lua} \ -- %{?_with_memcache: --with-memcache} \ -- %{?_with_ssl: --with-openssl} --make -- --%install --%makeinstall -- --mkdir -p %{buildroot}%{_sysconfdir}/{init.d,sysconfig} --if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then -- install -m 755 doc/rc.lighttpd.redhat %{buildroot}%{_sysconfdir}/init.d/lighttpd --else -- install -m 755 doc/rc.lighttpd %{buildroot}%{_sysconfdir}/init.d/lighttpd --fi --install -m 644 doc/sysconfig.lighttpd %{buildroot}%{_sysconfdir}/sysconfig/lighttpd -- --%clean --rm -rf %{buildroot} -- --%post --## read http://www.fedora.us/docs/spec.html next time :) --if [ "$1" = "1" ]; then -- # real install, not upgrade -- /sbin/chkconfig --add lighttpd --fi -- --%preun --if [ "$1" = "0"]; then -- # real uninstall, not upgrade -- %{_sysconfdir}/init.d/lighttpd stop -- /sbin/chkconfig --del lighttpd --fi -- --%files --%defattr(-,root,root) --%doc doc/lighttpd.conf doc/lighttpd.user README INSTALL ChangeLog COPYING AUTHORS --%doc doc/*.txt --%config(noreplace) %attr(0755,root,root) %{_sysconfdir}/init.d/lighttpd --%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/lighttpd --%{_mandir}/* --%{_libdir}/* --%{_sbindir}/* --%{_bindir}/* -- --%changelog --* Thu Sep 30 2004 12:41 <[EMAIL PROTECTED]> 1.3.1 --- upgraded to 1.3.1 -- --* Tue Jun 29 2004 17:26 <[EMAIL PROTECTED]> 1.2.3 --- rpmlint'ed the package --- added URL --- added (noreplace) to start-script --- change group to Networking/Daemon (like apache) -- --* Sun Feb 23 2003 15:04 <[EMAIL PROTECTED]> --- initial version Index: configure.in =================================================================== -Index: src/mod_ssi_exprparser.h -=================================================================== ---- src/mod_ssi_exprparser.h (.../tags/lighttpd-1.4.19) (revision 2303) -+++ src/mod_ssi_exprparser.h (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -1,12 +0,0 @@ --#define TK_AND 1 --#define TK_OR 2 --#define TK_EQ 3 --#define TK_NE 4 --#define TK_GT 5 --#define TK_GE 6 --#define TK_LT 7 --#define TK_LE 8 --#define TK_NOT 9 --#define TK_LPARAN 10 --#define TK_RPARAN 11 --#define TK_VALUE 12 Index: src/configfile-glue.c =================================================================== ---- src/configfile-glue.c (.../tags/lighttpd-1.4.19) (revision 2303) -+++ src/configfile-glue.c (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -155,7 +155,7 @@ - /* touched */ - touched = data_string_init(); - -- buffer_copy_string(touched->value, ""); -+ buffer_copy_string_len(touched->value, CONST_STR_LEN("")); - buffer_copy_string_buffer(touched->key, du->key); - - array_insert_unique(srv->config_touched, (data_unset *)touched); -@@ -260,7 +260,7 @@ - if (ck_colon) { - /* condition "host:port" but client send "host" */ - buffer_copy_string_buffer(srv->cond_check_buf, l); -- BUFFER_APPEND_STRING_CONST(srv->cond_check_buf, ":"); -+ buffer_append_string_len(srv->cond_check_buf, CONST_STR_LEN(":")); - buffer_append_long(srv->cond_check_buf, sock_addr_get_port(&(srv_sock->addr))); - l = srv->cond_check_buf; - } else if (!ck_colon) { -@@ -529,7 +529,7 @@ - int config_append_cond_match_buffer(connection *con, data_config *dc, buffer *buf, int n) - { - cond_cache_t *cache = &con->cond_cache[dc->context_ndx]; -- if (n > cache->patterncount) { -+ if (n >= cache->patterncount) { - return 0; - } - -Index: src/mod_cgi.c -=================================================================== ---- src/mod_cgi.c (.../tags/lighttpd-1.4.19) (revision 2303) -+++ src/mod_cgi.c (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -912,7 +912,7 @@ - buffer_reset(p->tmp_buf); - - if (0 != strcasecmp(ds->key->ptr, "CONTENT-TYPE")) { -- buffer_copy_string(p->tmp_buf, "HTTP_"); -+ buffer_copy_string_len(p->tmp_buf, CONST_STR_LEN("HTTP_")); - p->tmp_buf->used--; /* strip \0 after HTTP_ */ - } - -@@ -949,7 +949,7 @@ - - for (j = 0; j < ds->key->used - 1; j++) { - p->tmp_buf->ptr[p->tmp_buf->used++] = -- isalpha((unsigned char)ds->key->ptr[j]) ? -+ light_isalnum((unsigned char)ds->key->ptr[j]) ? - toupper((unsigned char)ds->key->ptr[j]) : '_'; - } - p->tmp_buf->ptr[p->tmp_buf->used++] = '\0'; -@@ -987,6 +987,8 @@ - *c = '/'; - } - -+ openDevNull(STDERR_FILENO); -+ - /* we don't need the client socket */ - for (i = 3; i < 256; i++) { - if (i != srv->errorlog_fd) close(i); -@@ -995,7 +997,7 @@ - /* exec the cgi */ - execve(args[0], args, env.ptr); - -- log_error_write(srv, __FILE__, __LINE__, "sss", "CGI failed:", strerror(errno), args[0]); -+ /* log_error_write(srv, __FILE__, __LINE__, "sss", "CGI failed:", strerror(errno), args[0]); */ - - /* */ - SEGFAULT(); -@@ -1058,8 +1060,9 @@ - switch(errno) { - case ENOSPC: - con->http_status = 507; -- - break; -+ case EINTR: -+ continue; - default: - con->http_status = 403; - break; -@@ -1071,8 +1074,9 @@ - switch(errno) { - case ENOSPC: - con->http_status = 507; -- - break; -+ case EINTR: -+ continue; - default: - con->http_status = 403; - break; -@@ -1087,6 +1091,8 @@ - c->offset += r; - cq->bytes_out += r; - } else { -+ log_error_write(srv, __FILE__, __LINE__, "ss", "write() failed due to: ", strerror(errno)); -+ con->http_status = 500; - break; - } - chunkqueue_remove_finished_chunks(cq); -@@ -1174,6 +1180,8 @@ - plugin_data *p = p_d; - buffer *fn = con->physical.path; +--- src/configfile-glue.c (.../tags/lighttpd-1.4.20) (revision 2324) ++++ src/configfile-glue.c (.../branches/lighttpd-1.4.x) (revision 2324) +@@ -1,4 +1,5 @@ + #include <string.h> ++#include <stdlib.h> -+ if (con->mode != DIRECT) return HANDLER_GO_ON; + #include "base.h" + #include "buffer.h" +@@ -90,6 +91,22 @@ + case TYPE_STRING: { + data_string *ds = (data_string *)du; + ++ /* If the value came from an environment variable, then it is a ++ * data_string, although it may contain a number in ASCII ++ * decimal format. We try to interpret the string as a decimal ++ * short before giving up, in order to support setting numeric ++ * values with environment variables (eg, port number). ++ */ ++ if (ds->value->ptr && *ds->value->ptr) { ++ char *e; ++ long l = strtol(ds->value->ptr, &e, 10); ++ if (e != ds->value->ptr && !*e && l >=0 && l <= 65535) { ++ *((unsigned short *)(cv[i].destination)) = l; ++ break; + - if (fn->used == 0) return HANDLER_GO_ON; - - mod_cgi_patch_connection(srv, con, p); -@@ -1189,6 +1197,7 @@ - - if (0 == strncmp(fn->ptr + s_len - ct_len, ds->key->ptr, ct_len)) { - if (cgi_create_env(srv, con, p, ds->value)) { -+ con->mode = DIRECT; - con->http_status = 500; - - buffer_reset(con->physical.path); -Index: src/mod_secure_download.c -=================================================================== ---- src/mod_secure_download.c (.../tags/lighttpd-1.4.19) (revision 2303) -+++ src/mod_secure_download.c (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -204,6 +204,8 @@ - time_t ts = 0; - size_t i; - -+ if (con->mode != DIRECT) return HANDLER_GO_ON; ++ } ++ } + - if (con->uri.path->used == 0) return HANDLER_GO_ON; - - mod_secdownload_patch_connection(srv, con, p); -@@ -243,8 +245,8 @@ - } - - /* timed-out */ -- if (srv->cur_ts - ts > p->conf.timeout || -- srv->cur_ts - ts < -p->conf.timeout) { -+ if ( (srv->cur_ts > ts && srv->cur_ts - ts > p->conf.timeout) || -+ (srv->cur_ts < ts && ts - srv->cur_ts > p->conf.timeout) ) { - /* "Gone" as the url will never be valid again instead of "408 - Timeout" where the request may be repeated */ - con->http_status = 410; - -@@ -268,7 +270,7 @@ - - buffer_copy_string_hex(p->md5, (char *)HA1, 16); - -- if (0 != strncmp(md5_str, p->md5->ptr, 32)) { -+ if (0 != strncasecmp(md5_str, p->md5->ptr, 32)) { - con->http_status = 403; - - log_error_write(srv, __FILE__, __LINE__, "sss", -Index: src/array.c -=================================================================== ---- src/array.c (.../tags/lighttpd-1.4.19) (revision 2303) -+++ src/array.c (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -330,30 +330,30 @@ - a = array_init(); - - ds = data_string_init(); -- buffer_copy_string(ds->key, "abc"); -- buffer_copy_string(ds->value, "alfrag"); -+ buffer_copy_string_len(ds->key, CONST_STR_LEN("abc")); -+ buffer_copy_string_len(ds->value, CONST_STR_LEN("alfrag")); - - array_insert_unique(a, (data_unset *)ds); - - ds = data_string_init(); -- buffer_copy_string(ds->key, "abc"); -- buffer_copy_string(ds->value, "hameplman"); -+ buffer_copy_string_len(ds->key, CONST_STR_LEN("abc")); -+ buffer_copy_string_len(ds->value, CONST_STR_LEN("hameplman")); - - array_insert_unique(a, (data_unset *)ds); - - ds = data_string_init(); -- buffer_copy_string(ds->key, "123"); -- buffer_copy_string(ds->value, "alfrag"); -+ buffer_copy_string_len(ds->key, CONST_STR_LEN("123")); -+ buffer_copy_string_len(ds->value, CONST_STR_LEN("alfrag")); + log_error_write(srv, __FILE__, __LINE__, "ssb", "got a string but expected a short:", cv[i].key, ds->value); - array_insert_unique(a, (data_unset *)ds); - - dc = data_count_init(); -- buffer_copy_string(dc->key, "def"); -+ buffer_copy_string_len(dc->key, CONST_STR_LEN("def")); - - array_insert_unique(a, (data_unset *)dc); - - dc = data_count_init(); -- buffer_copy_string(dc->key, "def"); -+ buffer_copy_string_len(dc->key, CONST_STR_LEN("def")); - - array_insert_unique(a, (data_unset *)dc); - -Index: src/base.h -=================================================================== ---- src/base.h (.../tags/lighttpd-1.4.19) (revision 2303) -+++ src/base.h (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -259,6 +259,7 @@ - unsigned short log_request_handling; - unsigned short log_response_header; - unsigned short log_condition_handling; -+ unsigned short log_ssl_noise; - - - /* server wide */ -Index: src/mod_rewrite.c -=================================================================== ---- src/mod_rewrite.c (.../tags/lighttpd-1.4.19) (revision 2303) -+++ src/mod_rewrite.c (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -350,7 +350,11 @@ - - if (!p->conf.rewrite) return HANDLER_GO_ON; - -- buffer_copy_string_buffer(p->match_buf, con->request.uri); -+ buffer_copy_string_buffer(p->match_buf, con->uri.path); -+ if (con->uri.query->used > 0) { -+ buffer_append_string_len(p->match_buf, CONST_STR_LEN("?")); -+ buffer_append_string_buffer(p->match_buf, con->uri.query); -+ } - - for (i = 0; i < p->conf.rewrite->used; i++) { - pcre *match; -@@ -385,8 +389,7 @@ - - start = 0; end = pattern_len; - for (k = 0; k < pattern_len; k++) { -- if ((pattern[k] == '$' || pattern[k] == '%') && -- isdigit((unsigned char)pattern[k + 1])) { -+ if (pattern[k] == '$' || pattern[k] == '%') { - /* got one */ - - size_t num = pattern[k + 1] - '0'; -@@ -395,7 +398,10 @@ - - buffer_append_string_len(con->request.uri, pattern + start, end - start); - -- if (pattern[k] == '$') { -+ if (!isdigit((unsigned char)pattern[k + 1])) { -+ /* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */ -+ buffer_append_string_len(con->request.uri, pattern+k, pattern[k] == pattern[k+1] ? 1 : 2); -+ } else if (pattern[k] == '$') { - /* n is always > 0 */ - if (num < (size_t)n) { - buffer_append_string(con->request.uri, list[num]); -Index: src/lempar.c -=================================================================== ---- src/lempar.c (.../tags/lighttpd-1.4.19) (revision 2303) -+++ src/lempar.c (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -210,7 +210,7 @@ - */ - const char *ParseTokenName(int tokenType){ - #ifndef NDEBUG -- if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ -+ if( tokenType>0 && (size_t)tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ - return yyTokenName[tokenType]; - }else{ - return "Unknown"; -@@ -335,7 +335,7 @@ - return YY_NO_ACTION; - } - i += iLookAhead; -- if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ -+ if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ - #ifdef YYFALLBACK - int iFallback; /* Fallback token */ - if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) -@@ -378,7 +378,7 @@ - return YY_NO_ACTION; - } - i += iLookAhead; -- if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ -+ if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ - return yy_default[stateno]; - }else{ - return yy_action[i]; -@@ -456,7 +456,7 @@ - yymsp = &yypParser->yystack[yypParser->yyidx]; - #ifndef NDEBUG - if( yyTraceFILE && yyruleno>=0 -- && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ -+ && (size_t)yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ - fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, - yyRuleName[yyruleno]); - } -@@ -511,6 +511,8 @@ - int yymajor, /* The major type of the error token */ - YYMINORTYPE yyminor /* The minor type of the error token */ - ){ -+ UNUSED(yymajor); -+ UNUSED(yyminor); - ParseARG_FETCH; - #define TOKEN (yyminor.yy0) - %% -Index: src/connections.c + return -1; +Index: src/mod_cgi.c =================================================================== ---- src/connections.c (.../tags/lighttpd-1.4.19) (revision 2303) -+++ src/connections.c (.../branches/lighttpd-1.4.x) (revision 2303) -@@ -199,6 +199,7 @@ - - /* don't resize the buffer if we were in SSL_ERROR_WANT_* */ - -+ ERR_clear_error(); - do { - if (!con->ssl_error_want_reuse_buffer) { - b = buffer_init(); -@@ -275,9 +276,19 @@ - /* fall thourgh */ - default: - while((ssl_err = ERR_get_error())) { -+ switch (ERR_GET_REASON(ssl_err)) { -+ case SSL_R_SSL_HANDSHAKE_FAILURE: -+ case SSL_R_TLSV1_ALERT_UNKNOWN_CA: -+ case SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN: -+ case SSL_R_SSLV3_ALERT_BAD_CERTIFICATE: -+ if (!con->conf.log_ssl_noise) continue; -+ break; -+ default: -+ break; -+ } - /* get all errors from the error-queue */ - log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:", -- r, ERR_error_string(ssl_err, NULL)); -+ r, ERR_error_string(ssl_err, NULL)); - } - break; - } -@@ -299,6 +310,8 @@ - - return 0; +--- src/mod_cgi.c (.../tags/lighttpd-1.4.20) (revision 2324) ++++ src/mod_cgi.c (.../branches/lighttpd-1.4.x) (revision 2324) +@@ -822,15 +822,27 @@ + ); + cgi_env_add(&env, CONST_STR_LEN("SERVER_PORT"), buf, strlen(buf)); + ++ switch (srv_sock->addr.plain.sa_family) { + #ifdef HAVE_IPV6 +- s = inet_ntop(srv_sock->addr.plain.sa_family, +- srv_sock->addr.plain.sa_family == AF_INET6 ? +- (const void *) &(srv_sock->addr.ipv6.sin6_addr) : +- (const void *) &(srv_sock->addr.ipv4.sin_addr), +- b2, sizeof(b2)-1); ++ case AF_INET6: ++ s = inet_ntop(srv_sock->addr.plain.sa_family, ++ (const void *) &(srv_sock->addr.ipv6.sin6_addr), ++ b2, sizeof(b2)-1); ++ break; ++ case AF_INET: ++ s = inet_ntop(srv_sock->addr.plain.sa_family, ++ (const void *) &(srv_sock->addr.ipv4.sin_addr), ++ b2, sizeof(b2)-1); ++ break; #else -+ UNUSED(srv); -+ UNUSED(con); - return -1; +- s = inet_ntoa(srv_sock->addr.ipv4.sin_addr); ++ case AF_INET: ++ s = inet_ntoa(srv_sock->addr.ipv4.sin_addr); ++ break; #endif - } -@@ -427,21 +440,22 @@ - } - - switch(con->http_status) { -- case 400: /* class: header + custom body */ -- case 401: -- case 403: -- case 404: -- case 408: -- case 409: -- case 411: -- case 416: -- case 423: -- case 500: -- case 501: -- case 503: -- case 505: -+ case 204: /* class: header only */ -+ case 205: -+ case 304: -+ /* disable chunked encoding again as we have no body */ -+ con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED; -+ con->parsed_response &= ~HTTP_CONTENT_LENGTH; -+ chunkqueue_reset(con->write_queue); -+ -+ con->file_finished = 1; -+ break; -+ default: /* class: header + body */ - if (con->mode != DIRECT) break; - -+ /* only custom body for 4xx and 5xx */ -+ if (con->http_status < 400 || con->http_status >= 600) break; -+ - con->file_finished = 0; - - buffer_reset(con->physical.path); -@@ -451,7 +465,8 @@ - stat_cache_entry *sce = NULL; - - buffer_copy_string_buffer(con->physical.path, con->conf.errorfile_prefix); -- buffer_append_string(con->physical.path, get_http_status_body_name(con->http_status)); -+ buffer_append_long(con->physical.path, con->http_status); -+ buffer_append_string_len(con->physical.path, CONST_STR_LEN(".html")); - - if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) { - con->file_finished = 1; -@@ -470,57 +485,34 @@ - b = chunkqueue_get_append_buffer(con->write_queue); - - /* build default error-page */ -- buffer_copy_string(b, -+ buffer_copy_string_len(b, CONST_STR_LEN( - "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n" - "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" - " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" - "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n" - " <head>\n" -- " <title>"); -+ " <title>")); - buffer_append_long(b, con->http_status); -- buffer_append_string(b, " - "); -+ buffer_append_string_len(b, CONST_STR_LEN(" - ")); - buffer_append_string(b, get_http_status_name(con->http_status)); - -- buffer_append_string(b, -+ buffer_append_string_len(b, CONST_STR_LEN( - "</title>\n" - " </head>\n" - " <body>\n" -- " <h1>"); -+ " <h1>")); - buffer_append_long(b, con->http_status); -- buffer_append_string(b, " - "); -+ buffer_append_string_len(b, CONST_STR_LEN(" - ")); - buffer_append_string(b, get_http_status_name(con->http_status)); - -- buffer_append_string(b,"</h1>\n" -+ buffer_append_string_len(b, CONST_STR_LEN("</h1>\n" - " </body>\n" - "</html>\n" -- ); -+ )); ++ default: ++ s = ""; ++ break; ++ } + cgi_env_add(&env, CONST_STR_LEN("SERVER_ADDR"), s, strlen(s)); - response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html")); + s = get_http_method_name(con->request.http_method); +@@ -848,15 +860,27 @@ } <<Diff was trimmed, longer than 597 lines>> ---- CVS-web: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/lighttpd-branch.diff?r1=1.40&r2=1.41&f=u http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/lighttpd-branch.sh?r1=1.5&r2=1.6&f=u _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
