2 Index: src/connections.c
3 ===================================================================
4 --- src/connections.c (.../tags/lighttpd-1.4.26)
5 +++ src/connections.c (.../branches/lighttpd-1.4.x)
8 if (-1 == con->ndx) return -1;
10 + buffer_reset(con->uri.authority);
11 + buffer_reset(con->uri.path);
12 + buffer_reset(con->uri.query);
13 + buffer_reset(con->request.orig_uri);
17 /* not last element */
19 ===================================================================
20 --- src/network.c (.../tags/lighttpd-1.4.26)
21 +++ src/network.c (.../branches/lighttpd-1.4.x)
23 buffer_copy_string(con->tlsext_server_name, servername);
24 buffer_to_lower(con->tlsext_server_name);
26 + /* Sometimes this is still set, confusing COMP_HTTP_HOST */
27 + buffer_reset(con->uri.authority);
29 config_cond_cache_reset(srv, con);
30 config_setup_connection(srv, con);
34 if (!s->ssl_use_sslv2) {
36 - if (SSL_OP_NO_SSLv2 != SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv2)) {
37 + if (!(SSL_OP_NO_SSLv2 & SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv2))) {
38 log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
39 ERR_error_string(ERR_get_error(), NULL));
42 ===================================================================
43 --- src/response.c (.../tags/lighttpd-1.4.26)
44 +++ src/response.c (.../branches/lighttpd-1.4.x)
52 SSL_get_verify_result(con->ssl) != X509_V_OK
53 || !(xs = SSL_get_peer_certificate(con->ssl))
57 xn = X509_get_subject_name(xs);
58 - for (int i = 0, nentries = X509_NAME_entry_count(xn); i < nentries; ++i) {
59 + for (i = 0, nentries = X509_NAME_entry_count(xn); i < nentries; ++i) {
66 if (S_ISDIR(sce->st.st_mode)) {
67 - if (con->physical.path->ptr[con->physical.path->used - 2] != '/') {
68 + if (con->uri.path->ptr[con->uri.path->used - 2] != '/') {
69 /* redirect to .../ */
71 http_response_redirect_to_directory(srv, con);
72 Index: src/mod_proxy.c
73 ===================================================================
74 --- src/mod_proxy.c (.../tags/lighttpd-1.4.26)
75 +++ src/mod_proxy.c (.../branches/lighttpd-1.4.x)
81 + hctx->host->usage--;
84 handler_ctx_free(hctx);
85 con->plugin_ctx[p->id] = NULL;
88 if (-1 == ret) { /* error on our side */
89 log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno);
91 - return HANDLER_WAIT_FOR_EVENT;
92 + return HANDLER_ERROR;
93 } else if (-2 == ret) { /* remote close */
94 log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed, remote connection close:", strerror(errno), errno);
96 - return HANDLER_WAIT_FOR_EVENT;
97 + return HANDLER_ERROR;
100 if (hctx->wb->bytes_out == hctx->wb->bytes_in) {
105 - hctx->host->usage--;
108 proxy_connection_close(srv, hctx);
110 @@ -1077,8 +1079,11 @@
111 return HANDLER_FINISHED;
114 + if (!con->file_finished) {
115 + http_chunk_append_mem(srv, con, NULL, 0);
118 con->file_finished = 1;
120 proxy_connection_close(srv, hctx);
121 joblist_append(srv, con);
122 } else if (revents & FDEVENT_ERR) {
123 @@ -1086,6 +1091,7 @@
125 log_error_write(srv, __FILE__, __LINE__, "sd", "proxy-FDEVENT_ERR, but no HUP", revents);
127 + con->file_finished = 1;
128 joblist_append(srv, con);
129 proxy_connection_close(srv, hctx);
131 Index: src/Makefile.am
132 ===================================================================
133 --- src/Makefile.am (.../tags/lighttpd-1.4.26)
134 +++ src/Makefile.am (.../branches/lighttpd-1.4.x)
139 - if test -z "$$REVISION" -a -x "`which git`"; then \
140 + if test -z "$$REVISION" -a -d "$(top_srcdir)/.git" -a -x "`which git`"; then \
141 REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
143 if test -n "$$REVISION"; then \
144 Index: src/mod_compress.c
145 ===================================================================
146 --- src/mod_compress.c (.../tags/lighttpd-1.4.26)
147 +++ src/mod_compress.c (.../branches/lighttpd-1.4.x)
149 int accept_encoding = 0;
150 char *value = ds->value->ptr;
151 int matched_encodings = 0;
152 + int use_etag = sce->etag != NULL && sce->etag->ptr != NULL;
154 /* get client side support encodings */
156 @@ -770,12 +771,14 @@
157 mtime = strftime_cache_get(srv, sce->st.st_mtime);
159 /* try matching original etag of uncompressed version */
160 - etag_mutate(con->physical.etag, sce->etag);
161 - if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
162 - response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
163 - response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
164 - response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
165 - return HANDLER_FINISHED;
167 + etag_mutate(con->physical.etag, sce->etag);
168 + if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
169 + response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
170 + response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
171 + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
172 + return HANDLER_FINISHED;
176 /* select best matching encoding */
177 @@ -790,22 +793,26 @@
178 compression_name = dflt_deflate;
181 - /* try matching etag of compressed version */
182 - buffer_copy_string_buffer(srv->tmp_buf, sce->etag);
183 - buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("-"));
184 - buffer_append_string(srv->tmp_buf, compression_name);
185 - etag_mutate(con->physical.etag, srv->tmp_buf);
187 + /* try matching etag of compressed version */
188 + buffer_copy_string_buffer(srv->tmp_buf, sce->etag);
189 + buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("-"));
190 + buffer_append_string(srv->tmp_buf, compression_name);
191 + etag_mutate(con->physical.etag, srv->tmp_buf);
194 if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
195 response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
196 response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
197 response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
198 - response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
200 + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
202 return HANDLER_FINISHED;
206 - if (p->conf.compress_cache_dir->used) {
207 + if (use_etag && p->conf.compress_cache_dir->used) {
208 if (0 != deflate_file_to_file(srv, con, p, con->physical.path, sce, compression_type))
209 return HANDLER_GO_ON;
213 response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
214 response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
215 - response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
217 + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
219 response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
220 /* let mod_staticfile handle the cached compressed files, physical path was modified */
221 return p->conf.compress_cache_dir->used ? HANDLER_GO_ON : HANDLER_FINISHED;
223 ===================================================================
225 ===================================================================
227 ===================================================================
228 --- NEWS (.../tags/lighttpd-1.4.26)
229 +++ NEWS (.../branches/lighttpd-1.4.x)
236 + * Fix handling return value of SSL_CTX_set_options (fixes #2157, thx mlcreech)
237 + * Fix mod_proxy HUP handling (send final chunk, fix usage counter)
238 + * mod_proxy: close connection on write error (fixes #2114)
239 + * Check uri instead of physical path for directory redirect
240 + * Fix detecting git repository (fixes #2173, thx ncopa)
241 + * [mod_compress] Fix segfault when etags are disabled (fixes #2169)
242 + * Reset uri.authority before TLS servername handling, reset all "keep-alive" data in connection_del (fixes #2125)
244 +- 1.4.26 - 2010-02-07
245 * Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105)
246 * Remove dependency on automake >= 1.11 with m4_ifdef check
247 * mod_accesslog: support %e (fixes #2113, thx presbrey)
248 Index: CMakeLists.txt
249 ===================================================================