]>
Commit | Line | Data |
---|---|---|
4ae864ca ER |
1 | # Revision 2724 |
2 | Index: src/connections.c | |
3 | =================================================================== | |
4 | --- src/connections.c (.../tags/lighttpd-1.4.26) | |
5 | +++ src/connections.c (.../branches/lighttpd-1.4.x) | |
6 | @@ -82,6 +82,11 @@ | |
7 | ||
8 | if (-1 == con->ndx) return -1; | |
9 | ||
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); | |
14 | + | |
15 | i = con->ndx; | |
16 | ||
17 | /* not last element */ | |
6422e148 AM |
18 | Index: src/network.c |
19 | =================================================================== | |
20 | --- src/network.c (.../tags/lighttpd-1.4.26) | |
21 | +++ src/network.c (.../branches/lighttpd-1.4.x) | |
4ae864ca ER |
22 | @@ -82,6 +82,9 @@ |
23 | buffer_copy_string(con->tlsext_server_name, servername); | |
24 | buffer_to_lower(con->tlsext_server_name); | |
25 | ||
26 | + /* Sometimes this is still set, confusing COMP_HTTP_HOST */ | |
27 | + buffer_reset(con->uri.authority); | |
28 | + | |
29 | config_cond_cache_reset(srv, con); | |
30 | config_setup_connection(srv, con); | |
31 | ||
32 | @@ -525,7 +528,7 @@ | |
6422e148 AM |
33 | |
34 | if (!s->ssl_use_sslv2) { | |
35 | /* disable 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)); | |
9d2ca5f8 | 40 | return -1; |
4ae864ca ER |
41 | Index: src/response.c |
42 | =================================================================== | |
43 | --- src/response.c (.../tags/lighttpd-1.4.26) | |
44 | +++ src/response.c (.../branches/lighttpd-1.4.x) | |
45 | @@ -136,6 +136,8 @@ | |
46 | X509 *xs; | |
47 | X509_NAME *xn; | |
48 | X509_NAME_ENTRY *xe; | |
49 | + int i, nentries; | |
50 | + | |
51 | if ( | |
52 | SSL_get_verify_result(con->ssl) != X509_V_OK | |
53 | || !(xs = SSL_get_peer_certificate(con->ssl)) | |
54 | @@ -144,7 +146,7 @@ | |
55 | } | |
56 | ||
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) { | |
60 | int xobjnid; | |
61 | const char * xobjsn; | |
62 | data_string *envds; | |
63 | @@ -581,7 +583,7 @@ | |
64 | }; | |
65 | #endif | |
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 .../ */ | |
70 | ||
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) | |
76 | @@ -349,6 +349,10 @@ | |
77 | srv->cur_fds--; | |
78 | } | |
79 | ||
80 | + if (hctx->host) { | |
81 | + hctx->host->usage--; | |
82 | + } | |
83 | + | |
84 | handler_ctx_free(hctx); | |
85 | con->plugin_ctx[p->id] = NULL; | |
86 | } | |
87 | @@ -848,11 +852,11 @@ | |
88 | if (-1 == ret) { /* error on our side */ | |
89 | log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno); | |
90 | ||
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); | |
95 | ||
96 | - return HANDLER_WAIT_FOR_EVENT; | |
97 | + return HANDLER_ERROR; | |
98 | } | |
99 | ||
100 | if (hctx->wb->bytes_out == hctx->wb->bytes_in) { | |
101 | @@ -989,8 +993,6 @@ | |
102 | case 0: | |
103 | break; | |
104 | case 1: | |
105 | - hctx->host->usage--; | |
106 | - | |
107 | /* we are done */ | |
108 | proxy_connection_close(srv, hctx); | |
109 | ||
110 | @@ -1077,8 +1079,11 @@ | |
111 | return HANDLER_FINISHED; | |
112 | } | |
113 | ||
114 | + if (!con->file_finished) { | |
115 | + http_chunk_append_mem(srv, con, NULL, 0); | |
116 | + } | |
117 | + | |
118 | con->file_finished = 1; | |
119 | - | |
120 | proxy_connection_close(srv, hctx); | |
121 | joblist_append(srv, con); | |
122 | } else if (revents & FDEVENT_ERR) { | |
123 | @@ -1086,6 +1091,7 @@ | |
124 | ||
125 | log_error_write(srv, __FILE__, __LINE__, "sd", "proxy-FDEVENT_ERR, but no HUP", revents); | |
126 | ||
127 | + con->file_finished = 1; | |
128 | joblist_append(srv, con); | |
129 | proxy_connection_close(srv, hctx); | |
130 | } | |
131 | Index: src/Makefile.am | |
132 | =================================================================== | |
133 | --- src/Makefile.am (.../tags/lighttpd-1.4.26) | |
134 | +++ src/Makefile.am (.../branches/lighttpd-1.4.x) | |
135 | @@ -19,7 +19,7 @@ | |
136 | REVISION=""; \ | |
137 | fi; \ | |
138 | fi; \ | |
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)"; \ | |
142 | fi; \ | |
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) | |
148 | @@ -744,6 +744,7 @@ | |
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; | |
153 | ||
154 | /* get client side support encodings */ | |
155 | #ifdef USE_ZLIB | |
156 | @@ -770,12 +771,14 @@ | |
157 | mtime = strftime_cache_get(srv, sce->st.st_mtime); | |
158 | ||
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; | |
166 | + if (use_etag) { | |
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; | |
173 | + } | |
174 | } | |
175 | ||
176 | /* select best matching encoding */ | |
177 | @@ -790,22 +793,26 @@ | |
178 | compression_name = dflt_deflate; | |
179 | } | |
180 | ||
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); | |
186 | + if (use_etag) { | |
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); | |
192 | + } | |
193 | ||
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)); | |
199 | + if (use_etag) { | |
200 | + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); | |
201 | + } | |
202 | return HANDLER_FINISHED; | |
203 | } | |
204 | ||
205 | /* deflate it */ | |
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; | |
210 | } else { | |
211 | @@ -814,7 +821,9 @@ | |
212 | } | |
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)); | |
216 | + if (use_etag) { | |
217 | + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); | |
218 | + } | |
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; | |
ceb30c4b ER |
222 | Index: configure.ac |
223 | =================================================================== | |
ceb30c4b ER |
224 | Index: SConstruct |
225 | =================================================================== | |
226 | Index: NEWS | |
227 | =================================================================== | |
6422e148 | 228 | --- NEWS (.../tags/lighttpd-1.4.26) |
cc37bbfb | 229 | +++ NEWS (.../branches/lighttpd-1.4.x) |
4ae864ca | 230 | @@ -3,7 +3,16 @@ |
ceb30c4b ER |
231 | NEWS |
232 | ==== | |
233 | ||
6422e148 AM |
234 | -- 1.4.26 - |
235 | +- 1.4.27 - | |
236 | + * Fix handling return value of SSL_CTX_set_options (fixes #2157, thx mlcreech) | |
4ae864ca ER |
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) | |
9a17f7bd | 243 | + |
6422e148 AM |
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) | |
ceb30c4b ER |
248 | Index: CMakeLists.txt |
249 | =================================================================== |