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