]> git.pld-linux.org Git - packages/lighttpd.git/blame - lighttpd-branch.diff
- update to r2392 (PRE-RELEASE: 1.4.21-r2392)
[packages/lighttpd.git] / lighttpd-branch.diff
CommitLineData
170f212a
ER
1Index: cmake/LighttpdMacros.cmake
2===================================================================
3--- cmake/LighttpdMacros.cmake (.../tags/lighttpd-1.4.20) (revision 0)
25fbab93 4+++ cmake/LighttpdMacros.cmake (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
5@@ -0,0 +1,43 @@
6+## our modules are without the "lib" prefix
7+
8+MACRO(ADD_AND_INSTALL_LIBRARY LIBNAME SRCFILES)
9+ IF(BUILD_STATIC)
10+ ADD_LIBRARY(${LIBNAME} STATIC ${SRCFILES})
11+ TARGET_LINK_LIBRARIES(lighttpd ${LIBNAME})
12+ ELSE(BUILD_STATIC)
13+ ADD_LIBRARY(${LIBNAME} SHARED ${SRCFILES})
14+ SET(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} ${LIBNAME})
15+ ## Windows likes to link it this way back to app!
16+ IF(WIN32)
17+ SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES LINK_FLAGS lighttpd.lib)
18+ ENDIF(WIN32)
19+
20+ IF(APPLE)
21+ SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
22+ ENDIF(APPLE)
23+ ENDIF(BUILD_STATIC)
24+ENDMACRO(ADD_AND_INSTALL_LIBRARY)
25+
26+MACRO(LEMON_PARSER SRCFILE)
27+ GET_FILENAME_COMPONENT(SRCBASE ${SRCFILE} NAME_WE)
28+ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.c ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.h
29+ COMMAND ${CMAKE_BINARY_DIR}/build/lemon
30+ ARGS -q ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
31+ DEPENDS ${CMAKE_BINARY_DIR}/build/lemon ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
32+ COMMENT "Generating ${SRCBASE}.c from ${SRCFILE}"
33+)
34+ENDMACRO(LEMON_PARSER)
35+
36+MACRO(ADD_TARGET_PROPERTIES _target _name)
37+ SET(_properties)
38+ FOREACH(_prop ${ARGN})
39+ SET(_properties "${_properties} ${_prop}")
40+ ENDFOREACH(_prop)
41+ GET_TARGET_PROPERTY(_old_properties ${_target} ${_name})
42+ MESSAGE("adding property to ${_target} ${_name}:" ${_properties})
43+ IF(NOT _old_properties)
44+ # in case it's NOTFOUND
45+ SET(_old_properties)
46+ ENDIF(NOT _old_properties)
47+ SET_TARGET_PROPERTIES(${_target} PROPERTIES ${_name} "${_old_properties} ${_properties}")
48+ENDMACRO(ADD_TARGET_PROPERTIES)
709c1a0b 49Index: configure.in
54b68997 50===================================================================
709c1a0b 51Index: src/configfile-glue.c
54b68997 52===================================================================
25fbab93
ER
53--- src/configfile-glue.c (.../tags/lighttpd-1.4.20) (revision 2392)
54+++ src/configfile-glue.c (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
55@@ -1,4 +1,5 @@
56 #include <string.h>
57+#include <stdlib.h>
58
59 #include "base.h"
60 #include "buffer.h"
61@@ -90,6 +91,22 @@
62 case TYPE_STRING: {
63 data_string *ds = (data_string *)du;
64
65+ /* If the value came from an environment variable, then it is a
66+ * data_string, although it may contain a number in ASCII
67+ * decimal format. We try to interpret the string as a decimal
68+ * short before giving up, in order to support setting numeric
69+ * values with environment variables (eg, port number).
70+ */
71+ if (ds->value->ptr && *ds->value->ptr) {
72+ char *e;
73+ long l = strtol(ds->value->ptr, &e, 10);
74+ if (e != ds->value->ptr && !*e && l >=0 && l <= 65535) {
75+ *((unsigned short *)(cv[i].destination)) = l;
76+ break;
77+
78+ }
79+ }
80+
81 log_error_write(srv, __FILE__, __LINE__, "ssb", "got a string but expected a short:", cv[i].key, ds->value);
54b68997 82
709c1a0b 83 return -1;
25fbab93
ER
84@@ -396,6 +413,15 @@
85
86 break;
87 }
88+ case COMP_HTTP_LANGUAGE: {
89+ data_string *ds;
90+ if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Accept-Language"))) {
91+ l = ds->value;
92+ } else {
93+ l = srv->empty_string;
94+ }
95+ break;
96+ }
97 default:
98 return COND_RESULT_FALSE;
99 }
709c1a0b 100Index: src/mod_cgi.c
54b68997 101===================================================================
25fbab93
ER
102--- src/mod_cgi.c (.../tags/lighttpd-1.4.20) (revision 2392)
103+++ src/mod_cgi.c (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
104@@ -822,15 +822,27 @@
105 );
106 cgi_env_add(&env, CONST_STR_LEN("SERVER_PORT"), buf, strlen(buf));
107
108+ switch (srv_sock->addr.plain.sa_family) {
109 #ifdef HAVE_IPV6
110- s = inet_ntop(srv_sock->addr.plain.sa_family,
111- srv_sock->addr.plain.sa_family == AF_INET6 ?
112- (const void *) &(srv_sock->addr.ipv6.sin6_addr) :
113- (const void *) &(srv_sock->addr.ipv4.sin_addr),
114- b2, sizeof(b2)-1);
115+ case AF_INET6:
116+ s = inet_ntop(srv_sock->addr.plain.sa_family,
117+ (const void *) &(srv_sock->addr.ipv6.sin6_addr),
118+ b2, sizeof(b2)-1);
119+ break;
120+ case AF_INET:
121+ s = inet_ntop(srv_sock->addr.plain.sa_family,
122+ (const void *) &(srv_sock->addr.ipv4.sin_addr),
123+ b2, sizeof(b2)-1);
124+ break;
125 #else
126- s = inet_ntoa(srv_sock->addr.ipv4.sin_addr);
127+ case AF_INET:
128+ s = inet_ntoa(srv_sock->addr.ipv4.sin_addr);
129+ break;
130 #endif
131+ default:
132+ s = "";
133+ break;
134+ }
135 cgi_env_add(&env, CONST_STR_LEN("SERVER_ADDR"), s, strlen(s));
54b68997 136
709c1a0b
ER
137 s = get_http_method_name(con->request.http_method);
138@@ -848,15 +860,27 @@
139 }
54b68997
ER
140
141
709c1a0b
ER
142+ switch (con->dst_addr.plain.sa_family) {
143 #ifdef HAVE_IPV6
144- s = inet_ntop(con->dst_addr.plain.sa_family,
145- con->dst_addr.plain.sa_family == AF_INET6 ?
146- (const void *) &(con->dst_addr.ipv6.sin6_addr) :
147- (const void *) &(con->dst_addr.ipv4.sin_addr),
148- b2, sizeof(b2)-1);
149+ case AF_INET6:
150+ s = inet_ntop(con->dst_addr.plain.sa_family,
151+ (const void *) &(con->dst_addr.ipv6.sin6_addr),
152+ b2, sizeof(b2)-1);
153+ break;
154+ case AF_INET:
155+ s = inet_ntop(con->dst_addr.plain.sa_family,
156+ (const void *) &(con->dst_addr.ipv4.sin_addr),
157+ b2, sizeof(b2)-1);
158+ break;
159 #else
160- s = inet_ntoa(con->dst_addr.ipv4.sin_addr);
161+ case AF_INET:
162+ s = inet_ntoa(con->dst_addr.ipv4.sin_addr);
163+ break;
164 #endif
165+ default:
166+ s = "";
167+ break;
54b68997 168+ }
709c1a0b 169 cgi_env_add(&env, CONST_STR_LEN("REMOTE_ADDR"), s, strlen(s));
54b68997 170
709c1a0b 171 LI_ltostr(buf,
738baab9
ER
172Index: src/base.h
173===================================================================
25fbab93
ER
174--- src/base.h (.../tags/lighttpd-1.4.20) (revision 2392)
175+++ src/base.h (.../branches/lighttpd-1.4.x) (revision 2392)
176@@ -260,6 +260,7 @@
177 unsigned short log_response_header;
178 unsigned short log_condition_handling;
179 unsigned short log_ssl_noise;
180+ unsigned short log_timeouts;
181
182
183 /* server wide */
184@@ -497,6 +498,7 @@
738baab9
ER
185 #endif
186 } stat_cache_engine;
187 unsigned short enable_cores;
188+ unsigned short reject_expect_100_with_417;
189 } server_config;
190
191 typedef struct {
170f212a
ER
192Index: src/mod_rewrite.c
193===================================================================
25fbab93
ER
194--- src/mod_rewrite.c (.../tags/lighttpd-1.4.20) (revision 2392)
195+++ src/mod_rewrite.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
196@@ -350,11 +350,7 @@
197
198 if (!p->conf.rewrite) return HANDLER_GO_ON;
199
200- buffer_copy_string_buffer(p->match_buf, con->uri.path);
201- if (con->uri.query->used > 0) {
202- buffer_append_string_len(p->match_buf, CONST_STR_LEN("?"));
203- buffer_append_string_buffer(p->match_buf, con->uri.query);
204- }
205+ buffer_copy_string_buffer(p->match_buf, con->request.uri);
206
207 for (i = 0; i < p->conf.rewrite->used; i++) {
208 pcre *match;
709c1a0b
ER
209Index: src/connections.c
210===================================================================
25fbab93
ER
211--- src/connections.c (.../tags/lighttpd-1.4.20) (revision 2392)
212+++ src/connections.c (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
213@@ -330,15 +330,13 @@
214 buffer_prepare_copy(b, 4 * 1024);
215 len = recv(con->fd, b->ptr, b->size - 1, 0);
216 #else
217- if (ioctl(con->fd, FIONREAD, &toread)) {
218- log_error_write(srv, __FILE__, __LINE__, "sd",
219- "unexpected end-of-file:",
220- con->fd);
221- return -1;
222+ if (ioctl(con->fd, FIONREAD, &toread) || toread == 0) {
223+ b = chunkqueue_get_append_buffer(con->read_queue);
224+ buffer_prepare_copy(b, 4 * 1024);
54b68997 225+ } else {
709c1a0b
ER
226+ b = chunkqueue_get_append_buffer(con->read_queue);
227+ buffer_prepare_copy(b, toread + 1);
54b68997 228 }
709c1a0b
ER
229- b = chunkqueue_get_append_buffer(con->read_queue);
230- buffer_prepare_copy(b, toread + 1);
231-
232 len = read(con->fd, b->ptr, b->size - 1);
233 #endif
54b68997 234
170f212a
ER
235@@ -1066,6 +1064,9 @@
236 if (dst_c->file.fd == -1) {
237 /* this should not happen as we cache the fd, but you never know */
238 dst_c->file.fd = open(dst_c->file.name->ptr, O_WRONLY | O_APPEND);
239+#ifdef FD_CLOEXEC
240+ fcntl(dst_c->file.fd, F_SETFD, FD_CLOEXEC);
241+#endif
242 }
243 } else {
244 /* the chunk is too large now, close it */
25fbab93
ER
245Index: src/array.h
246===================================================================
247--- src/array.h (.../tags/lighttpd-1.4.20) (revision 2392)
248+++ src/array.h (.../branches/lighttpd-1.4.x) (revision 2392)
249@@ -87,6 +87,7 @@
250 COMP_HTTP_HOST,
251 COMP_HTTP_REFERER,
252 COMP_HTTP_USER_AGENT,
253+ COMP_HTTP_LANGUAGE,
254 COMP_HTTP_COOKIE,
255 COMP_HTTP_REMOTE_IP,
256 COMP_HTTP_QUERY_STRING,
170f212a
ER
257Index: src/mod_alias.c
258===================================================================
25fbab93
ER
259--- src/mod_alias.c (.../tags/lighttpd-1.4.20) (revision 2392)
260+++ src/mod_alias.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
261@@ -103,9 +103,8 @@
262 }
263 /* ok, they have same prefix. check position */
264 if (a->sorted[j] < a->sorted[k]) {
265- fprintf(stderr, "url.alias: `%s' will never match as `%s' matched first\n",
266- key->ptr,
267- prefix->ptr);
268+ log_error_write(srv, __FILE__, __LINE__, "SBSBS",
269+ "url.alias: `", key, "' will never match as `", prefix, "' matched first");
270 return HANDLER_ERROR;
271 }
272 }
709c1a0b
ER
273Index: src/configfile.c
274===================================================================
25fbab93
ER
275--- src/configfile.c (.../tags/lighttpd-1.4.20) (revision 2392)
276+++ src/configfile.c (.../branches/lighttpd-1.4.x) (revision 2392)
277@@ -91,9 +91,11 @@
278 { "server.core-files", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 46 */
279 { "ssl.cipher-list", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 47 */
280 { "ssl.use-sslv2", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 48 */
281- { "etag.use-inode", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
282- { "etag.use-mtime", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
283- { "etag.use-size", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
284+ { "etag.use-inode", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
285+ { "etag.use-mtime", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
286+ { "etag.use-size", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
738baab9 287+ { "server.reject-expect-100-with-417", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 52 */
25fbab93 288+ { "debug.log-timeouts", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 53 */
738baab9
ER
289 { "server.host", "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
290 { "server.docroot", "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
291 { "server.virtual-root", "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
25fbab93 292@@ -135,6 +137,7 @@
738baab9
ER
293
294 cv[43].destination = &(srv->srvconf.max_conns);
295 cv[12].destination = &(srv->srvconf.max_request_size);
296+ cv[52].destination = &(srv->srvconf.reject_expect_100_with_417);
297 srv->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
298
299 assert(srv->config_storage);
25fbab93 300@@ -159,7 +162,7 @@
738baab9
ER
301 s->max_write_idle = 360;
302 s->use_xattr = 0;
303 s->is_ssl = 0;
304- s->ssl_use_sslv2 = 1;
305+ s->ssl_use_sslv2 = 0;
306 s->use_ipv6 = 0;
307 #ifdef HAVE_LSTAT
308 s->follow_symlink = 1;
25fbab93
ER
309@@ -207,6 +210,7 @@
310 cv[33].destination = &(s->log_response_header);
311 cv[34].destination = &(s->log_request_header);
312 cv[35].destination = &(s->log_ssl_noise);
313+ cv[53].destination = &(s->log_timeouts);
314
315 cv[36].destination = &(s->allow_http11);
316 cv[39].destination = s->ssl_ca_file;
317@@ -374,6 +378,8 @@
318 PATCH(log_file_not_found);
319 } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("debug.log-ssl-noise"))) {
320 PATCH(log_ssl_noise);
321+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("debug.log-timeouts"))) {
322+ PATCH(log_timeouts);
323 } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.protocol-http11"))) {
324 PATCH(allow_http11);
325 } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("server.force-lowercase-filenames"))) {
326@@ -940,7 +946,6 @@
54b68997
ER
327 }
328
709c1a0b
ER
329 int config_parse_cmd(server *srv, config_t *context, const char *cmd) {
330- proc_handler_t proc;
331 tokenizer_t t;
332 int ret;
333 buffer *source;
25fbab93 334@@ -960,7 +965,7 @@
709c1a0b
ER
335 chdir(context->basedir->ptr);
336 }
54b68997 337
709c1a0b
ER
338- if (0 != proc_open_buffer(&proc, cmd, NULL, out, NULL)) {
339+ if (0 != proc_open_buffer(cmd, NULL, out, NULL)) {
340 log_error_write(srv, __FILE__, __LINE__, "sbss",
341 "opening", source, "failed:", strerror(errno));
342 ret = -1;
170f212a
ER
343Index: src/mod_trigger_b4_dl.c
344===================================================================
25fbab93
ER
345--- src/mod_trigger_b4_dl.c (.../tags/lighttpd-1.4.20) (revision 2392)
346+++ src/mod_trigger_b4_dl.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
347@@ -1,5 +1,6 @@
348 #include <ctype.h>
349 #include <stdlib.h>
350+#include <fcntl.h>
351 #include <string.h>
352
353 #include "base.h"
354@@ -180,6 +181,9 @@
355 "gdbm-open failed");
356 return HANDLER_ERROR;
357 }
358+#ifdef FD_CLOEXEC
359+ fcntl(gdbm_fdesc(s->db), F_SETFD, FD_CLOEXEC);
360+#endif
361 }
362 #endif
363 #if defined(HAVE_PCRE_H)
364Index: src/mod_mysql_vhost.c
365===================================================================
25fbab93
ER
366--- src/mod_mysql_vhost.c (.../tags/lighttpd-1.4.20) (revision 2392)
367+++ src/mod_mysql_vhost.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
368@@ -245,7 +245,6 @@
369 if (!(buffer_is_empty(s->myuser) ||
370 buffer_is_empty(s->mydb))) {
371 my_bool reconnect = 1;
372- int fd;
373
374 if (NULL == (s->mysql = mysql_init(NULL))) {
375 log_error_write(srv, __FILE__, __LINE__, "s", "mysql_init() failed, exiting...");
376@@ -267,19 +266,27 @@
377 return HANDLER_ERROR;
378 }
379 #undef FOO
380+
381+#if 0
382 /* set close_on_exec for mysql the hard way */
383 /* Note: this only works as it is done during startup, */
384 /* otherwise we cannot be sure that mysql is fd i-1 */
385- if (-1 == (fd = open("/dev/null", 0))) {
386+ { int fd;
387+ if (-1 != (fd = open("/dev/null", 0))) {
388 close(fd);
389+#ifdef FD_CLOEXEC
390 fcntl(fd-1, F_SETFD, FD_CLOEXEC);
391- }
392+#endif
393+ } }
394+#else
395+#ifdef FD_CLOEXEC
396+ fcntl(s->mysql->net.fd, F_SETFD, FD_CLOEXEC);
397+#endif
398+#endif
399 }
400 }
401
402-
403-
404- return HANDLER_GO_ON;
405+ return HANDLER_GO_ON;
406 }
407
408 #define PATCH(x) \
738baab9
ER
409Index: src/request.c
410===================================================================
25fbab93
ER
411--- src/request.c (.../tags/lighttpd-1.4.20) (revision 2392)
412+++ src/request.c (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9
ER
413@@ -894,11 +894,12 @@
414 *
415 */
416
417- con->http_status = 417;
418- con->keep_alive = 0;
419-
420- array_insert_unique(con->request.headers, (data_unset *)ds);
421- return 0;
422+ if (srv->srvconf.reject_expect_100_with_417 && 0 == buffer_caseless_compare(CONST_BUF_LEN(ds->value), CONST_STR_LEN("100-continue"))) {
423+ con->http_status = 417;
424+ con->keep_alive = 0;
425+ array_insert_unique(con->request.headers, (data_unset *)ds);
426+ return 0;
427+ }
428 } else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Host")))) {
429 if (!con->request.http_host) {
430 con->request.http_host = ds->value;
25fbab93
ER
431@@ -1020,7 +1021,7 @@
432 /* strip leading WS */
433 if (value == cur) value = cur+1;
434 default:
435- if (*cur >= 0 && *cur < 32) {
436+ if (*cur >= 0 && *cur < 32 && *cur != '\t') {
437 if (srv->srvconf.log_request_header_on_error) {
438 log_error_write(srv, __FILE__, __LINE__, "sds",
439 "invalid char in header", (int)*cur, "-> 400");
170f212a
ER
440Index: src/inet_ntop_cache.c
441===================================================================
25fbab93
ER
442--- src/inet_ntop_cache.c (.../tags/lighttpd-1.4.20) (revision 2392)
443+++ src/inet_ntop_cache.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
444@@ -11,7 +11,7 @@
445 #ifdef HAVE_IPV6
446 size_t ndx = 0, i;
447 for (i = 0; i < INET_NTOP_CACHE_MAX; i++) {
448- if (srv->inet_ntop_cache[i].ts != 0) {
449+ if (srv->inet_ntop_cache[i].ts != 0 && srv->inet_ntop_cache[i].family == addr->plain.sa_family) {
450 if (srv->inet_ntop_cache[i].family == AF_INET6 &&
451 0 == memcmp(srv->inet_ntop_cache[i].addr.ipv6.s6_addr, addr->ipv6.sin6_addr.s6_addr, 16)) {
452 /* IPv6 found in cache */
453Index: src/mod_rrdtool.c
454===================================================================
25fbab93
ER
455--- src/mod_rrdtool.c (.../tags/lighttpd-1.4.20) (revision 2392)
456+++ src/mod_rrdtool.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
457@@ -179,6 +179,11 @@
458 p->read_fd = from_rrdtool_fds[0];
459 p->rrdtool_pid = pid;
460
461+#ifdef FD_CLOEXEC
462+ fcntl(p->write_fd, F_SETFD, FD_CLOEXEC);
463+ fcntl(p->read_fd, F_SETFD, FD_CLOEXEC);
464+#endif
465+
466 break;
467 }
468 }
2ed0f534
ER
469Index: src/response.c
470===================================================================
25fbab93
ER
471--- src/response.c (.../tags/lighttpd-1.4.20) (revision 2392)
472+++ src/response.c (.../branches/lighttpd-1.4.x) (revision 2392)
2ed0f534
ER
473@@ -44,16 +44,15 @@
474 buffer_append_string(b, get_http_status_name(con->http_status));
475
476 if (con->request.http_version != HTTP_VERSION_1_1 || con->keep_alive == 0) {
477- buffer_append_string_len(b, CONST_STR_LEN("\r\nConnection: "));
478 if (con->keep_alive) {
479- buffer_append_string_len(b, CONST_STR_LEN("keep-alive"));
480+ response_header_overwrite(srv, con, CONST_STR_LEN("Connection"), CONST_STR_LEN("keep-alive"));
481 } else {
482- buffer_append_string_len(b, CONST_STR_LEN("close"));
483+ response_header_overwrite(srv, con, CONST_STR_LEN("Connection"), CONST_STR_LEN("close"));
484 }
485 }
486
487 if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
488- buffer_append_string_len(b, CONST_STR_LEN("\r\nTransfer-Encoding: chunked"));
489+ response_header_overwrite(srv, con, CONST_STR_LEN("Transfer-Encoding"), CONST_STR_LEN("chunked"));
490 }
491
492
25fbab93
ER
493@@ -199,6 +198,7 @@
494 config_patch_connection(srv, con, COMP_HTTP_REMOTE_IP); /* Client-IP */
495 config_patch_connection(srv, con, COMP_HTTP_REFERER); /* Referer: */
496 config_patch_connection(srv, con, COMP_HTTP_USER_AGENT);/* User-Agent: */
497+ config_patch_connection(srv, con, COMP_HTTP_LANGUAGE); /* Accept-Language: */
498 config_patch_connection(srv, con, COMP_HTTP_COOKIE); /* Cookie: */
499 config_patch_connection(srv, con, COMP_HTTP_REQUEST_METHOD); /* REQUEST_METHOD */
500
501@@ -233,6 +233,27 @@
170f212a
ER
502 }
503
504
505+ /**
506+ *
507+ * call plugins
508+ *
509+ * - based on the raw URL
510+ *
511+ */
512+
513+ switch(r = plugins_call_handle_uri_raw(srv, con)) {
514+ case HANDLER_GO_ON:
515+ break;
516+ case HANDLER_FINISHED:
517+ case HANDLER_COMEBACK:
518+ case HANDLER_WAIT_FOR_EVENT:
519+ case HANDLER_ERROR:
520+ return r;
521+ default:
522+ log_error_write(srv, __FILE__, __LINE__, "sd", "handle_uri_raw: unknown return value", r);
523+ break;
524+ }
525+
526 /* build filename
527 *
528 * - decode url-encodings (e.g. %20 -> ' ')
25fbab93 529@@ -240,6 +261,7 @@
170f212a
ER
530 */
531
532
533+
534 if (con->request.http_method == HTTP_METHOD_OPTIONS &&
535 con->uri.path_raw->ptr[0] == '*' && con->uri.path_raw->ptr[1] == '\0') {
536 /* OPTIONS * ... */
25fbab93 537@@ -255,32 +277,10 @@
170f212a
ER
538 log_error_write(srv, __FILE__, __LINE__, "sb", "URI-path : ", con->uri.path);
539 }
540
541-
542 /**
543 *
544 * call plugins
545 *
546- * - based on the raw URL
547- *
548- */
549-
550- switch(r = plugins_call_handle_uri_raw(srv, con)) {
551- case HANDLER_GO_ON:
552- break;
553- case HANDLER_FINISHED:
554- case HANDLER_COMEBACK:
555- case HANDLER_WAIT_FOR_EVENT:
556- case HANDLER_ERROR:
557- return r;
558- default:
559- log_error_write(srv, __FILE__, __LINE__, "sd", "handle_uri_raw: unknown return value", r);
560- break;
561- }
562-
563- /**
564- *
565- * call plugins
566- *
567 * - based on the clean URL
568 *
569 */
738baab9
ER
570Index: src/buffer.c
571===================================================================
25fbab93
ER
572--- src/buffer.c (.../tags/lighttpd-1.4.20) (revision 2392)
573+++ src/buffer.c (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9
ER
574@@ -159,7 +159,7 @@
575 if (!src) return -1;
576
577 if (src->used == 0) {
578- b->used = 0;
579+ buffer_reset(b);
580 return 0;
581 }
582 return buffer_copy_string_len(b, src->ptr, src->used - 1);
583@@ -187,6 +187,7 @@
584 if (!s || !b) return -1;
585
586 s_len = strlen(s);
587+ if (s_len > maxlen) s_len = maxlen;
588 buffer_prepare_append(b, maxlen + 1);
589 if (b->used == 0)
590 b->used++;
709c1a0b
ER
591Index: src/mod_simple_vhost.c
592===================================================================
25fbab93
ER
593--- src/mod_simple_vhost.c (.../tags/lighttpd-1.4.20) (revision 2392)
594+++ src/mod_simple_vhost.c (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
595@@ -249,6 +249,8 @@
596 return HANDLER_GO_ON;
597 } else {
598 buffer_copy_string_buffer(con->server_name, p->conf.default_host);
599+ /* do not cache default host */
600+ return HANDLER_GO_ON;
601 }
602 } else {
603 buffer_copy_string_buffer(con->server_name, con->uri.authority);
2ed0f534
ER
604Index: src/mod_proxy.c
605===================================================================
25fbab93
ER
606--- src/mod_proxy.c (.../tags/lighttpd-1.4.20) (revision 2392)
607+++ src/mod_proxy.c (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9
ER
608@@ -454,6 +454,7 @@
609
610 if (ds->value->used && ds->key->used) {
611 if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Connection"))) continue;
612+ if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Proxy-Connection"))) continue;
613
614 buffer_append_string_buffer(b, ds->key);
615 buffer_append_string_len(b, CONST_STR_LEN(": "));
616@@ -652,7 +653,7 @@
170f212a
ER
617 buffer_prepare_append(hctx->response, b + 1);
618 hctx->response->used = 1;
619 } else {
620- buffer_prepare_append(hctx->response, hctx->response->used + b);
621+ buffer_prepare_append(hctx->response, b);
622 }
623
624 if (-1 == (r = read(hctx->fd, hctx->response->ptr + hctx->response->used - 1, b))) {
738baab9 625@@ -1198,7 +1199,8 @@
2ed0f534
ER
626 host = (data_proxy *)extension->value->data[0];
627
628 /* Use last_used_ndx from first host in list */
629- k = ndx = host->last_used_ndx;
630+ k = host->last_used_ndx;
631+ ndx = k + 1; /* use next host after the last one */
632 if (ndx < 0) ndx = 0;
633
634 /* Search first active host after last_used_ndx */
170f212a
ER
635Index: src/config.h.cmake
636===================================================================
637--- src/config.h.cmake (.../tags/lighttpd-1.4.20) (revision 0)
25fbab93 638+++ src/config.h.cmake (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9 639@@ -0,0 +1,157 @@
170f212a
ER
640+/*
641+ CMake autogenerated config.h file. Do not edit!
642+*/
643+
738baab9
ER
644+/* Package details */
645+#define LIGHTTPD_VERSION_ID ${LIGHTTPD_VERSION_ID}
646+#define PACKAGE_NAME "${PACKAGE_NAME}"
647+#define PACKAGE_VERSION "${PACKAGE_VERSION}"
648+#define PACKAGE_BUILD_DATE "${PACKAGE_BUILD_DATE}"
649+#define LIBRARY_DIR "${LIGHTTPD_LIBRARY_DIR}"
650+
170f212a
ER
651+/* System */
652+#cmakedefine HAVE_SYS_DEVPOLL_H
653+#cmakedefine HAVE_SYS_EPOLL_H
654+#cmakedefine HAVE_SYS_EVENT_H
655+#cmakedefine HAVE_SYS_MMAN_H
656+#cmakedefine HAVE_SYS_POLL_H
657+#cmakedefine HAVE_SYS_PORT_H
658+#cmakedefine HAVE_SYS_PRCTL_H
659+#cmakedefine HAVE_SYS_RESOURCE_H
660+#cmakedefine HAVE_SYS_SENDFILE_H
661+#cmakedefine HAVE_SYS_SELECT_H
662+#cmakedefine HAVE_SYS_SYSLIMITS_H
663+#cmakedefine HAVE_SYS_TYPES_H
664+#cmakedefine HAVE_SYS_UIO_H
665+#cmakedefine HAVE_SYS_UN_H
666+#cmakedefine HAVE_SYS_WAIT_H
667+#cmakedefine HAVE_SYS_TIME_H
668+#cmakedefine HAVE_UNISTD_H
669+#cmakedefine HAVE_PTHREAD_H
670+#cmakedefine HAVE_INET_ATON
671+#cmakedefine HAVE_IPV6
672+
673+/* XATTR */
674+#cmakedefine HAVE_ATTR_ATTRIBUTES_H
675+#cmakedefine HAVE_XATTR
676+
677+/* mySQL */
678+#cmakedefine HAVE_MYSQL_H
679+#cmakedefine HAVE_MYSQL
680+
681+/* OpenSSL */
682+#cmakedefine HAVE_OPENSSL_SSL_H
683+#cmakedefine HAVE_LIBCRYPTO
684+#cmakedefine OPENSSL_NO_KRB5
685+#cmakedefine HAVE_LIBSSL
686+
687+/* BZip */
688+#cmakedefine HAVE_BZLIB_H
689+#cmakedefine HAVE_LIBBZ2
690+
691+/* FAM */
692+#cmakedefine HAVE_FAM_H
693+#cmakedefine HAVE_FAMNOEXISTS
694+
695+/* getopt */
696+#cmakedefine HAVE_GETOPT_H
697+
698+#cmakedefine HAVE_INTTYPES_H
699+
700+/* LDAP */
701+#cmakedefine HAVE_LDAP_H
702+#cmakedefine HAVE_LIBLDAP
703+#cmakedefine HAVE_LBER_H
704+#cmakedefine HAVE_LIBLBER
705+#cmakedefine LDAP_DEPRECATED 1
706+
707+/* XML */
708+#cmakedefine HAVE_LIBXML_H
709+#cmakedefine HAVE_LIBXML
710+
711+/* PCRE */
712+#cmakedefine HAVE_PCRE_H
713+#cmakedefine HAVE_LIBPCRE
714+
715+#cmakedefine HAVE_POLL_H
716+#cmakedefine HAVE_PWD_H
717+
718+/* sqlite3 */
719+#cmakedefine HAVE_SQLITE3_H
720+#cmakedefine HAVE_LIBPCRE
721+
722+#cmakedefine HAVE_STDDEF_H
723+#cmakedefine HAVE_STDINT_H
724+#cmakedefine HAVE_SYSLOG_H
725+
726+/* UUID */
727+#cmakedefine HAVE_UUID_UUID_H
728+#cmakedefine HAVE_LIBUUID
729+
730+/* ZLIB */
731+#cmakedefine HAVE_ZLIB_H
732+#cmakedefine HAVE_LIBZ
733+
734+/* lua */
735+#cmakedefine HAVE_LUA_H
736+#cmakedefine HAVE_LIBLUA
737+
738+/* gdbm */
739+#cmakedefine HAVE_GDBM_H
740+#cmakedefine HAVE_GDBM
741+
742+/* memcache */
743+#cmakedefine HAVE_MEMCACHE_H
744+
745+/* inotify */
746+#cmakedefine HAVE_INOTIFY_INIT
747+#cmakedefine HAVE_SYS_INOTIFY_H
748+
749+/* Types */
750+#cmakedefine HAVE_SOCKLEN_T
751+#cmakedefine SIZEOF_LONG ${SIZEOF_LONG}
752+#cmakedefine SIZEOF_OFF_T ${SIZEOF_OFF_T}
753+
754+/* Functions */
755+#cmakedefine HAVE_CHROOT
756+#cmakedefine HAVE_CRYPT
757+#cmakedefine HAVE_EPOLL_CTL
758+#cmakedefine HAVE_FORK
759+#cmakedefine HAVE_GETRLIMIT
760+#cmakedefine HAVE_GETUID
761+#cmakedefine HAVE_GMTIME_R
762+#cmakedefine HAVE_INET_NTOP
763+#cmakedefine HAVE_KQUEUE
764+#cmakedefine HAVE_LOCALTIME_R
765+#cmakedefine HAVE_LSTAT
766+#cmakedefine HAVE_MADVISE
767+#cmakedefine HAVE_MEMCPY
768+#cmakedefine HAVE_MEMSET
769+#cmakedefine HAVE_MMAP
770+#cmakedefine HAVE_PATHCONF
771+#cmakedefine HAVE_POLL
772+#cmakedefine HAVE_PORT_CREATE
773+#cmakedefine HAVE_PRCTL
774+#cmakedefine HAVE_PREAD
775+#cmakedefine HAVE_POSIX_FADVISE
776+#cmakedefine HAVE_SELECT
777+#cmakedefine HAVE_SENDFILE
778+#cmakedefine HAVE_SEND_FILE
779+#cmakedefine HAVE_SENDFILE64
780+#cmakedefine HAVE_SENDFILEV
781+#cmakedefine HAVE_SIGACTION
782+#cmakedefine HAVE_SIGNAL
783+#cmakedefine HAVE_SIGTIMEDWAIT
784+#cmakedefine HAVE_STRPTIME
785+#cmakedefine HAVE_SYSLOG
786+#cmakedefine HAVE_WRITEV
787+
788+/* libcrypt */
789+#cmakedefine HAVE_CRYPT_H
790+#cmakedefine HAVE_LIBCRYPT
791+
792+/* fastcgi */
793+#cmakedefine HAVE_FASTCGI_H
794+#cmakedefine HAVE_FASTCGI_FASTCGI_H
795+
796+#cmakedefine LIGHTTPD_STATIC
738baab9
ER
797Index: src/network_freebsd_sendfile.c
798===================================================================
25fbab93
ER
799--- src/network_freebsd_sendfile.c (.../tags/lighttpd-1.4.20) (revision 2392)
800+++ src/network_freebsd_sendfile.c (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9
ER
801@@ -167,6 +167,7 @@
802 switch(errno) {
803 case EAGAIN:
804 case EINTR:
805+ r = 0; /* try again later */
806 break;
807 case ENOTCONN:
808 return -2;
809@@ -174,10 +175,7 @@
810 log_error_write(srv, __FILE__, __LINE__, "ssd", "sendfile: ", strerror(errno), errno);
811 return -1;
812 }
813- }
814-
815- if (r == 0 && (errno != EAGAIN && errno != EINTR)) {
816- int oerrno = errno;
817+ } else if (r == 0) {
818 /* We got an event to write but we wrote nothing
819 *
820 * - the file shrinked -> error
821@@ -190,12 +188,9 @@
822
823 if (offset >= sce->st.st_size) {
824 /* file shrinked, close the connection */
825- errno = oerrno;
826-
827 return -1;
828 }
829
830- errno = oerrno;
831 return -2;
832 }
833
709c1a0b
ER
834Index: src/http_auth.c
835===================================================================
25fbab93
ER
836--- src/http_auth.c (.../tags/lighttpd-1.4.20) (revision 2392)
837+++ src/http_auth.c (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
838@@ -57,22 +57,25 @@
839
840 static const char base64_pad = '=';
841
842+/* "A-Z a-z 0-9 + /" maps to 0-63 */
843 static const short base64_reverse_table[256] = {
844- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
845- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
846- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
847- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
848- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
849- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
850- -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
851- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
852- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
853- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
854- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
855- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
856- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
857- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
858- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
859+/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
860+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00 - 0x0F */
861+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x10 - 0x1F */
862+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, /* 0x20 - 0x2F */
863+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, /* 0x30 - 0x3F */
864+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 0x40 - 0x4F */
865+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, /* 0x50 - 0x5F */
866+ -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, /* 0x60 - 0x6F */
867+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, /* 0x70 - 0x7F */
868+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x80 - 0x8F */
869+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x90 - 0x9F */
870+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xA0 - 0xAF */
871+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xB0 - 0xBF */
872+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xC0 - 0xCF */
873+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xD0 - 0xDF */
874+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xE0 - 0xEF */
875+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xF0 - 0xFF */
876 };
54b68997 877
54b68997 878
709c1a0b
ER
879@@ -697,7 +700,7 @@
880 }
881 } else if (p->conf.auth_backend == AUTH_BACKEND_LDAP) {
882 #ifdef USE_LDAP
883- LDAP *ldap = NULL;
884+ LDAP *ldap;
885 LDAPMessage *lm, *first;
886 char *dn;
887 int ret;
888@@ -742,56 +745,45 @@
889 buffer_append_string_buffer(p->ldap_filter, username);
890 buffer_append_string_buffer(p->ldap_filter, p->conf.ldap_filter_post);
54b68997 891
54b68997 892+
709c1a0b
ER
893 /* 2. */
894- if (p->conf.ldap == NULL ||
895- LDAP_SUCCESS != (ret = ldap_search_s(p->conf.ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
896- /* try again if ldap was only temporary down */
897- if (p->conf.ldap == NULL || ret != LDAP_SERVER_DOWN || LDAP_SUCCESS != (ret = ldap_search_s(p->conf.ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
898- if (auth_ldap_init(srv, &p->conf) != HANDLER_GO_ON)
899+ if (p->anon_conf->ldap == NULL ||
900+ LDAP_SUCCESS != (ret = ldap_search_s(p->anon_conf->ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
901+
902+ /* try again; the ldap library sometimes fails for the first call but reconnects */
903+ if (p->anon_conf->ldap == NULL || ret != LDAP_SERVER_DOWN ||
904+ LDAP_SUCCESS != (ret = ldap_search_s(p->anon_conf->ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
905+
906+ if (auth_ldap_init(srv, p->anon_conf) != HANDLER_GO_ON)
907 return -1;
908
909- ldap = p->conf.ldap; /* save temporary ldap connection (TODO: redo ldap) */
910- if (LDAP_SUCCESS != (ret = ldap_search_s(p->conf.ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
911+ if (p->anon_conf->ldap == NULL ||
912+ LDAP_SUCCESS != (ret = ldap_search_s(p->anon_conf->ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
913 log_error_write(srv, __FILE__, __LINE__, "sssb",
914 "ldap:", ldap_err2string(ret), "filter:", p->ldap_filter);
915- /* destroy temporary ldap connection (TODO: redo ldap) */
916- ldap_unbind_s(ldap);
917 return -1;
918 }
919 }
920 }
54b68997 921
709c1a0b
ER
922- if (NULL == (first = ldap_first_entry(p->conf.ldap, lm))) {
923- /* No matching entry is not an error */
924- /* log_error_write(srv, __FILE__, __LINE__, "s", "ldap ..."); */
925+ if (NULL == (first = ldap_first_entry(p->anon_conf->ldap, lm))) {
926+ log_error_write(srv, __FILE__, __LINE__, "s", "ldap ...");
54b68997 927
709c1a0b 928 ldap_msgfree(lm);
54b68997 929
709c1a0b
ER
930- /* destroy temporary ldap connection (TODO: redo ldap) */
931- if (NULL != ldap) {
932- ldap_unbind_s(ldap);
933- }
934 return -1;
935 }
54b68997 936
709c1a0b
ER
937- if (NULL == (dn = ldap_get_dn(p->conf.ldap, first))) {
938- log_error_write(srv, __FILE__, __LINE__, "s", "ldap: ldap_get_dn failed");
939+ if (NULL == (dn = ldap_get_dn(p->anon_conf->ldap, first))) {
940+ log_error_write(srv, __FILE__, __LINE__, "s", "ldap ...");
54b68997 941
709c1a0b 942 ldap_msgfree(lm);
54b68997 943
709c1a0b
ER
944- /* destroy temporary ldap connection (TODO: redo ldap) */
945- if (NULL != ldap) {
946- ldap_unbind_s(ldap);
947- }
948 return -1;
949 }
54b68997 950
709c1a0b 951 ldap_msgfree(lm);
54b68997 952
709c1a0b
ER
953- /* destroy temporary ldap connection (TODO: redo ldap) */
954- if (NULL != ldap) {
955- ldap_unbind_s(ldap);
956- }
54b68997 957
709c1a0b
ER
958 /* 3. */
959 if (NULL == (ldap = ldap_init(p->conf.auth_ldap_hostname->ptr, LDAP_PORT))) {
170f212a
ER
960Index: src/mod_redirect.c
961===================================================================
25fbab93
ER
962--- src/mod_redirect.c (.../tags/lighttpd-1.4.20) (revision 2392)
963+++ src/mod_redirect.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
964@@ -178,11 +178,7 @@
965
966 mod_redirect_patch_connection(srv, con, p);
967
968- buffer_copy_string_buffer(p->match_buf, con->uri.path);
969- if (con->uri.query->used > 0) {
970- buffer_append_string_len(p->match_buf, CONST_STR_LEN("?"));
971- buffer_append_string_buffer(p->match_buf, con->uri.query);
972- }
973+ buffer_copy_string_buffer(p->match_buf, con->request.uri);
974
975 for (i = 0; i < p->conf.redirect->used; i++) {
976 pcre *match;
709c1a0b
ER
977Index: src/http_auth.h
978===================================================================
25fbab93
ER
979--- src/http_auth.h (.../tags/lighttpd-1.4.20) (revision 2392)
980+++ src/http_auth.h (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b 981@@ -63,7 +63,7 @@
54b68997 982
709c1a0b 983 mod_auth_plugin_config **config_storage;
54b68997 984
709c1a0b
ER
985- mod_auth_plugin_config conf; /* this is only used as long as no handler_ctx is setup */
986+ mod_auth_plugin_config conf, *anon_conf; /* this is only used as long as no handler_ctx is setup */
987 } mod_auth_plugin_data;
54b68997 988
709c1a0b 989 int http_auth_basic_check(server *srv, connection *con, mod_auth_plugin_data *p, array *req, buffer *url, const char *realm_str);
170f212a
ER
990Index: src/mod_webdav.c
991===================================================================
25fbab93
ER
992--- src/mod_webdav.c (.../tags/lighttpd-1.4.20) (revision 2392)
993+++ src/mod_webdav.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
994@@ -1026,6 +1026,8 @@
995 if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
996 log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
997 strerror(errno), c->file.name, c->file.fd);
998+ close(c->file.fd);
999+ c->file.fd = -1;
1000
1001 return -1;
1002 }
1003@@ -1723,6 +1725,8 @@
1004 if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
1005 log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
1006 strerror(errno), c->file.name, c->file.fd);
1007+ close(c->file.fd);
1008+ c->file.fd = -1;
1009
1010 return HANDLER_ERROR;
1011 }
25fbab93
ER
1012Index: src/configparser.y
1013===================================================================
1014--- src/configparser.y (.../tags/lighttpd-1.4.20) (revision 2392)
1015+++ src/configparser.y (.../branches/lighttpd-1.4.x) (revision 2392)
1016@@ -427,6 +427,7 @@
1017 { COMP_HTTP_REFERER, CONST_STR_LEN("HTTP[\"referer\"]" ) },
1018 { COMP_HTTP_USER_AGENT, CONST_STR_LEN("HTTP[\"useragent\"]" ) },
1019 { COMP_HTTP_USER_AGENT, CONST_STR_LEN("HTTP[\"user-agent\"]" ) },
1020+ { COMP_HTTP_LANGUAGE, CONST_STR_LEN("HTTP[\"language\"]" ) },
1021 { COMP_HTTP_COOKIE, CONST_STR_LEN("HTTP[\"cookie\"]" ) },
1022 { COMP_HTTP_REMOTE_IP, CONST_STR_LEN("HTTP[\"remoteip\"]" ) },
1023 { COMP_HTTP_REMOTE_IP, CONST_STR_LEN("HTTP[\"remote-ip\"]" ) },
2ed0f534
ER
1024Index: src/mod_compress.c
1025===================================================================
25fbab93
ER
1026--- src/mod_compress.c (.../tags/lighttpd-1.4.20) (revision 2392)
1027+++ src/mod_compress.c (.../branches/lighttpd-1.4.x) (revision 2392)
2ed0f534
ER
1028@@ -49,6 +49,7 @@
1029 buffer *compress_cache_dir;
1030 array *compress;
1031 off_t compress_max_filesize; /** max filesize in kb */
1032+ int allowed_encodings;
1033 } plugin_config;
1034
1035 typedef struct {
1036@@ -154,6 +155,7 @@
1037 { "compress.cache-dir", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1038 { "compress.filetype", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
1039 { "compress.max-filesize", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
1040+ { "compress.allowed-encodings", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
1041 { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
1042 };
1043
1044@@ -161,15 +163,18 @@
1045
1046 for (i = 0; i < srv->config_context->used; i++) {
1047 plugin_config *s;
1048+ array *encodings_arr = array_init();
1049
1050 s = calloc(1, sizeof(plugin_config));
1051 s->compress_cache_dir = buffer_init();
1052 s->compress = array_init();
1053 s->compress_max_filesize = 0;
1054+ s->allowed_encodings = 0;
1055
1056 cv[0].destination = s->compress_cache_dir;
1057 cv[1].destination = s->compress;
1058 cv[2].destination = &(s->compress_max_filesize);
1059+ cv[3].destination = encodings_arr; /* temp array for allowed encodings list */
1060
1061 p->config_storage[i] = s;
1062
1063@@ -177,6 +182,39 @@
1064 return HANDLER_ERROR;
1065 }
1066
1067+ if (encodings_arr->used) {
1068+ size_t j = 0;
1069+ for (j = 0; j < encodings_arr->used; j++) {
1070+ data_string *ds = (data_string *)encodings_arr->data[j];
1071+#ifdef USE_ZLIB
1072+ if (NULL != strstr(ds->value->ptr, "gzip"))
1073+ s->allowed_encodings |= HTTP_ACCEPT_ENCODING_GZIP;
1074+ if (NULL != strstr(ds->value->ptr, "deflate"))
1075+ s->allowed_encodings |= HTTP_ACCEPT_ENCODING_DEFLATE;
1076+ /*
1077+ if (NULL != strstr(ds->value->ptr, "compress"))
1078+ s->allowed_encodings |= HTTP_ACCEPT_ENCODING_COMPRESS;
1079+ */
1080+#endif
1081+#ifdef USE_BZ2LIB
1082+ if (NULL != strstr(ds->value->ptr, "bzip2"))
1083+ s->allowed_encodings |= HTTP_ACCEPT_ENCODING_BZIP2;
1084+#endif
1085+ }
1086+ } else {
1087+ /* default encodings */
1088+ s->allowed_encodings = 0
1089+#ifdef USE_ZLIB
1090+ | HTTP_ACCEPT_ENCODING_GZIP | HTTP_ACCEPT_ENCODING_DEFLATE
1091+#endif
1092+#ifdef USE_BZ2LIB
1093+ | HTTP_ACCEPT_ENCODING_BZIP2
1094+#endif
1095+ ;
1096+ }
1097+
1098+ array_free(encodings_arr);
1099+
1100 if (!buffer_is_empty(s->compress_cache_dir)) {
1101 struct stat st;
1102 mkdir_recursive(s->compress_cache_dir->ptr);
1103@@ -587,6 +625,7 @@
1104 PATCH(compress_cache_dir);
1105 PATCH(compress);
1106 PATCH(compress_max_filesize);
1107+ PATCH(allowed_encodings);
1108
1109 /* skip the first, the global context */
1110 for (i = 1; i < srv->config_context->used; i++) {
1111@@ -606,6 +645,8 @@
1112 PATCH(compress);
1113 } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.max-filesize"))) {
1114 PATCH(compress_max_filesize);
1115+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.allowed-encodings"))) {
1116+ PATCH(allowed_encodings);
1117 }
1118 }
1119 }
738baab9
ER
1120@@ -619,6 +660,7 @@
1121 size_t m;
1122 off_t max_fsize;
1123 stat_cache_entry *sce = NULL;
1124+ buffer *mtime = NULL;
1125
1126 if (con->mode != DIRECT || con->http_status) return HANDLER_GO_ON;
1127
1128@@ -636,8 +678,30 @@
1129
1130 max_fsize = p->conf.compress_max_filesize;
1131
1132- stat_cache_get_entry(srv, con, con->physical.path, &sce);
1133+ if (con->conf.log_request_handling) {
1134+ log_error_write(srv, __FILE__, __LINE__, "s", "-- handling file as static file");
1135+ }
1136
1137+ if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
1138+ con->http_status = 403;
1139+
1140+ log_error_write(srv, __FILE__, __LINE__, "sbsb",
1141+ "not a regular file:", con->uri.path,
1142+ "->", con->physical.path);
1143+
1144+ return HANDLER_FINISHED;
1145+ }
1146+
1147+ /* we only handle regular files */
1148+#ifdef HAVE_LSTAT
1149+ if ((sce->is_symlink == 1) && !con->conf.follow_symlink) {
1150+ return HANDLER_GO_ON;
1151+ }
1152+#endif
1153+ if (!S_ISREG(sce->st.st_mode)) {
1154+ return HANDLER_GO_ON;
1155+ }
1156+
1157 /* don't compress files that are too large as we need to much time to handle them */
1158 if (max_fsize && (sce->st.st_size >> 10) > max_fsize) return HANDLER_GO_ON;
1159
1160@@ -668,27 +732,21 @@
2ed0f534
ER
1161 if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Accept-Encoding"))) {
1162 int accept_encoding = 0;
1163 char *value = ds->value->ptr;
1164- int srv_encodings = 0;
1165 int matched_encodings = 0;
1166
1167 /* get client side support encodings */
1168+#ifdef USE_ZLIB
1169 if (NULL != strstr(value, "gzip")) accept_encoding |= HTTP_ACCEPT_ENCODING_GZIP;
1170 if (NULL != strstr(value, "deflate")) accept_encoding |= HTTP_ACCEPT_ENCODING_DEFLATE;
1171 if (NULL != strstr(value, "compress")) accept_encoding |= HTTP_ACCEPT_ENCODING_COMPRESS;
1172+#endif
1173+#ifdef USE_BZ2LIB
1174 if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2;
1175+#endif
1176 if (NULL != strstr(value, "identity")) accept_encoding |= HTTP_ACCEPT_ENCODING_IDENTITY;
1177
1178- /* get server side supported ones */
1179-#ifdef USE_BZ2LIB
1180- srv_encodings |= HTTP_ACCEPT_ENCODING_BZIP2;
1181-#endif
1182-#ifdef USE_ZLIB
1183- srv_encodings |= HTTP_ACCEPT_ENCODING_GZIP;
1184- srv_encodings |= HTTP_ACCEPT_ENCODING_DEFLATE;
1185-#endif
1186-
1187 /* find matching entries */
1188- matched_encodings = accept_encoding & srv_encodings;
1189+ matched_encodings = accept_encoding & p->conf.allowed_encodings;
1190
1191 if (matched_encodings) {
1192 const char *dflt_gzip = "gzip";
738baab9
ER
1193@@ -698,6 +756,17 @@
1194 const char *compression_name = NULL;
1195 int compression_type = 0;
1196
1197+ mtime = strftime_cache_get(srv, sce->st.st_mtime);
1198+
1199+ /* try matching original etag of uncompressed version */
1200+ etag_mutate(con->physical.etag, sce->etag);
1201+ if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
1202+ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1203+ response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
1204+ response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
1205+ return HANDLER_FINISHED;
1206+ }
1207+
1208 /* select best matching encoding */
1209 if (matched_encodings & HTTP_ACCEPT_ENCODING_BZIP2) {
1210 compression_type = HTTP_ACCEPT_ENCODING_BZIP2;
1211@@ -710,41 +779,34 @@
1212 compression_name = dflt_deflate;
1213 }
1214
1215- /* deflate it */
1216- if (p->conf.compress_cache_dir->used) {
1217- if (0 == deflate_file_to_file(srv, con, p,
1218- con->physical.path, sce, compression_type)) {
1219- buffer *mtime;
1220+ /* try matching etag of compressed version */
1221+ buffer_copy_string_buffer(srv->tmp_buf, sce->etag);
1222+ buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("-"));
1223+ buffer_append_string(srv->tmp_buf, compression_name);
1224+ etag_mutate(con->physical.etag, srv->tmp_buf);
1225
1226- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
1227-
1228- mtime = strftime_cache_get(srv, sce->st.st_mtime);
1229- response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
1230-
1231- etag_mutate(con->physical.etag, sce->etag);
1232- response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
1233-
1234- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1235-
1236- return HANDLER_GO_ON;
1237- }
1238- } else if (0 == deflate_file_to_buffer(srv, con, p,
1239- con->physical.path, sce, compression_type)) {
1240- buffer *mtime;
1241-
1242+ if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
1243 response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
1244-
1245- mtime = strftime_cache_get(srv, sce->st.st_mtime);
1246+ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1247 response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
1248-
1249- etag_mutate(con->physical.etag, sce->etag);
1250 response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
1251-
1252- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1253-
1254 return HANDLER_FINISHED;
1255 }
1256- break;
1257+
1258+ /* deflate it */
1259+ if (p->conf.compress_cache_dir->used) {
1260+ if (0 != deflate_file_to_file(srv, con, p, con->physical.path, sce, compression_type))
1261+ return HANDLER_GO_ON;
1262+ } else {
1263+ if (0 != deflate_file_to_buffer(srv, con, p, con->physical.path, sce, compression_type))
1264+ return HANDLER_GO_ON;
1265+ }
1266+ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
1267+ response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
1268+ response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
1269+ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1270+ /* let mod_staticfile handle the cached compressed files, physical path was modified */
1271+ return p->conf.compress_cache_dir->used ? HANDLER_GO_ON : HANDLER_FINISHED;
1272 }
1273 }
1274 }
170f212a
ER
1275Index: src/spawn-fcgi.c
1276===================================================================
25fbab93
ER
1277--- src/spawn-fcgi.c (.../tags/lighttpd-1.4.20) (revision 2392)
1278+++ src/spawn-fcgi.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
1279@@ -58,7 +58,7 @@
1280
1281
1282 if (unixsocket) {
1283- memset(&fcgi_addr, 0, sizeof(fcgi_addr));
1284+ memset(&fcgi_addr_un, 0, sizeof(fcgi_addr_un));
1285
1286 fcgi_addr_un.sun_family = AF_UNIX;
1287 strcpy(fcgi_addr_un.sun_path, unixsocket);
1288@@ -72,12 +72,13 @@
1289 socket_type = AF_UNIX;
1290 fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
1291 } else {
1292+ memset(&fcgi_addr_in, 0, sizeof(fcgi_addr_in));
1293 fcgi_addr_in.sin_family = AF_INET;
1294- if (addr != NULL) {
1295- fcgi_addr_in.sin_addr.s_addr = inet_addr(addr);
1296- } else {
1297- fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
1298- }
1299+ if (addr != NULL) {
1300+ fcgi_addr_in.sin_addr.s_addr = inet_addr(addr);
1301+ } else {
1302+ fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
1303+ }
1304 fcgi_addr_in.sin_port = htons(port);
1305 servlen = sizeof(fcgi_addr_in);
1306
709c1a0b
ER
1307Index: src/mod_auth.c
1308===================================================================
25fbab93
ER
1309--- src/mod_auth.c (.../tags/lighttpd-1.4.20) (revision 2392)
1310+++ src/mod_auth.c (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
1311@@ -115,7 +115,7 @@
1312 PATCH(auth_ldap_starttls);
1313 PATCH(auth_ldap_allow_empty_pw);
1314 #ifdef USE_LDAP
1315- PATCH(ldap);
1316+ p->anon_conf = s;
1317 PATCH(ldap_filter_pre);
1318 PATCH(ldap_filter_post);
1319 #endif
1320@@ -149,7 +149,7 @@
1321 } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.hostname"))) {
1322 PATCH(auth_ldap_hostname);
1323 #ifdef USE_LDAP
1324- PATCH(ldap);
1325+ p->anon_conf = s;
1326 #endif
1327 } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.base-dn"))) {
1328 PATCH(auth_ldap_basedn);
1329@@ -527,7 +527,7 @@
54b68997 1330 }
54b68997
ER
1331 }
1332
709c1a0b
ER
1333- switch(s->auth_backend) {
1334+ switch(s->auth_ldap_hostname->used) {
1335 case AUTH_BACKEND_LDAP: {
1336 handler_t ret = auth_ldap_init(srv, s);
1337 if (ret == HANDLER_ERROR)
1338@@ -554,6 +554,9 @@
1339 #endif
1340
1341 if (s->auth_ldap_hostname->used) {
1342+ /* free old context */
1343+ if (NULL != s->ldap) ldap_unbind_s(s->ldap);
1344+
1345 if (NULL == (s->ldap = ldap_init(s->auth_ldap_hostname->ptr, LDAP_PORT))) {
1346 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno));
1347
170f212a
ER
1348Index: src/http-header-glue.c
1349===================================================================
25fbab93
ER
1350--- src/http-header-glue.c (.../tags/lighttpd-1.4.20) (revision 2392)
1351+++ src/http-header-glue.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
1352@@ -280,6 +280,7 @@
1353 strncpy(buf, con->request.http_if_modified_since, used_len);
1354 buf[used_len] = '\0';
1355
1356+ tm.tm_isdst = 0;
1357 if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
1358 con->http_status = 412;
1359 con->mode = DIRECT;
1360@@ -329,6 +330,7 @@
1361 strncpy(buf, con->request.http_if_modified_since, used_len);
1362 buf[used_len] = '\0';
1363
1364+ tm.tm_isdst = 0;
1365 if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
1366 /**
1367 * parsing failed, let's get out of here
709c1a0b
ER
1368Index: src/mod_fastcgi.c
1369===================================================================
25fbab93
ER
1370--- src/mod_fastcgi.c (.../tags/lighttpd-1.4.20) (revision 2392)
1371+++ src/mod_fastcgi.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
1372@@ -3252,6 +3252,7 @@
1373 fcgi_connection_close(srv, hctx);
1374
1375 con->mode = DIRECT;
1376+ con->http_status = 0;
1377 con->file_started = 1; /* fcgi_extension won't touch the request afterwards */
1378 } else {
1379 /* we are done */
1380@@ -3608,47 +3609,50 @@
709c1a0b
ER
1381 "handling it in mod_fastcgi");
1382 }
1383
1384- /* the prefix is the SCRIPT_NAME,
1385- * everything from start to the next slash
1386- * this is important for check-local = "disable"
1387- *
1388- * if prefix = /admin.fcgi
1389- *
1390- * /admin.fcgi/foo/bar
1391- *
1392- * SCRIPT_NAME = /admin.fcgi
1393- * PATH_INFO = /foo/bar
1394- *
1395- * if prefix = /fcgi-bin/
1396- *
1397- * /fcgi-bin/foo/bar
1398- *
1399- * SCRIPT_NAME = /fcgi-bin/foo
1400- * PATH_INFO = /bar
1401- *
1402- * if prefix = /, and fix-root-path-name is enable
1403- *
1404- * /fcgi-bin/foo/bar
1405- *
1406- * SCRIPT_NAME = /fcgi-bin/foo
1407- * PATH_INFO = /bar
1408- *
1409- */
1410+ /* do not split path info for authorizer */
1411+ if (host->mode != FCGI_AUTHORIZER) {
1412+ /* the prefix is the SCRIPT_NAME,
1413+ * everything from start to the next slash
1414+ * this is important for check-local = "disable"
1415+ *
1416+ * if prefix = /admin.fcgi
1417+ *
1418+ * /admin.fcgi/foo/bar
1419+ *
1420+ * SCRIPT_NAME = /admin.fcgi
1421+ * PATH_INFO = /foo/bar
1422+ *
1423+ * if prefix = /fcgi-bin/
1424+ *
1425+ * /fcgi-bin/foo/bar
1426+ *
1427+ * SCRIPT_NAME = /fcgi-bin/foo
1428+ * PATH_INFO = /bar
1429+ *
1430+ * if prefix = /, and fix-root-path-name is enable
1431+ *
1432+ * /fcgi-bin/foo/bar
1433+ *
1434+ * SCRIPT_NAME = /fcgi-bin/foo
1435+ * PATH_INFO = /bar
1436+ *
1437+ */
1438
1439- /* the rewrite is only done for /prefix/? matches */
1440- if (extension->key->ptr[0] == '/' &&
1441- con->uri.path->used > extension->key->used &&
1442- NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
1443- /* rewrite uri.path and pathinfo */
1444+ /* the rewrite is only done for /prefix/? matches */
1445+ if (extension->key->ptr[0] == '/' &&
1446+ con->uri.path->used > extension->key->used &&
1447+ NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
1448+ /* rewrite uri.path and pathinfo */
1449
1450- buffer_copy_string(con->request.pathinfo, pathinfo);
1451+ buffer_copy_string(con->request.pathinfo, pathinfo);
1452
1453- con->uri.path->used -= con->request.pathinfo->used - 1;
1454- con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1455- } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1456- buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1457- con->uri.path->used = 1;
1458- con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1459+ con->uri.path->used -= con->request.pathinfo->used - 1;
1460+ con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1461+ } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1462+ buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1463+ con->uri.path->used = 1;
1464+ con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1465+ }
54b68997 1466 }
54b68997 1467 }
709c1a0b 1468 } else {
170f212a
ER
1469Index: src/CMakeLists.txt
1470===================================================================
1471--- src/CMakeLists.txt (.../tags/lighttpd-1.4.20) (revision 0)
25fbab93 1472+++ src/CMakeLists.txt (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9 1473@@ -0,0 +1,598 @@
170f212a
ER
1474+INCLUDE(CheckCSourceCompiles)
1475+INCLUDE(CheckIncludeFiles)
1476+INCLUDE(CheckFunctionExists)
1477+INCLUDE(CheckVariableExists)
1478+INCLUDE(CheckTypeSize)
1479+INCLUDE(CheckLibraryExists)
1480+INCLUDE(CMakeDetermineCCompiler)
1481+INCLUDE(FindThreads)
1482+INCLUDE(FindPkgConfig)
1483+
1484+INCLUDE(LighttpdMacros)
1485+
1486+ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES)
1487+
1488+OPTION(WITH_XATTR "with xattr-support for the stat-cache [default: off]")
1489+OPTION(WITH_MYSQL "with mysql-support for the mod_sql_vhost [default: off]")
1490+# OPTION(WITH_POSTGRESQL "with postgress-support for the mod_sql_vhost [default: off]")
1491+OPTION(WITH_OPENSSL "with openssl-support [default: off]")
1492+OPTION(WITH_PCRE "with regex support [default: on]" ON)
1493+OPTION(WITH_WEBDAV_PROPS "with property-support for mod_webdav [default: off]")
1494+OPTION(WITH_WEBDAV_LOCKS "locks in webdav [default: off]")
1495+OPTION(WITH_BZIP "with bzip2-support for mod_compress [default: off]")
1496+OPTION(WITH_ZLIB "with deflate-support for mod_compress [default: on]" ON)
1497+OPTION(WITH_LDAP "with LDAP-support for the mod_auth [default: off]")
1498+OPTION(WITH_LUA "with lua 5.1 for mod_magnet [default: off]")
1499+# OPTION(WITH_VALGRIND "with internal support for valgrind [default: off]")
1500+# OPTION(WITH_KERBEROS5 "use Kerberos5 support with OpenSSL [default: off]")
1501+OPTION(WITH_FAM "fam/gamin for reducing number of stat() calls [default: off]")
1502+OPTION(WITH_GDBM "gdbm storage for mod_trigger_b4_dl [default: off]")
1503+OPTION(WITH_MEMCACHE "memcached storage for mod_trigger_b4_dl [default: off]")
1504+
1505+OPTION(BUILD_STATIC "build a static lighttpd with all modules added")
1506+
1507+IF(BUILD_STATIC)
1508+ SET(LIGHTTPD_STATIC 1)
1509+ELSE(BUILD_STATIC)
1510+ SET(CMAKE_SHARED_LIBRARY_PREFIX "")
1511+ENDIF(BUILD_STATIC)
1512+
1513+IF(WITH_WEBDAV_PROPS)
1514+ SET(WITH_XML 1)
1515+ SET(WITH_SQLITE3 1)
1516+ SET(WITH_UUID 1)
1517+ENDIF(WITH_WEBDAV_PROPS)
1518+
1519+CHECK_INCLUDE_FILES(sys/devpoll.h HAVE_SYS_DEVPOLL_H)
1520+CHECK_INCLUDE_FILES(sys/epoll.h HAVE_SYS_EPOLL_H)
1521+CHECK_INCLUDE_FILES(sys/event.h HAVE_SYS_EVENT_H)
1522+CHECK_INCLUDE_FILES(sys/mman.h HAVE_SYS_MMAN_H)
1523+CHECK_INCLUDE_FILES(sys/poll.h HAVE_SYS_POLL_H)
1524+CHECK_INCLUDE_FILES(sys/port.h HAVE_SYS_PORT_H)
1525+CHECK_INCLUDE_FILES(sys/prctl.h HAVE_SYS_PRCTL_H)
1526+CHECK_INCLUDE_FILES(sys/resource.h HAVE_SYS_RESOURCE_H)
1527+CHECK_INCLUDE_FILES(sys/sendfile.h HAVE_SYS_SENDFILE_H)
1528+CHECK_INCLUDE_FILES(sys/select.h HAVE_SYS_SELECT_H)
1529+CHECK_INCLUDE_FILES(sys/syslimits.h HAVE_SYS_SYSLIMITS_H)
1530+CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
1531+CHECK_INCLUDE_FILES(sys/uio.h HAVE_SYS_UIO_H)
1532+CHECK_INCLUDE_FILES(sys/un.h HAVE_SYS_UN_H)
1533+CHECK_INCLUDE_FILES(sys/wait.h HAVE_SYS_WAIT_H)
1534+CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
1535+CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
1536+CHECK_INCLUDE_FILES(pthread.h HAVE_PTHREAD_H)
1537+CHECK_INCLUDE_FILES(getopt.h HAVE_GETOPT_H)
1538+CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
1539+CHECK_INCLUDE_FILES(poll.h HAVE_POLL_H)
1540+CHECK_INCLUDE_FILES(pwd.h HAVE_PWD_H)
1541+CHECK_INCLUDE_FILES(stddef.h HAVE_STDDEF_H)
1542+CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
1543+CHECK_INCLUDE_FILES(syslog.h HAVE_SYSLOG_H)
1544+
1545+# check for fastcgi lib, for the tests only
1546+CHECK_INCLUDE_FILES(fastcgi.h HAVE_FASTCGI_H)
1547+CHECK_INCLUDE_FILES(fastcgi/fastcgi.h HAVE_FASTCGI_FASTCGI_H)
1548+
1549+CHECK_INCLUDE_FILES(crypt.h HAVE_CRYPT_H)
1550+IF(HAVE_CRYPT_H)
1551+ ## check if we need libcrypt for crypt()
1552+ CHECK_LIBRARY_EXISTS(crypt crypt "" HAVE_LIBCRYPT)
1553+ENDIF(HAVE_CRYPT_H)
1554+
1555+CHECK_INCLUDE_FILES(sys/inotify.h HAVE_SYS_INOTIFY_H)
1556+IF(HAVE_SYS_INOTIFY_H)
1557+ CHECK_FUNCTION_EXISTS(inotify_init HAVE_INOTIFY_INIT)
1558+ENDIF(HAVE_SYS_INOTIFY_H)
1559+
1560+SET(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
1561+CHECK_TYPE_SIZE(socklen_t HAVE_SOCKLEN_T)
1562+SET(CMAKE_EXTRA_INCLUDE_FILES)
1563+
1564+CHECK_TYPE_SIZE(long SIZEOF_LONG)
1565+CHECK_TYPE_SIZE(off_t SIZEOF_OFF_T)
1566+
1567+CHECK_FUNCTION_EXISTS(chroot HAVE_CHROOT)
1568+CHECK_FUNCTION_EXISTS(crypt HAVE_CRYPT)
1569+CHECK_FUNCTION_EXISTS(epoll_ctl HAVE_EPOLL_CTL)
1570+CHECK_FUNCTION_EXISTS(fork HAVE_FORK)
1571+CHECK_FUNCTION_EXISTS(getrlimit HAVE_GETRLIMIT)
1572+CHECK_FUNCTION_EXISTS(getuid HAVE_GETUID)
1573+CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R)
1574+CHECK_FUNCTION_EXISTS(inet_ntop HAVE_INET_NTOP)
1575+CHECK_FUNCTION_EXISTS(kqueue HAVE_KQUEUE)
1576+CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R)
1577+CHECK_FUNCTION_EXISTS(lstat HAVE_LSTAT)
1578+CHECK_FUNCTION_EXISTS(madvise HAVE_MADVISE)
1579+CHECK_FUNCTION_EXISTS(memcpy HAVE_MEMCPY)
1580+CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET)
1581+CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
1582+CHECK_FUNCTION_EXISTS(pathconf HAVE_PATHCONF)
1583+CHECK_FUNCTION_EXISTS(poll HAVE_POLL)
1584+CHECK_FUNCTION_EXISTS(port_create HAVE_PORT_CREATE)
1585+CHECK_FUNCTION_EXISTS(prctl HAVE_PRCTL)
1586+CHECK_FUNCTION_EXISTS(pread HAVE_PREAD)
1587+CHECK_FUNCTION_EXISTS(posix_fadvise HAVE_POSIX_FADVISE)
1588+CHECK_FUNCTION_EXISTS(select HAVE_SELECT)
1589+CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE)
1590+CHECK_FUNCTION_EXISTS(send_file HAVE_SEND_FILE)
1591+CHECK_FUNCTION_EXISTS(sendfile64 HAVE_SENDFILE64)
1592+CHECK_FUNCTION_EXISTS(sendfilev HAVE_SENDFILEV)
1593+CHECK_FUNCTION_EXISTS(sigaction HAVE_SIGACTION)
1594+CHECK_FUNCTION_EXISTS(signal HAVE_SIGNAL)
1595+CHECK_FUNCTION_EXISTS(sigtimedwait HAVE_SIGTIMEDWAIT)
1596+CHECK_FUNCTION_EXISTS(strptime HAVE_STRPTIME)
1597+CHECK_FUNCTION_EXISTS(syslog HAVE_SYSLOG)
1598+CHECK_FUNCTION_EXISTS(writev HAVE_WRITEV)
1599+CHECK_FUNCTION_EXISTS(inet_aton HAVE_INET_ATON)
1600+CHECK_C_SOURCE_COMPILES("
1601+ #include <sys/types.h>
1602+ #include <sys/socket.h>
1603+ #include <netinet/in.h>
1604+
1605+ int main() {
1606+ struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;
1607+ return 0;
1608+ }" HAVE_IPV6)
1609+
1610+## refactor me
1611+MACRO(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
1612+# reset the variables at the beginning
1613+ SET(${_include_DIR})
1614+ SET(${_link_DIR})
1615+ SET(${_link_FLAGS})
1616+ SET(${_cflags})
1617+
1618+ FIND_PROGRAM(${_package}CONFIG_EXECUTABLE NAMES ${_package} PATHS /usr/local/bin )
1619+
1620+ # if pkg-config has been found
1621+ IF(${_package}CONFIG_EXECUTABLE)
1622+ SET(XCONFIG_EXECUTABLE "${${_package}CONFIG_EXECUTABLE}")
1623+ MESSAGE(STATUS "found ${_package}: ${XCONFIG_EXECUTABLE}")
1624+
1625+ EXEC_PROGRAM(${XCONFIG_EXECUTABLE} ARGS --libs OUTPUT_VARIABLE __link_FLAGS)
1626+ STRING(REPLACE "\n" "" ${_link_FLAGS} ${__link_FLAGS})
1627+ EXEC_PROGRAM(${XCONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE __cflags)
1628+ STRING(REPLACE "\n" "" ${_cflags} ${__cflags})
1629+
1630+ ELSE(${_package}CONFIG_EXECUTABLE)
1631+ MESSAGE(STATUS "found ${_package}: no")
1632+ ENDIF(${_package}CONFIG_EXECUTABLE)
1633+ENDMACRO(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
1634+
1635+IF(WITH_XATTR)
1636+ CHECK_INCLUDE_FILES(attr/attributes.h HAVE_ATTR_ATTRIBUTES_H)
1637+ CHECK_LIBRARY_EXISTS(attr attr_get "" HAVE_XATTR)
1638+ENDIF(WITH_XATTR)
1639+
1640+IF(WITH_MYSQL)
1641+ XCONFIG(mysql_config MYSQL_INCDIR MYSQL_LIBDIR MYSQL_LDFLAGS MYSQL_CFLAGS)
1642+
1643+ SET(CMAKE_REQUIRED_INCLUDES /usr/include/mysql)
1644+ CHECK_INCLUDE_FILES(mysql.h HAVE_MYSQL_H)
1645+ SET(CMAKE_REQUIRED_INCLUDES)
1646+ IF(HAVE_MYSQL_H)
1647+ CHECK_LIBRARY_EXISTS(mysqlclient mysql_real_connect "" HAVE_MYSQL)
1648+ ENDIF(HAVE_MYSQL_H)
1649+ENDIF(WITH_MYSQL)
1650+
1651+IF(WITH_OPENSSL)
1652+ CHECK_INCLUDE_FILES(openssl/ssl.h HAVE_OPENSSL_SSL_H)
1653+ IF(HAVE_OPENSSL_SSL_H)
1654+ CHECK_LIBRARY_EXISTS(crypto BIO_f_base64 "" HAVE_LIBCRYPTO)
1655+ IF(HAVE_LIBCRYPTO)
1656+ SET(OPENSSL_NO_KRB5 1)
1657+ CHECK_LIBRARY_EXISTS(ssl SSL_new "" HAVE_LIBSSL)
1658+ ENDIF(HAVE_LIBCRYPTO)
1659+ ENDIF(HAVE_OPENSSL_SSL_H)
1660+ENDIF(WITH_OPENSSL)
1661+
1662+IF(WITH_PCRE)
1663+ ## if we have pcre-config, use it
1664+ XCONFIG(pcre-config PCRE_INCDIR PCRE_LIBDIR PCRE_LDFLAGS PCRE_CFLAGS)
1665+ IF(PCRE_LDFLAGS OR PCRE_CFLAGS)
1666+ MESSAGE(STATUS "found pcre at: LDFLAGS: ${PCRE_LDFLAGS} CFLAGS: ${PCRE_CFLAGS}")
1667+
1668+ IF(NOT PCRE_CFLAGS STREQUAL "\n")
1669+ ## if it is empty we'll get newline returned
1670+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PCRE_CFLAGS}")
1671+ ENDIF(NOT PCRE_CFLAGS STREQUAL "\n")
1672+
1673+ SET(HAVE_PCRE_H 1)
1674+ SET(HAVE_LIBPCRE 1)
1675+ ELSE(PCRE_LDFLAGS OR PCRE_CFLAGS)
1676+ IF(NOT WIN32)
1677+ CHECK_INCLUDE_FILES(pcre.h HAVE_PCRE_H)
1678+ CHECK_LIBRARY_EXISTS(pcre pcre_exec "" HAVE_LIBPCRE)
1679+ SET(PCRE_LDFLAGS -lpcre)
1680+ ELSE(NOT WIN32)
1681+ FIND_PATH(PCRE_INCLUDE_DIR pcre.h
1682+ /usr/local/include
1683+ /usr/include
1684+ )
1685+
1686+ SET(PCRE_NAMES pcre)
1687+ FIND_LIBRARY(PCRE_LIBRARY
1688+ NAMES ${PCRE_NAMES}
1689+ PATHS /usr/lib /usr/local/lib
1690+ )
1691+
1692+ IF(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
1693+ SET(CMAKE_REQUIRED_INCLUDES ${PCRE_INCLUDE_DIR})
1694+ SET(CMAKE_REQUIRED_LIBRARIES ${PCRE_LIBRARY})
1695+ CHECK_INCLUDE_FILES(pcre.h HAVE_PCRE_H)
1696+ CHECK_LIBRARY_EXISTS(pcre pcre_exec "" HAVE_LIBPCRE)
1697+ SET(CMAKE_REQUIRED_INCLUDES)
1698+ SET(CMAKE_REQUIRED_LIBRARIES)
1699+ INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR})
1700+ ENDIF(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
1701+ ENDIF(NOT WIN32)
1702+ ENDIF(PCRE_LDFLAGS OR PCRE_CFLAGS)
1703+
1704+ IF(NOT HAVE_PCRE_H)
1705+ MESSAGE(FATAL_ERROR "pcre.h couldn't be found")
1706+ ENDIF(NOT HAVE_PCRE_H)
1707+ IF(NOT HAVE_LIBPCRE)
1708+ MESSAGE(FATAL_ERROR "libpcre couldn't be found")
1709+ ENDIF(NOT HAVE_LIBPCRE)
1710+
1711+ENDIF(WITH_PCRE)
1712+
1713+
1714+IF(WITH_XML)
1715+ XCONFIG(xml2-config XML2_INCDIR XML2_LIBDIR XML2_LDFLAGS XML2_CFLAGS)
1716+ IF(XML2_LDFLAGS OR XML2_CFLAGS)
1717+ MESSAGE(STATUS "found xml2 at: LDFLAGS: ${XML2_LDFLAGS} CFLAGS: ${XML2_CFLAGS}")
1718+
1719+ ## if it is empty we'll get newline returned
1720+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XML2_CFLAGS}")
1721+
1722+ CHECK_INCLUDE_FILES(libxml/tree.h HAVE_LIBXML_H)
1723+
1724+ SET(CMAKE_REQUIRED_FLAGS ${XML2_LDFLAGS})
1725+ CHECK_LIBRARY_EXISTS(xml2 xmlParseChunk "" HAVE_LIBXML)
1726+ SET(CMAKE_REQUIRED_FLAGS)
1727+ ELSE(XML2_LDFLAGS OR XML2_CFLAGS)
1728+ CHECK_INCLUDE_FILES(libxml.h HAVE_LIBXML_H)
1729+ CHECK_LIBRARY_EXISTS(xml2 xmlParseChunk "" HAVE_LIBXML)
1730+ ENDIF(XML2_LDFLAGS OR XML2_CFLAGS)
1731+
1732+ IF(NOT HAVE_LIBXML_H)
1733+ MESSAGE(FATAL_ERROR "libxml/tree.h couldn't be found")
1734+ ENDIF(NOT HAVE_LIBXML_H)
1735+ IF(NOT HAVE_LIBXML)
1736+ MESSAGE(FATAL_ERROR "libxml2 couldn't be found")
1737+ ENDIF(NOT HAVE_LIBXML)
1738+
1739+ENDIF(WITH_XML)
1740+
1741+IF(WITH_SQLITE3)
1742+ CHECK_INCLUDE_FILES(sqlite3.h HAVE_SQLITE3_H)
1743+ CHECK_LIBRARY_EXISTS(sqlite3 sqlite3_reset "" HAVE_SQLITE3)
1744+ENDIF(WITH_SQLITE3)
1745+
1746+IF(WITH_UUID)
1747+ CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_UUID_H)
1748+ CHECK_LIBRARY_EXISTS(uuid uuid_generate "" NEED_LIBUUID)
1749+ IF(NOT NEED_LIBUUID)
1750+ CHECK_FUNCTION_EXISTS(uuid_generate HAVE_LIBUUID)
1751+ ELSE(NOT NEED_LIBUUID)
1752+ SET(HAVE_LIBUUID 1)
1753+ ENDIF(NOT NEED_LIBUUID)
1754+ENDIF(WITH_UUID)
1755+
1756+IF(WITH_ZLIB)
1757+ IF(NOT WIN32)
1758+ CHECK_INCLUDE_FILES(zlib.h HAVE_ZLIB_H)
1759+ CHECK_LIBRARY_EXISTS(z deflate "" HAVE_LIBZ)
1760+ SET(ZLIB_LIBRARY z)
1761+ ELSE(NOT WIN32)
1762+ FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
1763+ /usr/local/include
1764+ /usr/include
1765+ )
1766+
1767+ SET(ZLIB_NAMES z zlib zdll)
1768+ FIND_LIBRARY(ZLIB_LIBRARY
1769+ NAMES ${ZLIB_NAMES}
1770+ PATHS /usr/lib /usr/local/lib
1771+ )
1772+
1773+
1774+ IF(ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
1775+ SET(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIR})
1776+ SET(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY})
1777+ GET_FILENAME_COMPONENT(ZLIB_NAME ${ZLIB_LIBRARY} NAME)
1778+ CHECK_INCLUDE_FILES(zlib.h HAVE_ZLIB_H)
1779+ CHECK_LIBRARY_EXISTS(${ZLIB_NAME} deflate "" HAVE_LIBZ)
1780+ SET(CMAKE_REQUIRED_INCLUDES)
1781+ SET(CMAKE_REQUIRED_LIBRARIES)
1782+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
1783+
1784+ ENDIF(ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
1785+ ENDIF(NOT WIN32)
1786+ENDIF(WITH_ZLIB)
1787+
1788+IF(WITH_BZIP)
1789+ CHECK_INCLUDE_FILES(bzlib.h HAVE_BZLIB_H)
1790+ CHECK_LIBRARY_EXISTS(bz2 BZ2_bzCompress "" HAVE_LIBBZ2)
1791+ENDIF(WITH_BZIP)
1792+
1793+IF(WITH_LDAP)
1794+ CHECK_INCLUDE_FILES(ldap.h HAVE_LDAP_H)
1795+ CHECK_LIBRARY_EXISTS(ldap ldap_bind "" HAVE_LIBLDAP)
1796+ CHECK_INCLUDE_FILES(lber.h HAVE_LBER_H)
1797+ CHECK_LIBRARY_EXISTS(lber ber_printf "" HAVE_LIBLBER)
1798+ SET(LDAP_DEPRECATED 1) # Using deprecated ldap api
1799+ENDIF(WITH_LDAP)
1800+
1801+IF(WITH_LUA)
1802+ pkg_search_module(LUA REQUIRED lua lua5.1)
1803+ MESSAGE(STATUS "found lua at: INCDIR: ${LUA_INCLUDE_DIRS} LIBDIR: ${LUA_LIBRARY_DIRS} LDFLAGS: ${LUA_LDFLAGS} CFLAGS: ${LUA_CFLAGS}")
1804+ SET(HAVE_LIBLUA 1 "Have liblua")
1805+ SET(HAVE_LUA_H 1 "Have liblua header")
1806+ENDIF(WITH_LUA)
1807+
1808+IF(WITH_FAM)
1809+ CHECK_INCLUDE_FILES(fam.h HAVE_FAM_H)
1810+ CHECK_LIBRARY_EXISTS(fam FAMOpen2 "" HAVE_LIBFAM)
1811+ IF(HAVE_LIBFAM)
1812+ SET(CMAKE_REQUIRED_LIBRARIES fam)
1813+ CHECK_FUNCTION_EXISTS(FAMNoExists HAVE_FAMNOEXISTS)
1814+ ENDIF(HAVE_LIBFAM)
1815+ENDIF(WITH_FAM)
1816+
1817+IF(WITH_GDBM)
1818+ CHECK_INCLUDE_FILES(gdbm.h HAVE_GDBM_H)
1819+ CHECK_LIBRARY_EXISTS(gdbm gdbm_open "" HAVE_GDBM)
1820+ENDIF(WITH_GDBM)
1821+
1822+IF(WITH_MEMCACHE)
1823+ CHECK_INCLUDE_FILES(memcache.h HAVE_MEMCACHE_H)
1824+ CHECK_LIBRARY_EXISTS(memcache mc_new "" HAVE_MEMCACHE)
1825+ENDIF(WITH_MEMCACHE)
1826+
1827+IF(NOT BUILD_STATIC)
1828+ CHECK_INCLUDE_FILES(dlfcn.h HAVE_DLFCN_H)
1829+ENDIF(NOT BUILD_STATIC)
1830+
1831+IF(HAVE_DLFCN_H)
1832+ CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
1833+ENDIF(HAVE_DLFCN_H)
1834+
738baab9
ER
1835+SET(LIGHTTPD_VERSION_ID 10400)
1836+SET(PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
1837+SET(PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
1838+EXEC_PROGRAM(date ARGS "'+%b %d %Y %H:%M:%S UTC'" OUTPUT_VARIABLE PACKAGE_BUILD_DATE)
170f212a
ER
1839+
1840+IF(NOT SBINDIR)
1841+ SET(SBINDIR "sbin")
1842+ENDIF(NOT SBINDIR)
1843+
1844+IF(NOT LIGHTTPD_MODULES_DIR)
1845+ SET(LIGHTTPD_MODULES_DIR "lib${LIB_SUFFIX}/lighttpd")
1846+ENDIF(NOT LIGHTTPD_MODULES_DIR)
1847+
1848+IF(NOT WIN32)
738baab9 1849+ SET(LIGHTTPD_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/${LIGHTTPD_MODULES_DIR}")
170f212a 1850+ELSE(NOT WIN32)
738baab9
ER
1851+ ## We use relative path in windows
1852+ SET(LIGHTTPD_LIBRARY_DIR "lib")
170f212a
ER
1853+ENDIF(NOT WIN32)
1854+
1855+## Write out config.h
1856+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
1857+
1858+ADD_DEFINITIONS(-DHAVE_CONFIG_H)
1859+
1860+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
1861+
1862+SET(COMMON_SRC
1863+ buffer.c log.c
1864+ keyvalue.c chunk.c
1865+ http_chunk.c stream.c fdevent.c
1866+ stat_cache.c plugin.c joblist.c etag.c array.c
1867+ data_string.c data_count.c data_array.c
1868+ data_integer.c md5.c data_fastcgi.c
1869+ fdevent_select.c fdevent_linux_rtsig.c
1870+ fdevent_poll.c fdevent_linux_sysepoll.c
1871+ fdevent_solaris_devpoll.c fdevent_freebsd_kqueue.c
1872+ data_config.c bitset.c
1873+ inet_ntop_cache.c crc32.c
1874+ connections-glue.c
1875+ configfile-glue.c
1876+ http-header-glue.c
1877+ splaytree.c network_writev.c
1878+ network_write.c network_linux_sendfile.c
1879+ network_freebsd_sendfile.c
1880+ network_solaris_sendfilev.c network_openssl.c
1881+ status_counter.c
1882+)
1883+
1884+IF(WIN32)
1885+ MESSAGE(STATUS "Adding local getopt implementation.")
1886+ SET(COMMON_SRC ${COMMON_SRC} xgetopt.c)
1887+ENDIF(WIN32)
1888+
1889+ADD_EXECUTABLE(lemon lemon.c)
1890+
1891+## Build parsers by using lemon...
1892+LEMON_PARSER(configparser.y)
1893+LEMON_PARSER(mod_ssi_exprparser.y)
1894+
1895+SET(L_INSTALL_TARGETS)
1896+
1897+ADD_EXECUTABLE(spawn-fcgi spawn-fcgi.c)
1898+SET(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} spawn-fcgi)
1899+
1900+ADD_EXECUTABLE(lighttpd
1901+ server.c
1902+ response.c
1903+ connections.c
1904+ network.c
1905+ configfile.c
1906+ configparser.c
1907+ request.c
1908+ proc_open.c
1909+ ${COMMON_SRC}
1910+)
1911+SET(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} lighttpd)
1912+
1913+ADD_AND_INSTALL_LIBRARY(mod_access mod_access.c)
1914+ADD_AND_INSTALL_LIBRARY(mod_accesslog mod_accesslog.c)
1915+ADD_AND_INSTALL_LIBRARY(mod_alias mod_alias.c)
1916+ADD_AND_INSTALL_LIBRARY(mod_auth "mod_auth.c;http_auth_digest.c;http_auth.c")
1917+IF(NOT WIN32)
1918+ADD_AND_INSTALL_LIBRARY(mod_cgi mod_cgi.c)
1919+ENDIF(NOT WIN32)
1920+ADD_AND_INSTALL_LIBRARY(mod_cml "mod_cml.c;mod_cml_lua.c;mod_cml_funcs.c")
1921+ADD_AND_INSTALL_LIBRARY(mod_compress mod_compress.c)
1922+ADD_AND_INSTALL_LIBRARY(mod_dirlisting mod_dirlisting.c)
1923+ADD_AND_INSTALL_LIBRARY(mod_evasive mod_evasive.c)
1924+ADD_AND_INSTALL_LIBRARY(mod_evhost mod_evhost.c)
1925+ADD_AND_INSTALL_LIBRARY(mod_expire mod_expire.c)
1926+ADD_AND_INSTALL_LIBRARY(mod_extforward mod_extforward.c)
1927+ADD_AND_INSTALL_LIBRARY(mod_fastcgi mod_fastcgi.c)
1928+ADD_AND_INSTALL_LIBRARY(mod_flv_streaming mod_flv_streaming.c)
1929+ADD_AND_INSTALL_LIBRARY(mod_indexfile mod_indexfile.c)
1930+ADD_AND_INSTALL_LIBRARY(mod_magnet "mod_magnet.c;mod_magnet_cache.c")
1931+ADD_AND_INSTALL_LIBRARY(mod_mysql_vhost mod_mysql_vhost.c)
1932+ADD_AND_INSTALL_LIBRARY(mod_proxy mod_proxy.c)
1933+ADD_AND_INSTALL_LIBRARY(mod_redirect mod_redirect.c)
1934+ADD_AND_INSTALL_LIBRARY(mod_rewrite mod_rewrite.c)
1935+ADD_AND_INSTALL_LIBRARY(mod_rrdtool mod_rrdtool.c)
1936+ADD_AND_INSTALL_LIBRARY(mod_scgi mod_scgi.c)
1937+ADD_AND_INSTALL_LIBRARY(mod_secdownload mod_secure_download.c)
1938+ADD_AND_INSTALL_LIBRARY(mod_setenv mod_setenv.c)
1939+ADD_AND_INSTALL_LIBRARY(mod_simple_vhost mod_simple_vhost.c)
1940+ADD_AND_INSTALL_LIBRARY(mod_ssi "mod_ssi_exprparser.c;mod_ssi_expr.c;mod_ssi.c")
1941+ADD_AND_INSTALL_LIBRARY(mod_staticfile mod_staticfile.c)
1942+ADD_AND_INSTALL_LIBRARY(mod_status mod_status.c)
1943+ADD_AND_INSTALL_LIBRARY(mod_trigger_b4_dl mod_trigger_b4_dl.c)
1944+ADD_AND_INSTALL_LIBRARY(mod_uploadprogress mod_uploadprogress.c)
1945+ADD_AND_INSTALL_LIBRARY(mod_userdir mod_userdir.c)
1946+ADD_AND_INSTALL_LIBRARY(mod_usertrack mod_usertrack.c)
1947+ADD_AND_INSTALL_LIBRARY(mod_webdav mod_webdav.c)
1948+
1949+IF(HAVE_PCRE_H)
1950+ ADD_TARGET_PROPERTIES(lighttpd LINK_FLAGS ${PCRE_LDFLAGS})
1951+ ADD_TARGET_PROPERTIES(lighttpd COMPILE_FLAGS ${PCRE_CFLAGS})
1952+ ADD_TARGET_PROPERTIES(mod_rewrite LINK_FLAGS ${PCRE_LDFLAGS})
1953+ ADD_TARGET_PROPERTIES(mod_rewrite COMPILE_FLAGS ${PCRE_CFLAGS})
1954+ ADD_TARGET_PROPERTIES(mod_dirlisting LINK_FLAGS ${PCRE_LDFLAGS})
1955+ ADD_TARGET_PROPERTIES(mod_dirlisting COMPILE_FLAGS ${PCRE_CFLAGS})
1956+ ADD_TARGET_PROPERTIES(mod_redirect LINK_FLAGS ${PCRE_LDFLAGS})
1957+ ADD_TARGET_PROPERTIES(mod_redirect COMPILE_FLAGS ${PCRE_CFLAGS})
1958+ ADD_TARGET_PROPERTIES(mod_ssi LINK_FLAGS ${PCRE_LDFLAGS})
1959+ ADD_TARGET_PROPERTIES(mod_ssi COMPILE_FLAGS ${PCRE_CFLAGS})
1960+ ADD_TARGET_PROPERTIES(mod_trigger_b4_dl LINK_FLAGS ${PCRE_LDFLAGS})
1961+ ADD_TARGET_PROPERTIES(mod_trigger_b4_dl COMPILE_FLAGS ${PCRE_CFLAGS})
1962+ENDIF(HAVE_PCRE_H)
1963+
1964+ADD_TARGET_PROPERTIES(mod_magnet LINK_FLAGS ${LUA_LDFLAGS})
1965+ADD_TARGET_PROPERTIES(mod_magnet COMPILE_FLAGS ${LUA_CFLAGS})
1966+
1967+ADD_TARGET_PROPERTIES(mod_cml LINK_FLAGS ${LUA_LDFLAGS})
1968+ADD_TARGET_PROPERTIES(mod_cml COMPILE_FLAGS ${LUA_CFLAGS})
1969+
1970+IF(HAVE_MYSQL_H AND HAVE_LIBMYSQL)
1971+ TARGET_LINK_LIBRARIES(mod_mysql_vhost mysqlclient)
1972+ INCLUDE_DIRECTORIES(/usr/include/mysql)
1973+ENDIF(HAVE_MYSQL_H AND HAVE_LIBMYSQL)
1974+
1975+SET(L_MOD_WEBDAV)
1976+IF(HAVE_SQLITE3_H)
1977+ SET(L_MOD_WEBDAV ${L_MOD_WEBDAV} sqlite3)
1978+ENDIF(HAVE_SQLITE3_H)
1979+IF(HAVE_LIBXML_H)
1980+ SET_TARGET_PROPERTIES(mod_webdav PROPERTIES LINK_FLAGS ${XML2_LDFLAGS})
1981+ENDIF(HAVE_LIBXML_H)
1982+IF(HAVE_UUID_H)
1983+ IF(NEED_LIBUUID)
1984+ SET(L_MOD_WEBDAV ${L_MOD_WEBDAV} uuid)
1985+ ENDIF(NEED_LIBUUID)
1986+ENDIF(HAVE_UUID_H)
1987+
1988+TARGET_LINK_LIBRARIES(mod_webdav ${L_MOD_WEBDAV})
1989+
1990+SET(L_MOD_AUTH)
1991+IF(HAVE_LIBCRYPT)
1992+ SET(L_MOD_AUTH ${L_MOD_AUTH} crypt)
1993+ENDIF(HAVE_LIBCRYPT)
1994+
1995+IF(HAVE_LDAP_H)
1996+ SET(L_MOD_AUTH ${L_MOD_AUTH} ldap lber)
1997+ENDIF(HAVE_LDAP_H)
1998+TARGET_LINK_LIBRARIES(mod_auth ${L_MOD_AUTH})
1999+
2000+IF(HAVE_ZLIB_H)
2001+ IF(HAVE_BZLIB_H)
2002+ TARGET_LINK_LIBRARIES(mod_compress ${ZLIB_LIBRARY} bz2)
2003+ ELSE(HAVE_BZLIB_H)
2004+ TARGET_LINK_LIBRARIES(mod_compress ${ZLIB_LIBRARY})
2005+ ENDIF(HAVE_BZLIB_H)
2006+ENDIF(HAVE_ZLIB_H)
2007+
2008+IF(HAVE_LIBFAM)
2009+ TARGET_LINK_LIBRARIES(lighttpd fam)
2010+ENDIF(HAVE_LIBFAM)
2011+
2012+IF(HAVE_GDBM_H)
2013+ TARGET_LINK_LIBRARIES(mod_trigger_b4_dl gdbm)
2014+ENDIF(HAVE_GDBM_H)
2015+
2016+IF(HAVE_MEMCACHE_H)
2017+ TARGET_LINK_LIBRARIES(mod_trigger_b4_dl memcache)
2018+ENDIF(HAVE_MEMCACHE_H)
2019+
2020+IF(CMAKE_COMPILER_IS_GNUCC)
2021+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -g -Wshadow -W -pedantic")
2022+ SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
2023+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
2024+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2")
2025+ ADD_DEFINITIONS(-D_GNU_SOURCE)
2026+ENDIF(CMAKE_COMPILER_IS_GNUCC)
2027+
2028+SET_TARGET_PROPERTIES(lighttpd PROPERTIES CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
2029+
2030+IF(WIN32)
2031+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVALGRIND")
2032+ ADD_TARGET_PROPERTIES(lighttpd COMPILE_FLAGS "-DLI_DECLARE_EXPORTS")
2033+ TARGET_LINK_LIBRARIES(lighttpd ws2_32)
2034+ TARGET_LINK_LIBRARIES(mod_proxy ws2_32)
2035+ TARGET_LINK_LIBRARIES(mod_fcgi ws2_32)
2036+ TARGET_LINK_LIBRARIES(mod_scgi ws2_32)
2037+ TARGET_LINK_LIBRARIES(mod_ssi ws2_32)
2038+
2039+ IF(MINGW)
2040+ TARGET_LINK_LIBRARIES(lighttpd msvcr70)
2041+ ADD_TARGET_PROPERTIES(lighttpd LINK_FLAGS "-Wl,-subsystem,console")
2042+ ENDIF(MINGW)
2043+ENDIF(WIN32)
2044+
2045+IF(NOT BUILD_STATIC)
2046+ IF(HAVE_LIBDL)
2047+ TARGET_LINK_LIBRARIES(lighttpd dl)
2048+ ENDIF(HAVE_LIBDL)
2049+ENDIF(NOT BUILD_STATIC)
2050+
2051+IF(HAVE_LIBSSL AND HAVE_LIBCRYPTO)
2052+ TARGET_LINK_LIBRARIES(lighttpd ssl)
2053+ TARGET_LINK_LIBRARIES(lighttpd crypto)
2054+ENDIF(HAVE_LIBSSL AND HAVE_LIBCRYPTO)
2055+
2056+IF(NOT WIN32)
2057+INSTALL(TARGETS ${L_INSTALL_TARGETS}
2058+ RUNTIME DESTINATION ${SBINDIR}
2059+ LIBRARY DESTINATION ${LIGHTTPD_MODULES_DIR}
2060+ ARCHIVE DESTINATION ${LIGHTTPD_MODULES_DIR}/static)
2061+ELSE(NOT WIN32)
2062+## HACK to make win32 to install our libraries in desired directory..
2063+INSTALL(TARGETS lighttpd
2064+ RUNTIME DESTINATION ${SBINDIR}
2065+ ARCHIVE DESTINATION lib/static)
2066+LIST(REMOVE_ITEM L_INSTALL_TARGETS lighttpd)
2067+INSTALL(TARGETS ${L_INSTALL_TARGETS}
2068+ RUNTIME DESTINATION ${SBINDIR}/lib
2069+ LIBRARY DESTINATION lib
2070+ ARCHIVE DESTINATION lib/static)
2071+ENDIF(NOT WIN32)
2072Index: src/mod_accesslog.c
2073===================================================================
25fbab93
ER
2074--- src/mod_accesslog.c (.../tags/lighttpd-1.4.20) (revision 2392)
2075+++ src/mod_accesslog.c (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9
ER
2076@@ -169,13 +169,13 @@
2077 if (fields->size == 0) {
2078 fields->size = 16;
2079 fields->used = 0;
2080- fields->ptr = malloc(fields->size * sizeof(format_fields * ));
2081+ fields->ptr = malloc(fields->size * sizeof(format_field * ));
2082 } else if (fields->used == fields->size) {
2083 fields->size += 16;
2084- fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_fields * ));
2085+ fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * ));
2086 }
2087
2088- fields->ptr[fields->used] = malloc(sizeof(format_fields));
2089+ fields->ptr[fields->used] = malloc(sizeof(format_field));
2090 fields->ptr[fields->used]->type = FIELD_STRING;
2091 fields->ptr[fields->used]->string = buffer_init();
2092
2093@@ -189,10 +189,10 @@
2094 if (fields->size == 0) {
2095 fields->size = 16;
2096 fields->used = 0;
2097- fields->ptr = malloc(fields->size * sizeof(format_fields * ));
2098+ fields->ptr = malloc(fields->size * sizeof(format_field * ));
2099 } else if (fields->used == fields->size) {
2100 fields->size += 16;
2101- fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_fields * ));
2102+ fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * ));
2103 }
2104
2105 /* search for the terminating command */
2106@@ -211,7 +211,7 @@
2107
2108 /* found key */
2109
2110- fields->ptr[fields->used] = malloc(sizeof(format_fields));
2111+ fields->ptr[fields->used] = malloc(sizeof(format_field));
2112 fields->ptr[fields->used]->type = FIELD_FORMAT;
2113 fields->ptr[fields->used]->field = fmap[j].type;
2114 fields->ptr[fields->used]->string = NULL;
2115@@ -258,7 +258,7 @@
2116
2117 /* found key */
2118
2119- fields->ptr[fields->used] = malloc(sizeof(format_fields));
2120+ fields->ptr[fields->used] = malloc(sizeof(format_field));
2121 fields->ptr[fields->used]->type = FIELD_FORMAT;
2122 fields->ptr[fields->used]->field = fmap[j].type;
2123 fields->ptr[fields->used]->string = buffer_init();
2124@@ -291,7 +291,7 @@
2125
2126 /* found key */
2127
2128- fields->ptr[fields->used] = malloc(sizeof(format_fields));
2129+ fields->ptr[fields->used] = malloc(sizeof(format_field));
2130 fields->ptr[fields->used]->type = FIELD_FORMAT;
2131 fields->ptr[fields->used]->field = fmap[j].type;
2132 fields->ptr[fields->used]->string = NULL;
2133@@ -321,13 +321,13 @@
2134 if (fields->size == 0) {
2135 fields->size = 16;
2136 fields->used = 0;
2137- fields->ptr = malloc(fields->size * sizeof(format_fields * ));
2138+ fields->ptr = malloc(fields->size * sizeof(format_field * ));
2139 } else if (fields->used == fields->size) {
2140 fields->size += 16;
2141- fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_fields * ));
2142+ fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * ));
2143 }
2144
2145- fields->ptr[fields->used] = malloc(sizeof(format_fields));
2146+ fields->ptr[fields->used] = malloc(sizeof(format_field));
2147 fields->ptr[fields->used]->type = FIELD_STRING;
2148 fields->ptr[fields->used]->string = buffer_init();
2149
170f212a
ER
2150@@ -540,8 +540,9 @@
2151
2152 return HANDLER_ERROR;
2153 }
2154+#ifdef FD_CLOEXEC
2155 fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
2156-
2157+#endif
2158 }
2159
2160 return HANDLER_GO_ON;
2161@@ -584,6 +585,9 @@
2162
2163 return HANDLER_ERROR;
2164 }
2165+#ifdef FD_CLOEXEC
2166+ fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
2167+#endif
2168 }
2169 }
2170
2171Index: src/fdevent_linux_sysepoll.c
2172===================================================================
25fbab93
ER
2173--- src/fdevent_linux_sysepoll.c (.../tags/lighttpd-1.4.20) (revision 2392)
2174+++ src/fdevent_linux_sysepoll.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2175@@ -91,7 +91,7 @@
2176 if (e & EPOLLHUP) events |= FDEVENT_HUP;
2177 if (e & EPOLLPRI) events |= FDEVENT_PRI;
2178
2179- return e;
2180+ return events;
2181 }
2182
2183 static int fdevent_linux_sysepoll_event_get_fd(fdevents *ev, size_t ndx) {
738baab9
ER
2184Index: src/server.c
2185===================================================================
25fbab93
ER
2186--- src/server.c (.../tags/lighttpd-1.4.20) (revision 2392)
2187+++ src/server.c (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9
ER
2188@@ -210,6 +210,7 @@
2189 srv->srvconf.modules_dir = buffer_init_string(LIBRARY_DIR);
2190 srv->srvconf.network_backend = buffer_init();
2191 srv->srvconf.upload_tempdirs = array_init();
2192+ srv->srvconf.reject_expect_100_with_417 = 1;
2193
2194 /* use syslog */
2195 srv->errorlog_fd = -1;
2196@@ -844,15 +845,16 @@
2197 }
2198
2199 /* set max-conns */
2200- if (srv->srvconf.max_conns > srv->max_fds) {
2201- /* we can't have more connections than max-fds */
2202- srv->max_conns = srv->max_fds;
2203+ if (srv->srvconf.max_conns > srv->max_fds/2) {
2204+ /* we can't have more connections than max-fds/2 */
2205+ log_error_write(srv, __FILE__, __LINE__, "sdd", "can't have more connections than fds/2: ", srv->srvconf.max_conns, srv->max_fds);
2206+ srv->max_conns = srv->max_fds/2;
2207 } else if (srv->srvconf.max_conns) {
2208 /* otherwise respect the wishes of the user */
2209 srv->max_conns = srv->srvconf.max_conns;
2210 } else {
2211- /* or use the default */
2212- srv->max_conns = srv->max_fds;
2213+ /* or use the default: we really don't want to hit max-fds */
2214+ srv->max_conns = srv->max_fds/3;
2215 }
2216
2217 if (HANDLER_GO_ON != plugins_call_init(srv)) {
25fbab93
ER
2218@@ -1243,8 +1245,8 @@
2219
2220 if (srv->cur_ts - con->write_request_ts > con->conf.max_write_idle) {
2221 /* time - out */
2222-#if 1
2223- log_error_write(srv, __FILE__, __LINE__, "sbsosds",
2224+ if (con->conf.log_timeouts) {
2225+ log_error_write(srv, __FILE__, __LINE__, "sbsosds",
2226 "NOTE: a request for",
2227 con->request.uri,
2228 "timed out after writing",
2229@@ -1252,7 +1254,7 @@
2230 "bytes. We waited",
2231 (int)con->conf.max_write_idle,
2232 "seconds. If this a problem increase server.max-write-idle");
2233-#endif
2234+ }
2235 connection_set_state(srv, con, CON_STATE_ERROR);
2236 changed = 1;
2237 }
738baab9
ER
2238@@ -1295,8 +1297,8 @@
2239 if (srv->sockets_disabled) {
2240 /* our server sockets are disabled, why ? */
2241
2242- if ((srv->cur_fds + srv->want_fds < srv->max_fds * 0.8) && /* we have enough unused fds */
2243- (srv->conns->used < srv->max_conns * 0.9) &&
2244+ if ((srv->cur_fds + srv->want_fds < srv->max_fds * 8 / 10) && /* we have enough unused fds */
2245+ (srv->conns->used <= srv->max_conns * 9 / 10) &&
2246 (0 == graceful_shutdown)) {
2247 for (i = 0; i < srv->srv_sockets.used; i++) {
2248 server_socket *srv_socket = srv->srv_sockets.ptr[i];
2249@@ -1308,8 +1310,8 @@
2250 srv->sockets_disabled = 0;
2251 }
2252 } else {
2253- if ((srv->cur_fds + srv->want_fds > srv->max_fds * 0.9) || /* out of fds */
2254- (srv->conns->used > srv->max_conns) || /* out of connections */
2255+ if ((srv->cur_fds + srv->want_fds > srv->max_fds * 9 / 10) || /* out of fds */
2256+ (srv->conns->used >= srv->max_conns) || /* out of connections */
2257 (graceful_shutdown)) { /* graceful_shutdown */
2258
2259 /* disable server-fds */
2260@@ -1348,7 +1350,7 @@
2261
2262 if (graceful_shutdown) {
2263 log_error_write(srv, __FILE__, __LINE__, "s", "[note] graceful shutdown started");
2264- } else if (srv->conns->used > srv->max_conns) {
2265+ } else if (srv->conns->used >= srv->max_conns) {
2266 log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets disabled, connection limit reached");
2267 } else {
2268 log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets disabled, out-of-fds");
170f212a
ER
2269Index: src/log.c
2270===================================================================
25fbab93
ER
2271--- src/log.c (.../tags/lighttpd-1.4.20) (revision 2392)
2272+++ src/log.c (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2273@@ -146,6 +146,10 @@
2274 /* ok, new log is open, close the old one */
2275 close(srv->errorlog_fd);
2276 srv->errorlog_fd = new_fd;
2277+#ifdef FD_CLOEXEC
2278+ /* close fd on exec (cgi) */
2279+ fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
2280+#endif
2281 }
2282 }
2283
709c1a0b
ER
2284Index: src/proc_open.c
2285===================================================================
25fbab93
ER
2286--- src/proc_open.c (.../tags/lighttpd-1.4.20) (revision 2392)
2287+++ src/proc_open.c (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
2288@@ -287,32 +287,33 @@
2289 }
2290 /* }}} */
2291 /* {{{ proc_open_buffer */
2292-int proc_open_buffer(proc_handler_t *proc, const char *command, buffer *in, buffer *out, buffer *err) {
2293+int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err) {
2294+ proc_handler_t proc;
54b68997 2295
709c1a0b
ER
2296- UNUSED(err);
2297-
2298- if (proc_open(proc, command) != 0) {
2299+ if (proc_open(&proc, command) != 0) {
2300 return -1;
2301 }
54b68997 2302
709c1a0b
ER
2303 if (in) {
2304- if (write(proc->in.fd, (void *)in->ptr, in->used) < 0) {
2305+ if (write(proc.in.fd, (void *)in->ptr, in->used) < 0) {
2306 perror("error writing pipe");
2307 return -1;
2308 }
2309 }
2310- pipe_close(&proc->in);
2311+ pipe_close(&proc.in);
54b68997 2312
709c1a0b
ER
2313 if (out) {
2314- proc_read_fd_to_buffer(proc->out.fd, out);
2315+ proc_read_fd_to_buffer(proc.out.fd, out);
2316 }
2317- pipe_close(&proc->out);
2318+ pipe_close(&proc.out);
54b68997 2319
709c1a0b
ER
2320 if (err) {
2321- proc_read_fd_to_buffer(proc->err.fd, err);
2322+ proc_read_fd_to_buffer(proc.err.fd, err);
54b68997 2323 }
709c1a0b
ER
2324- pipe_close(&proc->err);
2325+ pipe_close(&proc.err);
54b68997 2326
709c1a0b
ER
2327+ proc_close(&proc);
2328+
54b68997
ER
2329 return 0;
2330 }
709c1a0b
ER
2331 /* }}} */
2332@@ -366,7 +367,7 @@
2333 RESET();
2334
2335 fprintf(stdout, "test: echo 321 with read\n"); fflush(stdout);
2336- if (proc_open_buffer(&proc, "echo 321", NULL, out, err) != 0) {
2337+ if (proc_open_buffer("echo 321", NULL, out, err) != 0) {
2338 ERROR_OUT();
2339 }
2340 fprintf(stdout, "result: ->%s<-\n\n", out->ptr); fflush(stdout);
2341@@ -374,7 +375,7 @@
2342
2343 fprintf(stdout, "test: echo 123 | " CMD_CAT "\n"); fflush(stdout);
2344 buffer_copy_string_len(in, CONST_STR_LEN("123\n"));
2345- if (proc_open_buffer(&proc, CMD_CAT, in, out, err) != 0) {
2346+ if (proc_open_buffer(CMD_CAT, in, out, err) != 0) {
2347 ERROR_OUT();
2348 }
2349 fprintf(stdout, "result: ->%s<-\n\n", out->ptr); fflush(stdout);
2350Index: src/proc_open.h
54b68997 2351===================================================================
25fbab93
ER
2352--- src/proc_open.h (.../tags/lighttpd-1.4.20) (revision 2392)
2353+++ src/proc_open.h (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b 2354@@ -22,4 +22,4 @@
54b68997 2355
709c1a0b
ER
2356 int proc_close(proc_handler_t *ht);
2357 int proc_open(proc_handler_t *ht, const char *command);
2358-int proc_open_buffer(proc_handler_t *ht, const char *command, buffer *in, buffer *out, buffer *err);
2359+int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err);
170f212a
ER
2360Index: tests/mod-proxy.t
2361===================================================================
25fbab93
ER
2362--- tests/mod-proxy.t (.../tags/lighttpd-1.4.20) (revision 2392)
2363+++ tests/mod-proxy.t (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2364@@ -8,14 +8,24 @@
2365
2366 use strict;
2367 use IO::Socket;
2368-use Test::More tests => 6;
2369+use Test::More tests => 9;
2370 use LightyTest;
2371
2372 my $tf_real = LightyTest->new();
2373 my $tf_proxy = LightyTest->new();
2374
2375 my $t;
2376+my $php_child = -1;
2377
2378+my $phpbin = (defined $ENV{'PHP'} ? $ENV{'PHP'} : '/usr/bin/php-cgi');
2379+$ENV{'PHP'} = $phpbin;
2380+
2381+SKIP: {
2382+ skip "PHP already running on port 1026", 1 if $tf_real->listening_on(1026);
2383+ skip "no php binary found", 1 unless -x $phpbin;
2384+ ok(-1 != ($php_child = $tf_real->spawnfcgi($phpbin, 1026)), "Spawning php");
2385+}
2386+
2387 ## we need two procs
2388 ## 1. the real webserver
2389 ## 2. the proxy server
2390@@ -26,9 +36,9 @@
2391 $tf_proxy->{PORT} = 2050;
2392 $tf_proxy->{CONFIGFILE} = 'proxy.conf';
2393
2394-ok($tf_real->start_proc == 0, "Starting lighttpd") or die();
2395+ok($tf_real->start_proc == 0, "Starting lighttpd") or goto cleanup;
2396
2397-ok($tf_proxy->start_proc == 0, "Starting lighttpd as proxy") or die();
2398+ok($tf_proxy->start_proc == 0, "Starting lighttpd as proxy") or goto cleanup;
2399
2400 $t->{REQUEST} = ( <<EOF
2401 GET /index.html HTTP/1.0
2402@@ -46,6 +56,31 @@
2403 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Server' => 'Apache 1.3.29' } ];
2404 ok($tf_proxy->handle_http($t) == 0, 'drop Server from real server');
2405
2406+SKIP: {
2407+ skip "no PHP running on port 1026", 1 unless $tf_real->listening_on(1026);
2408+ $t->{REQUEST} = ( <<EOF
2409+GET /rewrite/all/some+test%3axxx%20with%20space HTTP/1.0
2410+Host: www.example.org
2411+EOF
2412+ );
2413+ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/some+test%3axxx%20with%20space' } ];
2414+ ok($tf_proxy->handle_http($t) == 0, 'rewrited urls work with encoded path');
2415+}
2416+
2417 ok($tf_proxy->stop_proc == 0, "Stopping lighttpd proxy");
2418
2419 ok($tf_real->stop_proc == 0, "Stopping lighttpd");
2420+
2421+SKIP: {
2422+ skip "PHP not started, cannot stop it", 1 unless $php_child != -1;
2423+ ok(0 == $tf_real->endspawnfcgi($php_child), "Stopping php");
2424+ $php_child = -1;
2425+}
2426+
2427+exit 0;
2428+
2429+cleanup:
2430+
2431+$tf_real->endspawnfcgi($php_child) if $php_child != -1;
2432+
2433+die();
2434Index: tests/CMakeLists.txt
2435===================================================================
2436--- tests/CMakeLists.txt (.../tags/lighttpd-1.4.20) (revision 0)
25fbab93 2437+++ tests/CMakeLists.txt (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2438@@ -0,0 +1,34 @@
2439+SET(T_FILES
2440+ prepare.sh
2441+ cachable.t
2442+ core-404-handler.t
2443+ core-condition.t
2444+ core-keepalive.t
2445+ core-request.t
2446+ core-response.t
2447+ core.t
2448+ core-var-include.t
2449+ lowercase.t
2450+ mod-access.t
2451+ mod-auth.t
2452+ mod-cgi.t
2453+ mod-compress.t
2454+ mod-extforward.t
2455+ mod-fastcgi.t
2456+ mod-proxy.t
2457+ mod-redirect.t
2458+ mod-rewrite.t
2459+ mod-secdownload.t
2460+ mod-setenv.t
2461+ mod-ssi.t
2462+ mod-userdir.t
2463+ request.t
2464+ symlink.t
2465+)
2466+
2467+FOREACH(it ${T_FILES})
2468+ ADD_TEST(${it} "${lighttpd_SOURCE_DIR}/tests/wrapper.sh"
2469+ "${lighttpd_SOURCE_DIR}/tests"
2470+ "${lighttpd_BINARY_DIR}"
2471+ "${lighttpd_SOURCE_DIR}/tests/${it}")
2472+ENDFOREACH(it)
2473Index: tests/SConscript
2474===================================================================
25fbab93
ER
2475--- tests/SConscript (.../tags/lighttpd-1.4.20) (revision 2392)
2476+++ tests/SConscript (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2477@@ -23,6 +23,7 @@
2478 mod-auth.t \
2479 mod-cgi.t \
2480 mod-compress.t \
2481+ mod-compress.conf \
2482 mod-fastcgi.t \
2483 mod-redirect.t \
2484 mod-userdir.t \
2ed0f534
ER
2485Index: tests/mod-compress.conf
2486===================================================================
2487--- tests/mod-compress.conf (.../tags/lighttpd-1.4.20) (revision 0)
25fbab93 2488+++ tests/mod-compress.conf (.../branches/lighttpd-1.4.x) (revision 2392)
2ed0f534
ER
2489@@ -0,0 +1,32 @@
2490+debug.log-request-handling = "enable"
2491+debug.log-response-header = "disable"
2492+debug.log-request-header = "disable"
2493+
2494+server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
2495+server.pid-file = env.SRCDIR + "/tmp/lighttpd/lighttpd.pid"
2496+
2497+## bind to port (default: 80)
2498+server.port = 2048
2499+
2500+## bind to localhost (default: all interfaces)
2501+server.bind = "localhost"
2502+server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2503+server.name = "www.example.org"
2504+
2505+server.modules = (
2506+ "mod_compress"
2507+)
2508+
2509+######################## MODULE CONFIG ############################
2510+
2511+mimetype.assign = (
2512+ ".html" => "text/html",
2513+ ".txt" => "text/plain",
2514+)
2515+
2516+$HTTP["host"] == "cache.example.org" {
2517+ compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
2518+}
2519+compress.filetype = ("text/plain", "text/html")
2520+
2521+compress.allowed-encodings = ( "gzip", "deflate" )
709c1a0b
ER
2522Index: tests/mod-fastcgi.t
2523===================================================================
25fbab93
ER
2524--- tests/mod-fastcgi.t (.../tags/lighttpd-1.4.20) (revision 2392)
2525+++ tests/mod-fastcgi.t (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
2526@@ -7,7 +7,7 @@
2527 }
54b68997 2528
709c1a0b
ER
2529 use strict;
2530-use Test::More tests => 49;
2531+use Test::More tests => 50;
2532 use LightyTest;
54b68997 2533
709c1a0b
ER
2534 my $tf = LightyTest->new();
2535@@ -215,7 +215,7 @@
54b68997 2536 }
a34aaa25 2537
709c1a0b
ER
2538 SKIP: {
2539- skip "no fcgi-auth found", 4 unless -x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe";
2540+ skip "no fcgi-auth found", 5 unless -x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe";
2541
2542 $tf->{CONFIGFILE} = 'fastcgi-auth.conf';
2543 ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
2544@@ -235,6 +235,14 @@
2545 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
2546 ok($tf->handle_http($t) == 0, 'FastCGI - Auth');
a34aaa25 2547
709c1a0b
ER
2548+ $t->{REQUEST} = ( <<EOF
2549+GET /expire/access.txt?ok HTTP/1.0
2550+Host: www.example.org
2551+EOF
2552+ );
2553+ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
2554+ ok($tf->handle_http($t) == 0, 'FastCGI - Auth in subdirectory');
2555+
2556 ok($tf->stop_proc == 0, "Stopping lighttpd");
2557 }
09cf44bb 2558
170f212a
ER
2559Index: tests/mod-rewrite.t
2560===================================================================
25fbab93
ER
2561--- tests/mod-rewrite.t (.../tags/lighttpd-1.4.20) (revision 2392)
2562+++ tests/mod-rewrite.t (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2563@@ -8,7 +8,7 @@
2564
2565 use strict;
2566 use IO::Socket;
2567-use Test::More tests => 8;
2568+use Test::More tests => 7;
2569 use LightyTest;
2570
2571 my $tf = LightyTest->new();
2572@@ -35,7 +35,7 @@
2573 );
2574 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '' } ];
2575 ok($tf->handle_http($t) == 0, 'valid request');
2576-
2577+
2578 $t->{REQUEST} = ( <<EOF
2579 GET /rewrite/foo?a=b HTTP/1.0
2580 Host: www.example.org
2581@@ -52,14 +52,6 @@
2582 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'bar&a=b' } ];
2583 ok($tf->handle_http($t) == 0, 'valid request');
2584
2585- $t->{REQUEST} = ( <<EOF
2586-GET %2Frewrite/f%6Fo?a=b HTTP/1.0
2587-Host: www.example.org
2588-EOF
2589- );
2590- $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'a=b' } ];
2591- ok($tf->handle_http($t) == 0, 'valid request with url encoded characters');
2592-
2593 ok($tf->stop_proc == 0, "Stopping lighttpd");
2594 }
2595
738baab9
ER
2596Index: tests/lighttpd.conf
2597===================================================================
25fbab93
ER
2598--- tests/lighttpd.conf (.../tags/lighttpd-1.4.20) (revision 2392)
2599+++ tests/lighttpd.conf (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9
ER
2600@@ -217,4 +217,5 @@
2601
2602 $HTTP["host"] == "etag.example.org" {
2603 static-file.etags = "disable"
2604+ compress.filetype = ()
2605 }
709c1a0b 2606Index: tests/fastcgi-auth.conf
54b68997 2607===================================================================
25fbab93
ER
2608--- tests/fastcgi-auth.conf (.../tags/lighttpd-1.4.20) (revision 2392)
2609+++ tests/fastcgi-auth.conf (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
2610@@ -89,6 +89,7 @@
2611 "bin-path" => env.SRCDIR + "/fcgi-auth",
2612 "mode" => "authorizer",
2613 "docroot" => env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/",
2614+ "check-local" => "disable",
54b68997 2615
709c1a0b
ER
2616 )
2617 )
170f212a
ER
2618Index: tests/proxy.conf
2619===================================================================
25fbab93
ER
2620--- tests/proxy.conf (.../tags/lighttpd-1.4.20) (revision 2392)
2621+++ tests/proxy.conf (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2622@@ -122,7 +122,8 @@
2623 url.redirect = ( "^/redirect/$" => "http://localhost:2048/" )
2624
2625 url.rewrite = ( "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1",
2626- "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1" )
2627+ "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1",
2628+ "^/rewrite/all(/.*)$" => "/indexfile/rewrite.php?$1" )
2629
2630 expire.url = ( "/expire/access" => "access 2 hours",
2631 "/expire/modification" => "access plus 1 seconds 2 minutes")
2632Index: tests/Makefile.am
2633===================================================================
25fbab93
ER
2634--- tests/Makefile.am (.../tags/lighttpd-1.4.20) (revision 2392)
2635+++ tests/Makefile.am (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2636@@ -38,6 +38,7 @@
2637 mod-auth.t \
2638 mod-cgi.t \
2639 mod-compress.t \
2640+ mod-compress.conf \
2641 mod-fastcgi.t \
2642 mod-redirect.t \
2643 mod-rewrite.t \
2ed0f534
ER
2644Index: tests/mod-compress.t
2645===================================================================
25fbab93
ER
2646--- tests/mod-compress.t (.../tags/lighttpd-1.4.20) (revision 2392)
2647+++ tests/mod-compress.t (.../branches/lighttpd-1.4.x) (revision 2392)
2ed0f534
ER
2648@@ -8,12 +8,14 @@
2649
2650 use strict;
2651 use IO::Socket;
2652-use Test::More tests => 10;
2653+use Test::More tests => 11;
2654 use LightyTest;
2655
2656 my $tf = LightyTest->new();
2657 my $t;
2658
2659+$tf->{CONFIGFILE} = 'mod-compress.conf';
2660+
2661 ok($tf->start_proc == 0, "Starting lighttpd") or die();
2662
2663 $t->{REQUEST} = ( <<EOF
2664@@ -88,5 +90,14 @@
2665 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Type' => "text/plain" } ];
2666 ok($tf->handle_http($t) == 0, 'Empty Accept-Encoding');
2667
2668+$t->{REQUEST} = ( <<EOF
2669+GET /index.txt HTTP/1.0
2670+Accept-Encoding: bzip2, gzip, deflate
2671+Host: cache.example.org
2672+EOF
2673+ );
2674+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Encoding' => 'gzip', 'Content-Type' => "text/plain" } ];
2675+ok($tf->handle_http($t) == 0, 'bzip2 requested but disabled');
2676
2677+
2678 ok($tf->stop_proc == 0, "Stopping lighttpd");
170f212a
ER
2679Index: doc/redirect.txt
2680===================================================================
25fbab93
ER
2681--- doc/redirect.txt (.../tags/lighttpd-1.4.20) (revision 2392)
2682+++ doc/redirect.txt (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2683@@ -39,3 +39,9 @@
2684 $HTTP["host"] =~ "^www\.(.*)" {
2685 url.redirect = ( "^/(.*)" => "http://%1/$1" )
2686 }
2687+
2688+Warning
2689+=======
2690+
2691+Do NOT use mod_redirect to protect specific urls, as the original url passed from the client
2692+is matched against your rules, for example strings like "/abc/../xyz%2f/path".
2ed0f534
ER
2693Index: doc/compress.txt
2694===================================================================
25fbab93
ER
2695--- doc/compress.txt (.../tags/lighttpd-1.4.20) (revision 2392)
2696+++ doc/compress.txt (.../branches/lighttpd-1.4.x) (revision 2392)
2ed0f534
ER
2697@@ -6,13 +6,7 @@
2698 Module: mod_compress
2699 --------------------
2700
2701-:Author: Jan Kneschke
2702-:Date: $Date$
2703-:Revision: $Revision$
2704
2705-:abstract:
2706- a nice, short abstrace about the module
2707-
2708 .. meta::
2709 :keywords: lighttpd, compress
2710
2711@@ -22,16 +16,57 @@
2712 ===========
2713
2714 Output compression reduces the network load and can improve the overall
2715-throughput of the webserver.
2716+throughput of the webserver. All major http-clients support compression by
2717+announcing it in the Accept-Encoding header. This is used to negotiate the
2718+most suitable compression method. We support deflate, gzip and bzip2.
2719
2720-Only static content is supported up to now.
2721+deflate (RFC1950, RFC1951) and gzip (RFC1952) depend on zlib while bzip2
2722+depends on libbzip2. bzip2 is only supported by lynx and some other console
2723+text-browsers.
2724
2725-The server negotiates automaticly which compression method is used.
2726-Supported are gzip, deflate, bzip.
2727+We currently limit to compression support to static files.
2728
2729+Caching
2730+-------
2731+
2732+mod_compress can store compressed files on disk to optimize the compression
2733+on a second request away. As soon as compress.cache-dir is set the files are
2734+compressed.
2735+
2736+(You will need to create the cache directory if it doesn't already exist. The web server will not do this for you. The directory will also need the proper ownership. For Debian/Ubuntu the user and group ids should both be www-data.)
2737+
2738+The names of the cache files are made of the filename, the compression method
2739+and the etag associated to the file.
2740+
2741+Cleaning the cache is left to the user. A cron job deleting files older than
2742+10 days could do it: ::
2743+
2744+ find /var/www/cache -type f -mtime +10 | xargs -r rm
2745+
2746+Limitations
2747+-----------
2748+
2749+The module limits the compression of files to files smaller than 128 MByte and
2750+larger than 128 Byte.
2751+
2752+The lower limit is set as small files tend to become larger by compressing due
2753+to the compression headers, the upper limit is set to work sensibly with
2754+memory and cpu-time.
2755+
2756+Directories containing a tilde ('~') are not created automatically (See ticket
2757+#113). To enable compression for user dirs you have to create the directories
2758+by hand in the cache directory.
2759+
2760 Options
2761 =======
2762
2763+compress.allowed-encodings
2764+ override default set of allowed encodings
2765+
2766+ e.g.: ::
2767+
2768+ compress.allowed-encodings = ("bzip2", "gzip", "deflate")
2769+
2770 compress.cache-dir
2771 name of the directory where compressed content will be cached
2772
2773@@ -47,20 +82,111 @@
2774 Default: not set, compress the file for every request
2775
2776 compress.filetype
2777- mimetypes where might get compressed
2778+ mimetypes which might get compressed
2779
2780 e.g.: ::
2781
2782 compress.filetype = ("text/plain", "text/html")
2783
2784+ Keep in mind that compressed JavaScript and CSS files are broken in some
2785+ browsers. Not setting any filetypes will result in no files being compressed.
2786+
2787+ NOTE: You have to specify the full mime-type! If you also define a charset, for example, you have to use "text/plain; charset=utf-8" instead of just "text/plain".
2788+
2789 Default: not set
2790
2791+compress.max-filesize
2792+ maximum size of the original file to be compressed kBytes.
2793
2794+ This is meant to protect the server against DoSing as compressing large
2795+ (let's say 1Gbyte) takes a lot of time and would delay the whole operation
2796+ of the server.
2797+
2798+ There is a hard upper limit of 128Mbyte.
2799+
2800+ Default: unlimited (== hard-limit of 128MByte)
2801+
2802+Display compressed files
2803+========================
2804+
2805+If you enable mod_compress, and you want to force clients to uncompress and display compressed text files, please force mimetype to nothing.
2806+Exemple :
2807+If you want to add headers for uncompress and display diff.gz files , add this section in your conf : ::
2808+
2809+ $HTTP["url"] =~ "\.diff\.gz" {
2810+ setenv.add-response-header = ( "Content-Encoding" => "gzip" )
2811+ mimetype.assign = ()
2812+ }
2813+
2814+
2815 Compressing Dynamic Content
2816 ===========================
2817
2818+PHP
2819+---
2820+
2821 To compress dynamic content with PHP please enable ::
2822
2823 zlib.output_compression = 1
2824+ zlib.output_handler = On
2825
2826 in the php.ini as PHP provides compression support by itself.
2827+
2828+mod_compress of lighttpd 1.5 r1992 may not set correct Content-Encoding with php-fcgi. A solution to that problem would be:
2829+
2830+1.disable mod_compress when request a php file::
2831+
2832+ $HTTP["url"] !~ "\.php$" {
2833+ compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml")
2834+ }
2835+
2836+2.enable mod_setenv of your lighttpd::
2837+
2838+ server.modules += ( "mod_setenv" )
2839+
2840+3.manually set Content-Encoding::
2841+
2842+ $HTTP["url"] =~ "\.php$" {
2843+ setenv.add-response-header = ( "Content-Encoding" => "gzip")
2844+ }
2845+
2846+
2847+TurboGears
2848+----------
2849+
2850+To compress dynamic content with TurboGears please enable ::
2851+
2852+ [/]
2853+ gzip_filter.on = True
2854+ gzip_filter.mime_types = ["application/x-javascript", "text/javascript", "text/html", "text/css", "text/plain"]
2855+
2856+in the config/app.cfg file in your TurboGears application. The above lines should already be in the file. You just need to remove the comment symbol in front of the lines to make them active.
2857+
2858+Django
2859+------
2860+
2861+To compress dynamic content with Django please enable the GZipMiddleware ::
2862+
2863+ MIDDLEWARE_CLASSES = (
2864+ 'django.middleware.gzip.GZipMiddleware',
2865+ ...
2866+ )
2867+
2868+in the settings.py file in your Django project.
2869+
2870+Catalyst
2871+--------
2872+
2873+To compress dynamic content with Perl/Catalyst, simply use the Catalyst::Plugin::Compress::Gzip module available on CPAN ::
2874+
2875+ use Catalyst qw(
2876+ Compress::Gzip
2877+ ...
2878+ );
2879+
2880+in your main package (MyApp.pm). Further configuration is not required.
2881+
2882+}}}
2883+
2884+
2885+
25fbab93
ER
2886Index: doc/configuration.txt
2887===================================================================
2888--- doc/configuration.txt (.../tags/lighttpd-1.4.20) (revision 2392)
2889+++ doc/configuration.txt (.../branches/lighttpd-1.4.x) (revision 2392)
2890@@ -90,13 +90,21 @@
2891 $HTTP["host"]
2892 match on host
2893 $HTTP["useragent"]
2894+$HTTP["user-agent"]
2895 match on useragent
2896 $HTTP["referer"]
2897 match on referer
2898+$HTTP["method"]
2899+ math on the http method
2900 $HTTP["url"]
2901 match on url
2902+$HTTP["query-string"]
2903+ match on the (not decoded) query-string
2904 $HTTP["remoteip"]
2905+$HTTP["remote-ip"]
2906 match on the remote IP or a remote Network
2907+$HTTP["language"]
2908+ match on the Accept-Language header
2909 $SERVER["socket"]
2910 match on socket. Value must be on the format "ip:port" where ip is an IP
2911 address and port a port number. Only equal match (==) is supported.
170f212a
ER
2912Index: doc/rewrite.txt
2913===================================================================
25fbab93
ER
2914--- doc/rewrite.txt (.../tags/lighttpd-1.4.20) (revision 2392)
2915+++ doc/rewrite.txt (.../branches/lighttpd-1.4.x) (revision 2392)
170f212a
ER
2916@@ -43,6 +43,12 @@
2917 The options ``url.rewrite`` and ``url.rewrite-final`` were mapped to ``url.rewrite-once``
2918 in 1.3.16.
2919
2920+Warning
2921+=======
2922+
2923+Do NOT use mod_rewrite to protect specific urls, as the original url passed from the client
2924+is matched against your rules, for example strings like "/abc/../xyz%2f/path".
2925+
2926 Examples
2927 ========
2928
1e1cc0d1
ER
2929Index: SConstruct
2930===================================================================
25fbab93
ER
2931--- SConstruct (.../tags/lighttpd-1.4.20) (revision 2392)
2932+++ SConstruct (.../branches/lighttpd-1.4.x) (revision 2392)
49b4da39
ER
2933@@ -5,7 +5,7 @@
2934 from stat import *
2935
2936 package = 'lighttpd'
709c1a0b
ER
2937-version = '1.4.20'
2938+version = '1.4.21'
10dbb8f0 2939
49b4da39
ER
2940 def checkCHeaders(autoconf, hdrs):
2941 p = re.compile('[^A-Z0-9]')
ad6a5263
ER
2942Index: Makefile.am
2943===================================================================
25fbab93
ER
2944--- Makefile.am (.../tags/lighttpd-1.4.20) (revision 2392)
2945+++ Makefile.am (.../branches/lighttpd-1.4.x) (revision 2392)
709c1a0b
ER
2946@@ -1,4 +1,4 @@
2947-SUBDIRS=src doc tests cygwin openwrt
2948+SUBDIRS=src doc tests
2949
2950 EXTRA_DIST=autogen.sh SConstruct
ad6a5263 2951
cc1350fa
ER
2952Index: NEWS
2953===================================================================
25fbab93
ER
2954--- NEWS (.../tags/lighttpd-1.4.20) (revision 2392)
2955+++ NEWS (.../branches/lighttpd-1.4.x) (revision 2392)
2956@@ -3,8 +3,44 @@
cc1350fa
ER
2957 NEWS
2958 ====
2959
709c1a0b
ER
2960-- 1.4.20 -
2961+- 1.4.21 -
2962
2963+ * Fix base64 decoding in mod_auth (#1757, thx guido)
2964+ * Fix mod_cgi segfault when bound to unix domain socket (#653)
2965+ * Do not rely on ioctl FIONREAD (#673)
2966+ * Now really fix mod auth ldap (#1066)
2967+ * Fix leaving zombie process with include_shell (#1777)
2968+ * Removed debian/, openwrt/ and cygwin/; they weren't kept up-to-date, and we decided to remove dist. specific stuff
2969+ * Try to convert string options to shorts for numeric options in config file; allows to use env-vars for numeric options. (#1159, thx andrewb)
2970+ * Do not cache default vhost in mod_simple_vhost (#709)
2971+ * Trust pcre-config, do not check for pcre manually (#1769)
2972+ * Fix fastcgi authorization in subdirectories with check-local=disabled; don't split pathinfo for authorizer. (#963)
2ed0f534
ER
2973+ * Add possibility to disable methods in mod_compress (#1773)
2974+ * Fix duplicate connection keep-alive/transfer-encoding headers (#960)
2975+ * Fixed fix for round-robin in mod_proxy (forgot to increment the index) (#1715)
170f212a
ER
2976+ * Fix fastcgi-authorizer handling; Status: 200 is now accepted as the doc requests
2977+ * Compare address family in inet_ntop_cache
2978+ * Revert CVE-2008-4359 (#1720) fix "encoding+simplifying urls for rewrite/redirect": too many regressions.
2979+ * Use FD_CLOEXEC if possible (fixes #1821)
2980+ * Optimized buffer usage in mod_proxy (fixes #1850)
2981+ * Fix uninitialized value in time struct after strptime
738baab9
ER
2982+ * Do not pass Proxy-Connection: header from client to backend http server in mod_proxy (#1877)
2983+ * Fix wrong malloc sizes in mod_accesslog (probably nothing bad happened...) (fixes #1855, thx ycheng)
2984+ * Some small buffer.c fixes (closes #1837)
2985+ * Remove floating point math from server.c (fixes #1402)
2986+ * Disable SSLv2 by default
2987+ * Use/enforce sane max-connection values (fixes #1803)
2988+ * Allow mod_compress to return 304 (Not Modified); compress ignores the static-file.etags option.(fixes #1884)
2989+ * Add option to ignore the "Expect: 100-continue" header instead of returning 417 Expectation failed (closes #1017)
2990+ * Use modified etags in mod_compress (fixes #1800)
2991+ * Fix max-connection limit handling/100% cpu usage (fixes #1436)
2992+ * Fix error handling in freebsd-sendfile (fixes #1813)
25fbab93
ER
2993+ * Silenced the annoying "request timed out" warning, enable with the "debug.log-timeouts" option (fixes #1529)
2994+ * Allow tabs in header values (fixes #1822)
2995+ * Added Language conditional (fixes #1119); patch by petar
709c1a0b
ER
2996+
2997+- 1.4.20 - 2008-09-30
2998+
2999 * Fix mod_compress to compile with old gcc version (#1592)
3000 * Fix mod_extforward to compile with old gcc version (#1591)
3001 * Update documentation for #1587
25fbab93 3002@@ -49,10 +85,10 @@
170f212a
ER
3003 * allow digits in [s]cgi env vars (#1712)
3004 * fixed dropping last character of evhost pattern (#161)
3005 * print helpful error message on conditionals in global block (#1550)
3006- * decode url before matching in mod_rewrite (#1720)
3007+ * decode url before matching in mod_rewrite (#1720) -- (reverted for 1.4.21)
2ed0f534 3008 * fixed conditional patching of ldap filter (#1564)
170f212a 3009- * Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server)
2ed0f534 3010- * fixed bug with case-insensitive filenames in mod_userdir (#1589), spotted by "anders1"
170f212a 3011+ * Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server) [2281]
2ed0f534
ER
3012+ * fixed bug with case-insensitive filenames in mod_userdir (#1589), spotted by "anders1" (CVE-2008-4360)
3013 * fixed format string bugs in mod_accesslog for SYSLOG
3014 * replaced fprintf with log_error_write in fastcgi debug
3015 * fixed mem leak in ssi expression parser (#1753), thx Take5k
25fbab93 3016@@ -62,9 +98,9 @@
2ed0f534
ER
3017 * fix splitting of auth-ldap filter
3018 * workaround ldap connection leak if a ldap connection failed (restarting ldap)
3019 * fix auth.backend.ldap.bind-dn/pw problems (only read from global context for temporary ldap reconnects, thx ruskie)
3020- * fix memleak in request header parsing (#1774, thx qhy)
3021+ * fix memleak in request header parsing (#1774, thx qhy) (CVE-2008-4298)
3022 * fix mod_rewrite memleak/endless loop detection (#1775, thx phy - again!)
3023- * use decoded url for matching in mod_redirect (#1720)
170f212a 3024+ * use decoded url for matching in mod_redirect (#1720) (CVE-2008-4359) -- (reverted for 1.4.21)
2ed0f534
ER
3025
3026 - 1.4.19 - 2008-03-10
3027
170f212a
ER
3028Index: CMakeLists.txt
3029===================================================================
3030--- CMakeLists.txt (.../tags/lighttpd-1.4.20) (revision 0)
25fbab93 3031+++ CMakeLists.txt (.../branches/lighttpd-1.4.x) (revision 2392)
738baab9 3032@@ -0,0 +1,27 @@
170f212a
ER
3033+PROJECT(lighttpd C)
3034+
3035+CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0 FATAL_ERROR)
3036+
3037+SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
3038+
3039+INCLUDE(CTest)
3040+
3041+ENABLE_TESTING()
3042+
738baab9
ER
3043+SET(CPACK_PACKAGE_VERSION_MAJOR 1)
3044+SET(CPACK_PACKAGE_VERSION_MINOR 4)
3045+SET(CPACK_PACKAGE_VERSION_PATCH 21)
3046+SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
170f212a
ER
3047+
3048+SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
3049+SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README")
3050+SET(CPACK_PACKAGE_VENDOR "jan@kneschke.de")
3051+
3052+SET(CPACK_SOURCE_GENERATOR "TGZ")
3053+SET(CPACK_SOURCE_IGNORE_FILES "/\\\\.;~$;/_;build/;CMakeFiles/;CMakeCache;gz$;Makefile\\\\.;trace;Testing/;foo;autom4te;cmake_install;CPack;\\\\.pem;ltmain.sh;configure;libtool;/config\\\\.;missing;autogen.sh;install-sh;Dart;aclocal;log$;Makefile$")
3054+
3055+SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
3056+
3057+ADD_SUBDIRECTORY(src build)
3058+#ADD_SUBDIRECTORY(doc)
3059+ADD_SUBDIRECTORY(tests)
a34aaa25
ER
3060
3061Property changes on: .
3062___________________________________________________________________
709c1a0b
ER
3063Modified: bzr:revision-info
3064 - timestamp: 2008-09-23 21:04:22.819999933 +0200
54b68997
ER
3065committer: Stefan Bühler <stbuehler@web.de>
3066properties:
3067 branch-nick: lighttpd-1.4.x
3068
25fbab93 3069 + timestamp: 2009-02-05 23:27:05.799999952 +0100
709c1a0b
ER
3070committer: Stefan Bühler <stbuehler@web.de>
3071properties:
3072 branch-nick: lighttpd-1.4.x
3073
3074Modified: bzr:revision-id:v3-trunk0
3075 - 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
30761128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
30771129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
30781130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
30791131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
30801132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
30811133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
30821134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
30831135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
30841136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
30851137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
30861138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
30871139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
30881140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
30891141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
30901142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
30911143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
30921144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
30931145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
30941146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
30951147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
30961148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
30971149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
30981150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
30991151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
31001152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
31011153 stbuehler@web.de-20080812194728-fupt781o6q058unh
31021154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
31031155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
31041156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
31051157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
31061158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
31071159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
31081160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
31091161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
31101162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
31111163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
31121164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
31131165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
31141166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
31151167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
31161168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
31171169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
31181170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
31191171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
31201172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
31211173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
31221174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
31231175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
3124
54b68997
ER
3125 + 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
31261128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
31271129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
31281130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
31291131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
31301132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
31311133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
31321134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
31331135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
31341136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
31351137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
31361138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
31371139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
31381140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
31391141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
31401142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
31411143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
31421144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
31431145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
31441146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
31451147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
31461148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
31471149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
31481150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
31491151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
31501152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
31511153 stbuehler@web.de-20080812194728-fupt781o6q058unh
31521154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
31531155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
31541156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
31551157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
31561158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
31571159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
31581160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
31591161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
31601162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
31611163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
31621164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
31631165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
31641166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
31651167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
31661168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
31671169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
31681170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
709c1a0b
ER
31691171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
31701172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
31711173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
31721174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
31731175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
31741176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
31751177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
31761178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
31771179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
31781180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
31791181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
31801182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
31811183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
31821184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
31831185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
31841186 stbuehler@web.de-20081001200802-l5og517etnneitk0
2ed0f534
ER
31851188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
31861189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
31871191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
170f212a
ER
31881192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
31891193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
31901195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
31911196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
31921197 stbuehler@web.de-20081016121114-65quosenmso8frf8
31931198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
31941199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
31951200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
31961201 stbuehler@web.de-20081205233903-708beaujtf26gprx
31971202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
31981203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
31991204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
32001205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
32011206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
738baab9
ER
32021208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
32031209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
32041210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
32051211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
32061212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
32071213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
32081214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
32091215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
32101216 stbuehler@web.de-20090205105134-6i5key9439wspueq
32111217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
32121218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3
25fbab93
ER
32131219 stbuehler@web.de-20090205215425-vicbc6hzb3at7gj9
32141220 stbuehler@web.de-20090205220741-vqz9l1eui3dwnulq
32151221 stbuehler@web.de-20090205222705-8179v6jkv2x38l70
54b68997 3216
a34aaa25 3217
This page took 0.485371 seconds and 4 git commands to generate.