]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd-branch.diff
- up to r2505 (Fix evasive.silent option)
[packages/lighttpd.git] / lighttpd-branch.diff
1 Index: configure.in
2 ===================================================================
3 Index: src/spawn-fcgi.c
4 ===================================================================
5 --- src/spawn-fcgi.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
6 +++ src/spawn-fcgi.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
7 @@ -1,481 +0,0 @@
8 -#include <sys/types.h>
9 -#include <sys/time.h>
10 -#include <sys/stat.h>
11 -
12 -#include <stdlib.h>
13 -#include <string.h>
14 -#include <errno.h>
15 -#include <stdio.h>
16 -#include <unistd.h>
17 -#include <fcntl.h>
18 -
19 -#ifdef HAVE_CONFIG_H
20 -#include "config.h"
21 -#endif
22 -
23 -
24 -#ifdef HAVE_PWD_H
25 -#include <grp.h>
26 -#include <pwd.h>
27 -#endif
28 -
29 -#ifdef HAVE_GETOPT_H
30 -#include <getopt.h>
31 -#endif
32 -
33 -#define FCGI_LISTENSOCK_FILENO 0
34 -
35 -#include "sys-socket.h"
36 -
37 -#ifdef HAVE_SYS_WAIT_H
38 -#include <sys/wait.h>
39 -#endif
40 -
41 -/* for solaris 2.5 and netbsd 1.3.x */
42 -#ifndef HAVE_SOCKLEN_T
43 -typedef int socklen_t;
44 -#endif
45 -
46 -#ifdef HAVE_SYS_UN_H
47 -int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int fork_count, int child_count, int pid_fd, int nofork) {
48 -       int fcgi_fd;
49 -       int socket_type, status, rc = 0;
50 -       struct timeval tv = { 0, 100 * 1000 };
51 -
52 -       struct sockaddr_un fcgi_addr_un;
53 -       struct sockaddr_in fcgi_addr_in;
54 -       struct sockaddr *fcgi_addr;
55 -
56 -       socklen_t servlen;
57 -
58 -       if (child_count < 2) {
59 -               child_count = 5;
60 -       }
61 -
62 -       if (child_count > 256) {
63 -               child_count = 256;
64 -       }
65 -
66 -
67 -       if (unixsocket) {
68 -               memset(&fcgi_addr_un, 0, sizeof(fcgi_addr_un));
69 -
70 -               fcgi_addr_un.sun_family = AF_UNIX;
71 -               strcpy(fcgi_addr_un.sun_path, unixsocket);
72 -
73 -#ifdef SUN_LEN
74 -               servlen = SUN_LEN(&fcgi_addr_un);
75 -#else
76 -               /* stevens says: */
77 -               servlen = strlen(fcgi_addr_un.sun_path) + sizeof(fcgi_addr_un.sun_family);
78 -#endif
79 -               socket_type = AF_UNIX;
80 -               fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
81 -       } else {
82 -               memset(&fcgi_addr_in, 0, sizeof(fcgi_addr_in));
83 -               fcgi_addr_in.sin_family = AF_INET;
84 -               if (addr != NULL) {
85 -                       fcgi_addr_in.sin_addr.s_addr = inet_addr(addr);
86 -               } else {
87 -                       fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
88 -               }
89 -               fcgi_addr_in.sin_port = htons(port);
90 -               servlen = sizeof(fcgi_addr_in);
91 -
92 -               socket_type = AF_INET;
93 -               fcgi_addr = (struct sockaddr *) &fcgi_addr_in;
94 -       }
95 -
96 -       if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
97 -               fprintf(stderr, "%s.%d\n",
98 -                       __FILE__, __LINE__);
99 -               return -1;
100 -       }
101 -
102 -       if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {
103 -               /* server is not up, spawn in  */
104 -               pid_t child;
105 -               int val;
106 -
107 -               if (unixsocket) unlink(unixsocket);
108 -
109 -               close(fcgi_fd);
110 -
111 -               /* reopen socket */
112 -               if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
113 -                       fprintf(stderr, "%s.%d\n",
114 -                               __FILE__, __LINE__);
115 -                       return -1;
116 -               }
117 -
118 -               val = 1;
119 -               if (setsockopt(fcgi_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
120 -                       fprintf(stderr, "%s.%d\n",
121 -                               __FILE__, __LINE__);
122 -                       return -1;
123 -               }
124 -
125 -               /* create socket */
126 -               if (-1 == bind(fcgi_fd, fcgi_addr, servlen)) {
127 -                       fprintf(stderr, "%s.%d: bind failed: %s\n",
128 -                               __FILE__, __LINE__,
129 -                               strerror(errno));
130 -                       return -1;
131 -               }
132 -
133 -               if (-1 == listen(fcgi_fd, 1024)) {
134 -                       fprintf(stderr, "%s.%d: fd = -1\n",
135 -                               __FILE__, __LINE__);
136 -                       return -1;
137 -               }
138 -
139 -               while (fork_count-- > 0) {
140 -
141 -                       if (!nofork) {
142 -                               child = fork();
143 -                       } else {
144 -                               child = 0;
145 -                       }
146 -
147 -                       switch (child) {
148 -                       case 0: {
149 -                               char cgi_childs[64];
150 -                               int max_fd = 0;
151 -
152 -                               int i = 0;
153 -
154 -                               /* loose control terminal */
155 -                               setsid();
156 -
157 -                               /* is safe as we limit to 256 childs */
158 -                               sprintf(cgi_childs, "PHP_FCGI_CHILDREN=%d", child_count);
159 -
160 -                               if(fcgi_fd != FCGI_LISTENSOCK_FILENO) {
161 -                                       close(FCGI_LISTENSOCK_FILENO);
162 -                                       dup2(fcgi_fd, FCGI_LISTENSOCK_FILENO);
163 -                                       close(fcgi_fd);
164 -                               }
165 -
166 -                               max_fd = open("/dev/null", O_RDWR);
167 -                               close(STDERR_FILENO);
168 -                               dup2(max_fd, STDERR_FILENO);
169 -                               close(max_fd);
170 -
171 -                               max_fd = open("/dev/null", O_RDWR);
172 -                               close(STDOUT_FILENO);
173 -                               dup2(max_fd, STDOUT_FILENO);
174 -                               close(max_fd);
175 -
176 -                               /* we don't need the client socket */
177 -                               for (i = 3; i < max_fd; i++) {
178 -                                       if (i != FCGI_LISTENSOCK_FILENO) close(i);
179 -                               }
180 -
181 -                               /* create environment */
182 -
183 -                               putenv(cgi_childs);
184 -
185 -                               /* fork and replace shell */
186 -                               if (appArgv) {
187 -                                       execv(appArgv[0], appArgv);
188 -
189 -                               } else {
190 -                                       char *b = malloc(strlen("exec ") + strlen(appPath) + 1);
191 -                                       strcpy(b, "exec ");
192 -                                       strcat(b, appPath);
193 -
194 -                                       /* exec the cgi */
195 -                                       execl("/bin/sh", "sh", "-c", b, (char *)NULL);
196 -                               }
197 -
198 -                               exit(errno);
199 -
200 -                               break;
201 -                       }
202 -                       case -1:
203 -                               /* error */
204 -                               break;
205 -                       default:
206 -                               /* father */
207 -
208 -                               /* wait */
209 -                               select(0, NULL, NULL, NULL, &tv);
210 -
211 -                               switch (waitpid(child, &status, WNOHANG)) {
212 -                               case 0:
213 -                                       fprintf(stdout, "%s.%d: child spawned successfully: PID: %d\n",
214 -                                               __FILE__, __LINE__,
215 -                                               child);
216 -
217 -                                       /* write pid file */
218 -                                       if (pid_fd != -1) {
219 -                                               /* assume a 32bit pid_t */
220 -                                               char pidbuf[12];
221 -
222 -                                               snprintf(pidbuf, sizeof(pidbuf) - 1, "%d", child);
223 -
224 -                                               write(pid_fd, pidbuf, strlen(pidbuf));
225 -                                               /* avoid eol for the last one */
226 -                                               if (fork_count != 0) {
227 -                                                       write(pid_fd, "\n", 1);
228 -                                               }
229 -                                       }
230 -
231 -                                       break;
232 -                               case -1:
233 -                                       break;
234 -                               default:
235 -                                       if (WIFEXITED(status)) {
236 -                                               fprintf(stderr, "%s.%d: child exited with: %d\n",
237 -                                                       __FILE__, __LINE__, WEXITSTATUS(status));
238 -                                               rc = WEXITSTATUS(status);
239 -                                       } else if (WIFSIGNALED(status)) {
240 -                                               fprintf(stderr, "%s.%d: child signaled: %d\n",
241 -                                                       __FILE__, __LINE__,
242 -                                                       WTERMSIG(status));
243 -                                               rc = 1;
244 -                                       } else {
245 -                                               fprintf(stderr, "%s.%d: child died somehow: %d\n",
246 -                                                       __FILE__, __LINE__,
247 -                                                       status);
248 -                                               rc = status;
249 -                                       }
250 -                               }
251 -
252 -                               break;
253 -                       }
254 -               }
255 -               close(pid_fd);
256 -               pid_fd = -1;
257 -       } else {
258 -               fprintf(stderr, "%s.%d: socket is already used, can't spawn\n",
259 -                       __FILE__, __LINE__);
260 -               return -1;
261 -       }
262 -
263 -       close(fcgi_fd);
264 -
265 -       return rc;
266 -}
267 -
268 -
269 -void show_version () {
270 -       char *b = "spawn-fcgi" "-" PACKAGE_VERSION \
271 -" - spawns fastcgi processes\n"
272 -;
273 -       write(1, b, strlen(b));
274 -}
275 -
276 -void show_help () {
277 -       char *b = \
278 -"Usage: spawn-fcgi [options] -- <fcgiapp> [fcgi app arguments]\n" \
279 -"\n" \
280 -"spawn-fcgi v" PACKAGE_VERSION " - spawns fastcgi processes\n" \
281 -"\n" \
282 -"Options:\n" \
283 -" -f <fcgiapp> filename of the fcgi-application\n" \
284 -" -a <addr>    bind to ip address\n" \
285 -" -p <port>    bind to tcp-port\n" \
286 -" -s <path>    bind to unix-domain socket\n" \
287 -" -C <childs>  (PHP only) numbers of childs to spawn (default 5)\n" \
288 -" -F <childs>  numbers of childs to fork (default 1)\n" \
289 -" -P <path>    name of PID-file for spawed process\n" \
290 -" -n           no fork (for daemontools)\n" \
291 -" -v           show version\n" \
292 -" -h           show this help\n" \
293 -"(root only)\n" \
294 -" -c <dir>     chroot to directory\n" \
295 -" -u <user>    change to user-id\n" \
296 -" -g <group>   change to group-id\n" \
297 -;
298 -       write(1, b, strlen(b));
299 -}
300 -
301 -
302 -int main(int argc, char **argv) {
303 -       char *fcgi_app = NULL, *changeroot = NULL, *username = NULL,
304 -               *groupname = NULL, *unixsocket = NULL, *pid_file = NULL,
305 -                *addr = NULL;
306 -       char **fcgi_app_argv = { NULL };
307 -       unsigned short port = 0;
308 -       int child_count = 5;
309 -       int fork_count = 1;
310 -       int i_am_root, o;
311 -       int pid_fd = -1;
312 -       int nofork = 0;
313 -       struct sockaddr_un un;
314 -
315 -       i_am_root = (getuid() == 0);
316 -
317 -       while (-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:F:s:P:"))) {
318 -               switch(o) {
319 -               case 'f': fcgi_app = optarg; break;
320 -               case 'a': addr = optarg;/* ip addr */ break;
321 -               case 'p': port = strtol(optarg, NULL, 10);/* port */ break;
322 -               case 'C': child_count = strtol(optarg, NULL, 10);/*  */ break;
323 -               case 'F': fork_count = strtol(optarg, NULL, 10);/*  */ break;
324 -               case 's': unixsocket = optarg; /* unix-domain socket */ break;
325 -               case 'c': if (i_am_root) { changeroot = optarg; }/* chroot() */ break;
326 -               case 'u': if (i_am_root) { username = optarg; } /* set user */ break;
327 -               case 'g': if (i_am_root) { groupname = optarg; } /* set group */ break;
328 -               case 'n': nofork = 1; break;
329 -               case 'P': pid_file = optarg; /* PID file */ break;
330 -               case 'v': show_version(); return 0;
331 -               case 'h': show_help(); return 0;
332 -               default:
333 -                       show_help();
334 -                       return -1;
335 -               }
336 -       }
337 -
338 -       if (optind < argc) {
339 -               fcgi_app_argv = &argv[optind];
340 -       }
341 -
342 -       if ((fcgi_app == NULL && fcgi_app_argv == NULL) || (port == 0 && unixsocket == NULL)) {
343 -               show_help();
344 -               return -1;
345 -       }
346 -
347 -       if (unixsocket && port) {
348 -               fprintf(stderr, "%s.%d: %s\n",
349 -                       __FILE__, __LINE__,
350 -                       "either a unix domain socket or a tcp-port, but not both\n");
351 -
352 -               return -1;
353 -       }
354 -
355 -       if (unixsocket && strlen(unixsocket) > sizeof(un.sun_path) - 1) {
356 -               fprintf(stderr, "%s.%d: %s\n",
357 -                       __FILE__, __LINE__,
358 -                       "path of the unix socket is too long\n");
359 -
360 -               return -1;
361 -       }
362 -
363 -       /* UID handling */
364 -       if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
365 -               /* we are setuid-root */
366 -
367 -               fprintf(stderr, "%s.%d: %s\n",
368 -                       __FILE__, __LINE__,
369 -                       "Are you nuts ? Don't apply a SUID bit to this binary\n");
370 -
371 -               return -1;
372 -       }
373 -
374 -       if (pid_file &&
375 -           (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)))) {
376 -               struct stat st;
377 -               if (errno != EEXIST) {
378 -                       fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
379 -                               __FILE__, __LINE__,
380 -                               pid_file, strerror(errno));
381 -
382 -                       return -1;
383 -               }
384 -
385 -               /* ok, file exists */
386 -
387 -               if (0 != stat(pid_file, &st)) {
388 -                       fprintf(stderr, "%s.%d: stating pid-file '%s' failed: %s\n",
389 -                               __FILE__, __LINE__,
390 -                               pid_file, strerror(errno));
391 -
392 -                       return -1;
393 -               }
394 -
395 -               /* is it a regular file ? */
396 -
397 -               if (!S_ISREG(st.st_mode)) {
398 -                       fprintf(stderr, "%s.%d: pid-file exists and isn't regular file: '%s'\n",
399 -                               __FILE__, __LINE__,
400 -                               pid_file);
401 -
402 -                       return -1;
403 -               }
404 -
405 -               if (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) {
406 -                       fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
407 -                               __FILE__, __LINE__,
408 -                               pid_file, strerror(errno));
409 -
410 -                       return -1;
411 -               }
412 -       }
413 -
414 -       if (i_am_root) {
415 -               struct group *grp = NULL;
416 -               struct passwd *pwd = NULL;
417 -
418 -               /* set user and group */
419 -
420 -               if (username) {
421 -                       if (NULL == (pwd = getpwnam(username))) {
422 -                               fprintf(stderr, "%s.%d: %s, %s\n",
423 -                                       __FILE__, __LINE__,
424 -                                       "can't find username", username);
425 -                               return -1;
426 -                       }
427 -
428 -                       if (pwd->pw_uid == 0) {
429 -                               fprintf(stderr, "%s.%d: %s\n",
430 -                                       __FILE__, __LINE__,
431 -                                       "I will not set uid to 0\n");
432 -                               return -1;
433 -                       }
434 -               }
435 -
436 -               if (groupname) {
437 -                       if (NULL == (grp = getgrnam(groupname))) {
438 -                               fprintf(stderr, "%s.%d: %s %s\n",
439 -                                       __FILE__, __LINE__,
440 -                                       "can't find groupname",
441 -                                       groupname);
442 -                               return -1;
443 -                       }
444 -                       if (grp->gr_gid == 0) {
445 -                               fprintf(stderr, "%s.%d: %s\n",
446 -                                       __FILE__, __LINE__,
447 -                                       "I will not set gid to 0\n");
448 -                               return -1;
449 -                       }
450 -
451 -                       /* do the change before we do the chroot() */
452 -                       setgid(grp->gr_gid);
453 -                       setgroups(0, NULL); 
454 -
455 -                       if (username) {
456 -                               initgroups(username, grp->gr_gid);
457 -                       }
458 -
459 -               }
460 -
461 -               if (changeroot) {
462 -                       if (-1 == chroot(changeroot)) {
463 -                               fprintf(stderr, "%s.%d: %s %s\n",
464 -                                       __FILE__, __LINE__,
465 -                                       "chroot failed: ", strerror(errno));
466 -                               return -1;
467 -                       }
468 -                       if (-1 == chdir("/")) {
469 -                               fprintf(stderr, "%s.%d: %s %s\n",
470 -                                       __FILE__, __LINE__,
471 -                                       "chdir failed: ", strerror(errno));
472 -                               return -1;
473 -                       }
474 -               }
475 -
476 -               /* drop root privs */
477 -               if (username) {
478 -                       setuid(pwd->pw_uid);
479 -               }
480 -       }
481 -
482 -       return fcgi_spawn_connection(fcgi_app, fcgi_app_argv, addr, port, unixsocket, fork_count, child_count, pid_fd, nofork);
483 -}
484 -#else
485 -int main() {
486 -       return -1;
487 -}
488 -#endif
489 Index: src/configfile-glue.c
490 ===================================================================
491 --- src/configfile-glue.c       (.../tags/lighttpd-1.4.22)      (revision 2505)
492 +++ src/configfile-glue.c       (.../branches/lighttpd-1.4.x)   (revision 2505)
493 @@ -49,7 +49,7 @@
494                                                 buffer_copy_string_buffer(ds->value, ((data_string *)(da->value->data[j]))->value);
495                                                 if (!da->is_index_key) {
496                                                         /* the id's were generated automaticly, as we copy now we might have to renumber them
497 -                                                        * this is used to prepend server.modules by mod_indexfiles as it has to be loaded
498 +                                                        * this is used to prepend server.modules by mod_indexfile as it has to be loaded
499                                                          * before mod_fastcgi and friends */
500                                                         buffer_copy_string_buffer(ds->key, ((data_string *)(da->value->data[j]))->key);
501                                                 }
502 @@ -181,7 +181,7 @@
503         return config_insert_values_internal(srv, ca, cv);
504  }
505  
506 -unsigned short sock_addr_get_port(sock_addr *addr) {
507 +static unsigned short sock_addr_get_port(sock_addr *addr) {
508  #ifdef HAVE_IPV6
509         return ntohs(addr->plain.sa_family ? addr->ipv6.sin6_port : addr->ipv4.sin_port);
510  #else
511 Index: src/mod_cgi.c
512 ===================================================================
513 --- src/mod_cgi.c       (.../tags/lighttpd-1.4.22)      (revision 2505)
514 +++ src/mod_cgi.c       (.../branches/lighttpd-1.4.x)   (revision 2505)
515 @@ -24,6 +24,7 @@
516  #include <fcntl.h>
517  
518  #include "server.h"
519 +#include "stat_cache.h"
520  #include "keyvalue.h"
521  #include "log.h"
522  #include "connections.h"
523 @@ -36,6 +37,8 @@
524  # include <sys/filio.h>
525  #endif
526  
527 +#include "version.h"
528 +
529  enum {EOL_UNSET, EOL_N, EOL_RN};
530  
531  typedef struct {
532 @@ -696,11 +699,11 @@
533  
534         if (!key || !val) return -1;
535  
536 -       dst = malloc(key_len + val_len + 3);
537 +       dst = malloc(key_len + val_len + 2);
538         memcpy(dst, key, key_len);
539         dst[key_len] = '=';
540 -       /* add the \0 from the value */
541 -       memcpy(dst + key_len + 1, val, val_len + 1);
542 +       memcpy(dst + key_len + 1, val, val_len);
543 +       dst[key_len + 1 + val_len] = '\0';
544  
545         if (env->size == 0) {
546                 env->size = 16;
547 @@ -776,25 +779,23 @@
548                 /* not needed */
549                 close(to_cgi_fds[1]);
550  
551 -               /* HACK:
552 -                * this is not nice, but it works
553 -                *
554 -                * we feed the stderr of the CGI to our errorlog, if possible
555 -                */
556 -               if (srv->errorlog_mode == ERRORLOG_FILE) {
557 -                       close(STDERR_FILENO);
558 -                       dup2(srv->errorlog_fd, STDERR_FILENO);
559 -               }
560 -
561                 /* create environment */
562                 env.ptr = NULL;
563                 env.size = 0;
564                 env.used = 0;
565  
566 -               cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
567 +               if (buffer_is_empty(con->conf.server_tag)) {
568 +                       cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
569 +               } else {
570 +                       cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
571 +               }
572  
573                 if (!buffer_is_empty(con->server_name)) {
574 -                       cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
575 +                       size_t len = con->server_name->used - 1;
576 +                       char *colon = strchr(con->server_name->ptr, ':');
577 +                       if (colon) len = colon - con->server_name->ptr;
578 +
579 +                       cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
580                 } else {
581  #ifdef HAVE_IPV6
582                         s = inet_ntop(srv_sock->addr.plain.sa_family,
583 @@ -972,9 +973,15 @@
584                                 buffer_prepare_append(p->tmp_buf, ds->key->used + 2);
585  
586                                 for (j = 0; j < ds->key->used - 1; j++) {
587 -                                       p->tmp_buf->ptr[p->tmp_buf->used++] =
588 -                                               light_isalnum((unsigned char)ds->key->ptr[j]) ?
589 -                                               toupper((unsigned char)ds->key->ptr[j]) : '_';
590 +                                       char cr = '_';
591 +                                       if (light_isalpha(ds->key->ptr[j])) {
592 +                                               /* upper-case */
593 +                                               cr = ds->key->ptr[j] & ~32;
594 +                                       } else if (light_isdigit(ds->key->ptr[j])) {
595 +                                               /* copy */
596 +                                               cr = ds->key->ptr[j];
597 +                                       }
598 +                                       p->tmp_buf->ptr[p->tmp_buf->used++] = cr;
599                                 }
600                                 p->tmp_buf->ptr[p->tmp_buf->used++] = '\0';
601  
602 @@ -1203,6 +1210,7 @@
603         size_t k, s_len;
604         plugin_data *p = p_d;
605         buffer *fn = con->physical.path;
606 +       stat_cache_entry *sce = NULL;
607  
608         if (con->mode != DIRECT) return HANDLER_GO_ON;
609  
610 @@ -1210,6 +1218,9 @@
611  
612         mod_cgi_patch_connection(srv, con, p);
613  
614 +       if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) return HANDLER_GO_ON;
615 +       if (!S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
616 +
617         s_len = fn->used - 1;
618  
619         for (k = 0; k < p->conf.cgi->used; k++) {
620 @@ -1369,6 +1380,7 @@
621  }
622  
623  
624 +int mod_cgi_plugin_init(plugin *p);
625  int mod_cgi_plugin_init(plugin *p) {
626         p->version     = LIGHTTPD_VERSION_ID;
627         p->name        = buffer_init_string("cgi");
628 Index: src/mod_cml.c
629 ===================================================================
630 --- src/mod_cml.c       (.../tags/lighttpd-1.4.22)      (revision 2505)
631 +++ src/mod_cml.c       (.../branches/lighttpd-1.4.x)   (revision 2505)
632 @@ -178,7 +178,7 @@
633  }
634  #undef PATCH
635  
636 -int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
637 +static int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
638         buffer *b;
639         char *c;
640  
641 @@ -305,6 +305,7 @@
642         }
643  }
644  
645 +int mod_cml_plugin_init(plugin *p);
646  int mod_cml_plugin_init(plugin *p) {
647         p->version     = LIGHTTPD_VERSION_ID;
648         p->name        = buffer_init_string("cache");
649 Index: src/mod_secure_download.c
650 ===================================================================
651 --- src/mod_secure_download.c   (.../tags/lighttpd-1.4.22)      (revision 2505)
652 +++ src/mod_secure_download.c   (.../branches/lighttpd-1.4.x)   (revision 2505)
653 @@ -138,7 +138,7 @@
654   * @return if the supplied string is a valid MD5 string 1 is returned otherwise 0
655   */
656  
657 -int is_hex_len(const char *str, size_t len) {
658 +static int is_hex_len(const char *str, size_t len) {
659         size_t i;
660  
661         if (NULL == str) return 0;
662 @@ -293,6 +293,7 @@
663  
664  /* this function is called at dlopen() time and inits the callbacks */
665  
666 +int mod_secdownload_plugin_init(plugin *p);
667  int mod_secdownload_plugin_init(plugin *p) {
668         p->version     = LIGHTTPD_VERSION_ID;
669         p->name        = buffer_init_string("secdownload");
670 Index: src/base.h
671 ===================================================================
672 --- src/base.h  (.../tags/lighttpd-1.4.22)      (revision 2505)
673 +++ src/base.h  (.../branches/lighttpd-1.4.x)   (revision 2505)
674 @@ -183,11 +183,15 @@
675  } response;
676  
677  typedef struct {
678 -       buffer *scheme;
679 +       buffer *scheme; /* scheme without colon or slashes ( "http" or "https" ) */
680 +
681 +       /* authority with optional portnumber ("site.name" or "site.name:8080" ) NOTE: without "username:password@" */
682         buffer *authority;
683 +
684 +       /* path including leading slash ("/" or "/index.html") - urldecoded, and sanitized  ( buffer_path_simplify() && buffer_urldecode_path() ) */
685         buffer *path;
686 -       buffer *path_raw;
687 -       buffer *query;
688 +       buffer *path_raw; /* raw path, as sent from client. no urldecoding or path simplifying */
689 +       buffer *query; /* querystring ( everything after "?", ie: in "/index.php?foo=1", query is "foo=1" ) */
690  } request_uri;
691  
692  typedef struct {
693 @@ -270,6 +274,7 @@
694         unsigned short ssl_use_sslv2;
695  
696         unsigned short use_ipv6;
697 +       unsigned short defer_accept;
698         unsigned short is_ssl;
699         unsigned short allow_http11;
700         unsigned short etag_use_inode;
701 @@ -533,7 +538,7 @@
702  
703         /* the errorlog */
704         int errorlog_fd;
705 -       enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG } errorlog_mode;
706 +       enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
707         buffer *errorlog_buf;
708  
709         fdevents *ev, *ev_ins;
710 Index: src/mod_rewrite.c
711 ===================================================================
712 --- src/mod_rewrite.c   (.../tags/lighttpd-1.4.22)      (revision 2505)
713 +++ src/mod_rewrite.c   (.../branches/lighttpd-1.4.x)   (revision 2505)
714 @@ -63,7 +63,7 @@
715         free(hctx);
716  }
717  
718 -rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
719 +static rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
720         rewrite_rule_buffer *kvb;
721  
722         kvb = calloc(1, sizeof(*kvb));
723 @@ -71,7 +71,7 @@
724         return kvb;
725  }
726  
727 -int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
728 +static int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
729  #ifdef HAVE_PCRE_H
730         size_t i;
731         const char *errptr;
732 @@ -121,7 +121,7 @@
733  #endif
734  }
735  
736 -void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
737 +static void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
738  #ifdef HAVE_PCRE_H
739         size_t i;
740  
741 @@ -444,6 +444,7 @@
742         return HANDLER_GO_ON;
743  }
744  
745 +int mod_rewrite_plugin_init(plugin *p);
746  int mod_rewrite_plugin_init(plugin *p) {
747         p->version     = LIGHTTPD_VERSION_ID;
748         p->name        = buffer_init_string("rewrite");
749 Index: src/connections.c
750 ===================================================================
751 --- src/connections.c   (.../tags/lighttpd-1.4.22)      (revision 2505)
752 +++ src/connections.c   (.../branches/lighttpd-1.4.x)   (revision 2505)
753 @@ -192,7 +192,7 @@
754  
755  static int connection_handle_read_ssl(server *srv, connection *con) {
756  #ifdef USE_OPENSSL
757 -       int r, ssl_err, len;
758 +       int r, ssl_err, len, count = 0;
759         buffer *b = NULL;
760  
761         if (!con->conf.is_ssl) return -1;
762 @@ -221,10 +221,11 @@
763                         /* we move the buffer to the chunk-queue, no need to free it */
764  
765                         chunkqueue_append_buffer_weak(con->read_queue, b);
766 +                       count += len;
767                         con->bytes_read += len;
768                         b = NULL;
769                 }
770 -       } while (len > 0);
771 +       } while (len > 0 && count < MAX_READ_LIMIT);
772  
773  
774         if (len < 0) {
775 @@ -334,6 +335,7 @@
776                 b = chunkqueue_get_append_buffer(con->read_queue);
777                 buffer_prepare_copy(b, 4 * 1024);
778         } else {
779 +               if (toread > MAX_READ_LIMIT) toread = MAX_READ_LIMIT;
780                 b = chunkqueue_get_append_buffer(con->read_queue);
781                 buffer_prepare_copy(b, toread + 1);
782         }
783 @@ -858,7 +860,7 @@
784   *
785   * we get called by the state-engine and by the fdevent-handler
786   */
787 -int connection_handle_read_state(server *srv, connection *con)  {
788 +static int connection_handle_read_state(server *srv, connection *con)  {
789         connection_state_t ostate = con->state;
790         chunk *c, *last_chunk;
791         off_t last_offset;
792 @@ -1156,7 +1158,7 @@
793         return 0;
794  }
795  
796 -handler_t connection_handle_fdevent(void *s, void *context, int revents) {
797 +static handler_t connection_handle_fdevent(void *s, void *context, int revents) {
798         server     *srv = (server *)s;
799         connection *con = context;
800  
801 Index: src/mod_staticfile.c
802 ===================================================================
803 --- src/mod_staticfile.c        (.../tags/lighttpd-1.4.22)      (revision 2505)
804 +++ src/mod_staticfile.c        (.../branches/lighttpd-1.4.x)   (revision 2505)
805 @@ -532,6 +532,7 @@
806  
807  /* this function is called at dlopen() time and inits the callbacks */
808  
809 +int mod_staticfile_plugin_init(plugin *p);
810  int mod_staticfile_plugin_init(plugin *p) {
811         p->version     = LIGHTTPD_VERSION_ID;
812         p->name        = buffer_init_string("staticfile");
813 Index: src/mod_alias.c
814 ===================================================================
815 --- src/mod_alias.c     (.../tags/lighttpd-1.4.22)      (revision 2505)
816 +++ src/mod_alias.c     (.../branches/lighttpd-1.4.x)   (revision 2505)
817 @@ -187,6 +187,7 @@
818  
819  /* this function is called at dlopen() time and inits the callbacks */
820  
821 +int mod_alias_plugin_init(plugin *p);
822  int mod_alias_plugin_init(plugin *p) {
823         p->version     = LIGHTTPD_VERSION_ID;
824         p->name        = buffer_init_string("alias");
825 Index: src/network.c
826 ===================================================================
827 --- src/network.c       (.../tags/lighttpd-1.4.22)      (revision 2505)
828 +++ src/network.c       (.../branches/lighttpd-1.4.x)   (revision 2505)
829 @@ -26,7 +26,7 @@
830  # include <openssl/rand.h>
831  #endif
832  
833 -handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
834 +static handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
835         server     *srv = (server *)s;
836         server_socket *srv_socket = (server_socket *)context;
837         connection *con;
838 @@ -62,7 +62,7 @@
839         return HANDLER_GO_ON;
840  }
841  
842 -int network_server_init(server *srv, buffer *host_token, specific_config *s) {
843 +static int network_server_init(server *srv, buffer *host_token, specific_config *s) {
844         int val;
845         socklen_t addr_len;
846         server_socket *srv_socket;
847 @@ -73,10 +73,6 @@
848         int is_unix_domain_socket = 0;
849         int fd;
850  
851 -#ifdef SO_ACCEPTFILTER
852 -       struct accept_filter_arg afa;
853 -#endif
854 -
855  #ifdef __WIN32
856         WORD wVersionRequested;
857         WSADATA wsaData;
858 @@ -396,12 +392,17 @@
859  
860                 return -1;
861  #endif
862 +#ifdef TCP_DEFER_ACCEPT
863 +       } else if (s->defer_accept) {
864 +               int v = s->defer_accept;
865 +               if (-1 == setsockopt(srv_socket->fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, &v, sizeof(v))) {
866 +                       log_error_write(srv, __FILE__, __LINE__, "ss", "can't set TCP_DEFER_ACCEPT: ", strerror(errno));
867 +               }
868 +#endif
869         } else {
870  #ifdef SO_ACCEPTFILTER
871 -               /*
872 -                * FreeBSD accf_http filter
873 -                *
874 -                */
875 +               /* FreeBSD accf_http filter */
876 +               struct accept_filter_arg afa;
877                 memset(&afa, 0, sizeof(afa));
878                 strcpy(afa.af_name, "httpready");
879                 if (setsockopt(srv_socket->fd, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)) < 0) {
880 Index: src/configfile.c
881 ===================================================================
882 --- src/configfile.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
883 +++ src/configfile.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
884 @@ -96,6 +96,7 @@
885                 { "etag.use-size",               NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
886                 { "server.reject-expect-100-with-417",  NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 52 */
887                 { "debug.log-timeouts",          NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 53 */
888 +               { "server.defer-accept",         NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },     /* 54 */
889                 { "server.host",                 "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
890                 { "server.docroot",              "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
891                 { "server.virtual-root",         "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
892 @@ -164,6 +165,7 @@
893                 s->is_ssl        = 0;
894                 s->ssl_use_sslv2 = 0;
895                 s->use_ipv6      = 0;
896 +               s->defer_accept  = 0;
897  #ifdef HAVE_LSTAT
898                 s->follow_symlink = 1;
899  #endif
900 @@ -182,6 +184,7 @@
901  
902                 cv[7].destination = s->server_tag;
903                 cv[8].destination = &(s->use_ipv6);
904 +               cv[54].destination = &(s->defer_accept);
905  
906  
907                 /* 13 max-worker */
908 Index: src/mod_trigger_b4_dl.c
909 ===================================================================
910 --- src/mod_trigger_b4_dl.c     (.../tags/lighttpd-1.4.22)      (revision 2505)
911 +++ src/mod_trigger_b4_dl.c     (.../branches/lighttpd-1.4.x)   (revision 2505)
912 @@ -576,6 +576,7 @@
913  
914  /* this function is called at dlopen() time and inits the callbacks */
915  
916 +int mod_trigger_b4_dl_plugin_init(plugin *p);
917  int mod_trigger_b4_dl_plugin_init(plugin *p) {
918         p->version     = LIGHTTPD_VERSION_ID;
919         p->name        = buffer_init_string("trigger_b4_dl");
920 Index: src/mod_evhost.c
921 ===================================================================
922 --- src/mod_evhost.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
923 +++ src/mod_evhost.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
924 @@ -115,6 +115,7 @@
925          * # %2 => domain name without tld
926          * # %3 => subdomain 1 name
927          * # %4 => subdomain 2 name
928 +        * # %_ => fqdn (without port info)
929          * #
930          * evhost.path-pattern = "/home/ckruse/dev/www/%3/htdocs/"
931          *
932 @@ -154,11 +155,12 @@
933  }
934  
935  /**
936 - * assign the different parts of the domain to array-indezes
937 - * - %0 - full hostname (authority w/o port)
938 + * assign the different parts of the domain to array-indezes (sub2.sub1.domain.tld)
939 + * - %0 - domain.tld
940   * - %1 - tld
941 - * - %2 - domain.tld
942 - * - %3 -
943 + * - %2 - domain
944 + * - %3 - sub1
945 + * - ...
946   */
947  
948  static int mod_evhost_parse_host(connection *con,array *host) {
949 @@ -287,6 +289,16 @@
950                         if (*(ptr+1) == '%') {
951                                 /* %% */
952                                 buffer_append_string_len(p->tmp_buf,CONST_STR_LEN("%"));
953 +                       } else if (*(ptr+1) == '_' ) {
954 +                               /* %_ == full hostname */
955 +                               char *colon = strchr(con->uri.authority->ptr, ':');
956 +
957 +                               if(colon == NULL) {
958 +                                       buffer_append_string_buffer(p->tmp_buf, con->uri.authority); // adds fqdn
959 +                               } else {
960 +                                       /* strip the port out of the authority-part of the URI scheme */
961 +                                       buffer_append_string_len(p->tmp_buf, con->uri.authority->ptr, colon - con->uri.authority->ptr); // adds fqdn
962 +                               }
963                         } else if (NULL != (ds = (data_string *)array_get_element(parsed_host,p->conf.path_pieces[i]->ptr))) {
964                                 if (ds->value->used) {
965                                         buffer_append_string_buffer(p->tmp_buf,ds->value);
966 @@ -318,6 +330,7 @@
967         return HANDLER_GO_ON;
968  }
969  
970 +int mod_evhost_plugin_init(plugin *p);
971  int mod_evhost_plugin_init(plugin *p) {
972         p->version     = LIGHTTPD_VERSION_ID;
973         p->name                    = buffer_init_string("evhost");
974 Index: src/splaytree.c
975 ===================================================================
976 --- src/splaytree.c     (.../tags/lighttpd-1.4.22)      (revision 2505)
977 +++ src/splaytree.c     (.../branches/lighttpd-1.4.x)   (revision 2505)
978 @@ -187,7 +187,8 @@
979      }
980  }
981  
982 -splay_tree *find_rank(int r, splay_tree *t) {
983 +#if 0
984 +static splay_tree *find_rank(int r, splay_tree *t) {
985  /* Returns a pointer to the node in the tree with the given rank.  */
986  /* Returns NULL if there is no such node.                          */
987  /* Does not change the tree.  To guarantee logarithmic behavior,   */
988 @@ -206,5 +207,4 @@
989         }
990      }
991  }
992 -
993 -
994 +#endif
995 Index: src/lemon.c
996 ===================================================================
997 --- src/lemon.c (.../tags/lighttpd-1.4.22)      (revision 2505)
998 +++ src/lemon.c (.../branches/lighttpd-1.4.x)   (revision 2505)
999 @@ -31,6 +31,7 @@
1000  extern void free();
1001  extern int access();
1002  extern int atoi();
1003 +extern char *getenv();
1004  
1005  #ifndef __WIN32__
1006  #   if defined(_WIN32) || defined(WIN32)
1007 @@ -39,7 +40,7 @@
1008  #endif
1009  
1010  /* #define PRIVATE static */
1011 -#define PRIVATE
1012 +#define PRIVATE static
1013  
1014  #ifdef TEST
1015  #define MAXRHS 5       /* Set low to exercise exception code */
1016 @@ -50,6 +51,8 @@
1017  char *msort();
1018  extern void *malloc();
1019  
1020 +extern void memory_error();
1021 +
1022  /******** From the file "action.h" *************************************/
1023  struct action *Action_new();
1024  struct action *Action_sort();
1025 @@ -291,7 +294,6 @@
1026  };
1027  
1028  #define MemoryCheck(X) if((X)==0){ \
1029 -  extern void memory_error(); \
1030    memory_error(); \
1031  }
1032  
1033 @@ -445,14 +447,16 @@
1034  #define acttab_yylookahead(X,N)  ((X)->aAction[N].lookahead)
1035  
1036  /* Free all memory associated with the given acttab */
1037 -void acttab_free(acttab *p){
1038 +/*
1039 +PRIVATE void acttab_free(acttab *p){
1040    free( p->aAction );
1041    free( p->aLookahead );
1042    free( p );
1043  }
1044 +*/
1045  
1046  /* Allocate a new acttab structure */
1047 -acttab *acttab_alloc(void){
1048 +PRIVATE acttab *acttab_alloc(void){
1049    acttab *p = malloc( sizeof(*p) );
1050    if( p==0 ){
1051      fprintf(stderr,"Unable to allocate memory for a new acttab.");
1052 @@ -464,7 +468,7 @@
1053  
1054  /* Add a new action to the current transaction set
1055  */
1056 -void acttab_action(acttab *p, int lookahead, int action){
1057 +PRIVATE void acttab_action(acttab *p, int lookahead, int action){
1058    if( p->nLookahead>=p->nLookaheadAlloc ){
1059      p->nLookaheadAlloc += 25;
1060      p->aLookahead = realloc( p->aLookahead,
1061 @@ -497,7 +501,7 @@
1062  **
1063  ** Return the offset into the action table of the new transaction.
1064  */
1065 -int acttab_insert(acttab *p){
1066 +PRIVATE int acttab_insert(acttab *p){
1067    int i, j, k, n;
1068    assert( p->nLookahead>0 );
1069  
1070 @@ -2603,7 +2607,7 @@
1071    }
1072  }
1073  
1074 -void ConfigPrint(fp,cfp)
1075 +PRIVATE void ConfigPrint(fp,cfp)
1076  FILE *fp;
1077  struct config *cfp;
1078  {
1079 @@ -2640,7 +2644,7 @@
1080  }
1081  
1082  /* Print a plink chain */
1083 -PRIVATE void PlinkPrint(out,plp,tag)
1084 +void PlinkPrint(out,plp,tag)
1085  FILE *out;
1086  struct plink *plp;
1087  char *tag;
1088 @@ -2657,7 +2661,7 @@
1089  /* Print an action to the given file descriptor.  Return FALSE if
1090  ** nothing was actually printed.
1091  */
1092 -int PrintAction(struct action *ap, FILE *fp, int indent){
1093 +PRIVATE int PrintAction(struct action *ap, FILE *fp, int indent){
1094    int result = 1;
1095    switch( ap->type ){
1096      case SHIFT:
1097 @@ -2731,6 +2735,7 @@
1098    return;
1099  }
1100  
1101 +  extern int access();
1102  /* Search for the file "name" which is in the same directory as
1103  ** the exacutable */
1104  PRIVATE char *pathsearch(argv0,name,modemask)
1105 @@ -2741,7 +2746,6 @@
1106    char *pathlist;
1107    char *path,*cp;
1108    char c;
1109 -  extern int access();
1110  
1111  #ifdef __WIN32__
1112    cp = strrchr(argv0,'\\');
1113 @@ -2755,7 +2759,6 @@
1114      if( path ) sprintf(path,"%s/%s",argv0,name);
1115      *cp = c;
1116    }else{
1117 -    extern char *getenv();
1118      pathlist = getenv("PATH");
1119      if( pathlist==0 ) pathlist = ".:/bin:/usr/bin";
1120      path = (char *)malloc( strlen(pathlist)+strlen(name)+2 );
1121 @@ -2894,7 +2897,7 @@
1122  ** The following routine emits code for the destructor for the
1123  ** symbol sp
1124  */
1125 -void emit_destructor_code(out,sp,lemp,lineno)
1126 +PRIVATE void emit_destructor_code(out,sp,lemp,lineno)
1127  FILE *out;
1128  struct symbol *sp;
1129  struct lemon *lemp;
1130 @@ -2932,7 +2935,7 @@
1131  /*
1132  ** Return TRUE (non-zero) if the given symbol has a destructor.
1133  */
1134 -int has_destructor(sp, lemp)
1135 +PRIVATE int has_destructor(sp, lemp)
1136  struct symbol *sp;
1137  struct lemon *lemp;
1138  {
1139 @@ -3033,7 +3036,7 @@
1140  ** union, also set the ".dtnum" field of every terminal and nonterminal
1141  ** symbol.
1142  */
1143 -void print_stack_union(out,lemp,plineno,mhflag)
1144 +PRIVATE void print_stack_union(out,lemp,plineno,mhflag)
1145  FILE *out;                  /* The output stream */
1146  struct lemon *lemp;         /* The main info structure for this parser */
1147  int *plineno;               /* Pointer to the line number */
1148 @@ -3684,7 +3687,6 @@
1149    int i;
1150    s = (char*)malloc( global_size );
1151    if( s==0 ){
1152 -    extern void memory_error();
1153      memory_error();
1154    }
1155    for(i=0; i<global_size; i++) s[i] = 0;
1156 Index: src/chunk.h
1157 ===================================================================
1158 --- src/chunk.h (.../tags/lighttpd-1.4.22)      (revision 2505)
1159 +++ src/chunk.h (.../branches/lighttpd-1.4.x)   (revision 2505)
1160 @@ -3,6 +3,7 @@
1161  
1162  #include "buffer.h"
1163  #include "array.h"
1164 +#include "sys-mmap.h"
1165  
1166  typedef struct chunk {
1167         enum { UNUSED_CHUNK, MEM_CHUNK, FILE_CHUNK } type;
1168 Index: src/etag.c
1169 ===================================================================
1170 --- src/etag.c  (.../tags/lighttpd-1.4.22)      (revision 2505)
1171 +++ src/etag.c  (.../branches/lighttpd-1.4.x)   (revision 2505)
1172 @@ -44,7 +44,7 @@
1173         size_t i;
1174         uint32_t h;
1175  
1176 -       for (h=0, i=0; i < etag->used; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
1177 +       for (h=0, i=0; i < etag->used-1; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
1178  
1179         buffer_reset(mut);
1180         buffer_copy_string_len(mut, CONST_STR_LEN("\""));
1181 Index: src/mod_scgi.c
1182 ===================================================================
1183 --- src/mod_scgi.c      (.../tags/lighttpd-1.4.22)      (revision 2505)
1184 +++ src/mod_scgi.c      (.../branches/lighttpd-1.4.x)   (revision 2505)
1185 @@ -38,6 +38,8 @@
1186  #include <sys/wait.h>
1187  #endif
1188  
1189 +#include "version.h"
1190 +
1191  enum {EOL_UNSET, EOL_N, EOL_RN};
1192  
1193  /*
1194 @@ -372,7 +374,7 @@
1195         free(hctx);
1196  }
1197  
1198 -scgi_proc *scgi_process_init() {
1199 +static scgi_proc *scgi_process_init() {
1200         scgi_proc *f;
1201  
1202         f = calloc(1, sizeof(*f));
1203 @@ -384,7 +386,7 @@
1204         return f;
1205  }
1206  
1207 -void scgi_process_free(scgi_proc *f) {
1208 +static void scgi_process_free(scgi_proc *f) {
1209         if (!f) return;
1210  
1211         scgi_process_free(f->next);
1212 @@ -394,7 +396,7 @@
1213         free(f);
1214  }
1215  
1216 -scgi_extension_host *scgi_host_init() {
1217 +static scgi_extension_host *scgi_host_init() {
1218         scgi_extension_host *f;
1219  
1220         f = calloc(1, sizeof(*f));
1221 @@ -409,7 +411,7 @@
1222         return f;
1223  }
1224  
1225 -void scgi_host_free(scgi_extension_host *h) {
1226 +static void scgi_host_free(scgi_extension_host *h) {
1227         if (!h) return;
1228  
1229         buffer_free(h->host);
1230 @@ -426,7 +428,7 @@
1231  
1232  }
1233  
1234 -scgi_exts *scgi_extensions_init() {
1235 +static scgi_exts *scgi_extensions_init() {
1236         scgi_exts *f;
1237  
1238         f = calloc(1, sizeof(*f));
1239 @@ -434,7 +436,7 @@
1240         return f;
1241  }
1242  
1243 -void scgi_extensions_free(scgi_exts *f) {
1244 +static void scgi_extensions_free(scgi_exts *f) {
1245         size_t i;
1246  
1247         if (!f) return;
1248 @@ -464,7 +466,7 @@
1249         free(f);
1250  }
1251  
1252 -int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
1253 +static int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
1254         scgi_extension *fe;
1255         size_t i;
1256  
1257 @@ -1178,7 +1180,7 @@
1258  }
1259  
1260  
1261 -void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
1262 +static void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
1263         plugin_data *p;
1264         connection  *con;
1265  
1266 @@ -1281,10 +1283,11 @@
1267  
1268         buffer_prepare_append(env, len);
1269  
1270 -       /* include the NUL */
1271 -       memcpy(env->ptr + env->used, key, key_len + 1);
1272 +       memcpy(env->ptr + env->used, key, key_len);
1273 +       env->ptr[env->used + key_len] = '\0';
1274         env->used += key_len + 1;
1275 -       memcpy(env->ptr + env->used, val, val_len + 1);
1276 +       memcpy(env->ptr + env->used, val, val_len);
1277 +       env->ptr[env->used + val_len] = '\0';
1278         env->used += val_len + 1;
1279  
1280         return 0;
1281 @@ -1461,10 +1464,18 @@
1282         scgi_env_add(p->scgi_env, CONST_STR_LEN("SCGI"), CONST_STR_LEN("1"));
1283  
1284  
1285 -       scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
1286 +       if (buffer_is_empty(con->conf.server_tag)) {
1287 +               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
1288 +       } else {
1289 +               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
1290 +       }
1291  
1292         if (con->server_name->used) {
1293 -               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
1294 +               size_t len = con->server_name->used - 1;
1295 +               char *colon = strchr(con->server_name->ptr, ':');
1296 +               if (colon) len = colon - con->server_name->ptr;
1297 +
1298 +               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
1299         } else {
1300  #ifdef HAVE_IPV6
1301                 s = inet_ntop(srv_sock->addr.plain.sa_family,
1302 @@ -1915,7 +1926,7 @@
1303  }
1304  
1305  
1306 -int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
1307 +static int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
1308         scgi_proc *p;
1309  
1310         UNUSED(srv);
1311 @@ -2827,7 +2838,11 @@
1312                          */
1313  
1314                         /* the rewrite is only done for /prefix/? matches */
1315 -                       if (extension->key->ptr[0] == '/' &&
1316 +                       if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1317 +                               buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1318 +                               con->uri.path->used = 1;
1319 +                               con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1320 +                       } else if (extension->key->ptr[0] == '/' &&
1321                             con->uri.path->used > extension->key->used &&
1322                             NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
1323                                 /* rewrite uri.path and pathinfo */
1324 @@ -2836,10 +2851,6 @@
1325  
1326                                 con->uri.path->used -= con->request.pathinfo->used - 1;
1327                                 con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1328 -                       } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1329 -                               buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1330 -                               con->uri.path->used = 1;
1331 -                               con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1332                         }
1333                 }
1334         } else {
1335 @@ -3105,6 +3116,7 @@
1336  }
1337  
1338  
1339 +int mod_scgi_plugin_init(plugin *p);
1340  int mod_scgi_plugin_init(plugin *p) {
1341         p->version     = LIGHTTPD_VERSION_ID;
1342         p->name         = buffer_init_string("scgi");
1343 Index: src/mod_mysql_vhost.c
1344 ===================================================================
1345 --- src/mod_mysql_vhost.c       (.../tags/lighttpd-1.4.22)      (revision 2505)
1346 +++ src/mod_mysql_vhost.c       (.../branches/lighttpd-1.4.x)   (revision 2505)
1347 @@ -422,6 +422,7 @@
1348  }
1349  
1350  /* this function is called at dlopen() time and inits the callbacks */
1351 +int mod_mysql_vhost_plugin_init(plugin *p);
1352  int mod_mysql_vhost_plugin_init(plugin *p) {
1353         p->version     = LIGHTTPD_VERSION_ID;
1354         p->name                         = buffer_init_string("mysql_vhost");
1355 @@ -437,6 +438,7 @@
1356  }
1357  #else
1358  /* we don't have mysql support, this plugin does nothing */
1359 +int mod_mysql_vhost_plugin_init(plugin *p);
1360  int mod_mysql_vhost_plugin_init(plugin *p) {
1361         p->version     = LIGHTTPD_VERSION_ID;
1362         p->name                         = buffer_init_string("mysql_vhost");
1363 Index: src/request.c
1364 ===================================================================
1365 --- src/request.c       (.../tags/lighttpd-1.4.22)      (revision 2505)
1366 +++ src/request.c       (.../branches/lighttpd-1.4.x)   (revision 2505)
1367 @@ -86,10 +86,18 @@
1368         if (host_len == 0) return -1;
1369  
1370         /* if the hostname ends in a "." strip it */
1371 -       if (host->ptr[host_len-1] == '.') host_len -= 1;
1372 +       if (host->ptr[host_len-1] == '.') {
1373 +               /* shift port info one left */
1374 +               if (NULL != colon) memmove(colon-1, colon, host->used - host_len);
1375 +               else host->ptr[host_len-1] = '\0';
1376 +               host_len -= 1;
1377 +               host->used -= 1;
1378 +       }
1379  
1380 +       if (host_len == 0) return -1;
1381 +
1382         /* scan from the right and skip the \0 */
1383 -       for (i = host_len - 1; i + 1 > 0; i--) {
1384 +       for (i = host_len; i-- > 0; ) {
1385                 const char c = host->ptr[i];
1386  
1387                 switch (stage) {
1388 @@ -200,7 +208,7 @@
1389  #define DUMP_HEADER
1390  #endif
1391  
1392 -int http_request_split_value(array *vals, buffer *b) {
1393 +static int http_request_split_value(array *vals, buffer *b) {
1394         char *s;
1395         size_t i;
1396         int state = 0;
1397 @@ -262,7 +270,7 @@
1398         return 0;
1399  }
1400  
1401 -int request_uri_is_valid_char(unsigned char c) {
1402 +static int request_uri_is_valid_char(unsigned char c) {
1403         if (c <= 32) return 0;
1404         if (c == 127) return 0;
1405         if (c == 255) return 0;
1406 Index: src/mod_magnet_cache.c
1407 ===================================================================
1408 --- src/mod_magnet_cache.c      (.../tags/lighttpd-1.4.22)      (revision 2505)
1409 +++ src/mod_magnet_cache.c      (.../branches/lighttpd-1.4.x)   (revision 2505)
1410 @@ -9,7 +9,7 @@
1411  #include <lualib.h>
1412  #include <lauxlib.h>
1413  
1414 -script *script_init() {
1415 +static script *script_init() {
1416         script *sc;
1417  
1418         sc = calloc(1, sizeof(*sc));
1419 @@ -19,7 +19,7 @@
1420         return sc;
1421  }
1422  
1423 -void script_free(script *sc) {
1424 +static void script_free(script *sc) {
1425         if (!sc) return;
1426  
1427         lua_pop(sc->L, 1); /* the function copy */
1428 Index: src/mod_flv_streaming.c
1429 ===================================================================
1430 --- src/mod_flv_streaming.c     (.../tags/lighttpd-1.4.22)      (revision 2505)
1431 +++ src/mod_flv_streaming.c     (.../branches/lighttpd-1.4.x)   (revision 2505)
1432 @@ -265,6 +265,7 @@
1433  
1434  /* this function is called at dlopen() time and inits the callbacks */
1435  
1436 +int mod_flv_streaming_plugin_init(plugin *p);
1437  int mod_flv_streaming_plugin_init(plugin *p) {
1438         p->version     = LIGHTTPD_VERSION_ID;
1439         p->name        = buffer_init_string("flv_streaming");
1440 Index: src/mod_rrdtool.c
1441 ===================================================================
1442 --- src/mod_rrdtool.c   (.../tags/lighttpd-1.4.22)      (revision 2505)
1443 +++ src/mod_rrdtool.c   (.../branches/lighttpd-1.4.x)   (revision 2505)
1444 @@ -91,7 +91,7 @@
1445         return HANDLER_GO_ON;
1446  }
1447  
1448 -int mod_rrd_create_pipe(server *srv, plugin_data *p) {
1449 +static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
1450  #ifdef HAVE_FORK
1451         pid_t pid;
1452  
1453 @@ -230,6 +230,7 @@
1454  
1455  static int mod_rrdtool_create_rrd(server *srv, plugin_data *p, plugin_config *s) {
1456         struct stat st;
1457 +       int r;
1458  
1459         /* check if DB already exists */
1460         if (0 == stat(s->path_rrd->ptr, &st)) {
1461 @@ -239,54 +240,57 @@
1462                                         "not a regular file:", s->path_rrd);
1463                         return HANDLER_ERROR;
1464                 }
1465 -       } else {
1466 -               int r ;
1467 -               /* create a new one */
1468 +       }
1469  
1470 -               buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
1471 -               buffer_append_string_buffer(p->cmd, s->path_rrd);
1472 -               buffer_append_string_len(p->cmd, CONST_STR_LEN(
1473 -                       " --step 60 "
1474 -                       "DS:InOctets:ABSOLUTE:600:U:U "
1475 -                       "DS:OutOctets:ABSOLUTE:600:U:U "
1476 -                       "DS:Requests:ABSOLUTE:600:U:U "
1477 -                       "RRA:AVERAGE:0.5:1:600 "
1478 -                       "RRA:AVERAGE:0.5:6:700 "
1479 -                       "RRA:AVERAGE:0.5:24:775 "
1480 -                       "RRA:AVERAGE:0.5:288:797 "
1481 -                       "RRA:MAX:0.5:1:600 "
1482 -                       "RRA:MAX:0.5:6:700 "
1483 -                       "RRA:MAX:0.5:24:775 "
1484 -                       "RRA:MAX:0.5:288:797 "
1485 -                       "RRA:MIN:0.5:1:600 "
1486 -                       "RRA:MIN:0.5:6:700 "
1487 -                       "RRA:MIN:0.5:24:775 "
1488 -                       "RRA:MIN:0.5:288:797\n"));
1489 +       /* still create DB if it's empty file */
1490 +       if (st.st_size > 0) {
1491 +               return HANDLER_GO_ON;
1492 +       }
1493  
1494 -               if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
1495 -                       log_error_write(srv, __FILE__, __LINE__, "ss",
1496 -                               "rrdtool-write: failed", strerror(errno));
1497 +       /* create a new one */
1498 +       buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
1499 +       buffer_append_string_buffer(p->cmd, s->path_rrd);
1500 +       buffer_append_string_len(p->cmd, CONST_STR_LEN(
1501 +               " --step 60 "
1502 +               "DS:InOctets:ABSOLUTE:600:U:U "
1503 +               "DS:OutOctets:ABSOLUTE:600:U:U "
1504 +               "DS:Requests:ABSOLUTE:600:U:U "
1505 +               "RRA:AVERAGE:0.5:1:600 "
1506 +               "RRA:AVERAGE:0.5:6:700 "
1507 +               "RRA:AVERAGE:0.5:24:775 "
1508 +               "RRA:AVERAGE:0.5:288:797 "
1509 +               "RRA:MAX:0.5:1:600 "
1510 +               "RRA:MAX:0.5:6:700 "
1511 +               "RRA:MAX:0.5:24:775 "
1512 +               "RRA:MAX:0.5:288:797 "
1513 +               "RRA:MIN:0.5:1:600 "
1514 +               "RRA:MIN:0.5:6:700 "
1515 +               "RRA:MIN:0.5:24:775 "
1516 +               "RRA:MIN:0.5:288:797\n"));
1517  
1518 -                       return HANDLER_ERROR;
1519 -               }
1520 +       if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
1521 +               log_error_write(srv, __FILE__, __LINE__, "ss",
1522 +                       "rrdtool-write: failed", strerror(errno));
1523  
1524 -               buffer_prepare_copy(p->resp, 4096);
1525 -               if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
1526 -                       log_error_write(srv, __FILE__, __LINE__, "ss",
1527 -                               "rrdtool-read: failed", strerror(errno));
1528 +               return HANDLER_ERROR;
1529 +       }
1530  
1531 -                       return HANDLER_ERROR;
1532 -               }
1533 +       buffer_prepare_copy(p->resp, 4096);
1534 +       if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
1535 +               log_error_write(srv, __FILE__, __LINE__, "ss",
1536 +                       "rrdtool-read: failed", strerror(errno));
1537  
1538 -               p->resp->used = r;
1539 +               return HANDLER_ERROR;
1540 +       }
1541  
1542 -               if (p->resp->ptr[0] != 'O' ||
1543 -                   p->resp->ptr[1] != 'K') {
1544 -                       log_error_write(srv, __FILE__, __LINE__, "sbb",
1545 -                               "rrdtool-response:", p->cmd, p->resp);
1546 +       p->resp->used = r;
1547  
1548 -                       return HANDLER_ERROR;
1549 -               }
1550 +       if (p->resp->ptr[0] != 'O' ||
1551 +               p->resp->ptr[1] != 'K') {
1552 +               log_error_write(srv, __FILE__, __LINE__, "sbb",
1553 +                       "rrdtool-response:", p->cmd, p->resp);
1554 +
1555 +               return HANDLER_ERROR;
1556         }
1557  
1558         return HANDLER_GO_ON;
1559 @@ -477,6 +481,7 @@
1560         return HANDLER_GO_ON;
1561  }
1562  
1563 +int mod_rrdtool_plugin_init(plugin *p);
1564  int mod_rrdtool_plugin_init(plugin *p) {
1565         p->version     = LIGHTTPD_VERSION_ID;
1566         p->name        = buffer_init_string("rrd");
1567 Index: src/stat_cache.c
1568 ===================================================================
1569 --- src/stat_cache.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
1570 +++ src/stat_cache.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
1571 @@ -595,29 +595,31 @@
1572         if (S_ISREG(st.st_mode)) {
1573                 /* determine mimetype */
1574                 buffer_reset(sce->content_type);
1575 +#ifdef HAVE_XATTR
1576 +               if (con->conf.use_xattr) {
1577 +                       stat_cache_attr_get(sce->content_type, name->ptr);
1578 +               }
1579 +#endif
1580 +               /* xattr did not set a content-type. ask the config */
1581 +               if (buffer_is_empty(sce->content_type)) {
1582 +                       for (k = 0; k < con->conf.mimetypes->used; k++) {
1583 +                               data_string *ds = (data_string *)con->conf.mimetypes->data[k];
1584 +                               buffer *type = ds->key;
1585  
1586 -               for (k = 0; k < con->conf.mimetypes->used; k++) {
1587 -                       data_string *ds = (data_string *)con->conf.mimetypes->data[k];
1588 -                       buffer *type = ds->key;
1589 +                               if (type->used == 0) continue;
1590  
1591 -                       if (type->used == 0) continue;
1592 +                               /* check if the right side is the same */
1593 +                               if (type->used > name->used) continue;
1594  
1595 -                       /* check if the right side is the same */
1596 -                       if (type->used > name->used) continue;
1597 -
1598 -                       if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
1599 -                               buffer_copy_string_buffer(sce->content_type, ds->value);
1600 -                               break;
1601 +                               if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
1602 +                                       buffer_copy_string_buffer(sce->content_type, ds->value);
1603 +                                       break;
1604 +                               }
1605                         }
1606                 }
1607 -               etag_create(sce->etag, &(sce->st), con->etag_flags);
1608 -#ifdef HAVE_XATTR
1609 -               if (con->conf.use_xattr && buffer_is_empty(sce->content_type)) {
1610 -                       stat_cache_attr_get(sce->content_type, name->ptr);
1611 -               }
1612 -#endif
1613 +               etag_create(sce->etag, &(sce->st), con->etag_flags);
1614         } else if (S_ISDIR(st.st_mode)) {
1615 -               etag_create(sce->etag, &(sce->st), con->etag_flags);
1616 +               etag_create(sce->etag, &(sce->st), con->etag_flags);
1617         }
1618  
1619  #ifdef HAVE_FAM_H
1620 Index: src/response.c
1621 ===================================================================
1622 --- src/response.c      (.../tags/lighttpd-1.4.22)      (revision 2505)
1623 +++ src/response.c      (.../branches/lighttpd-1.4.x)   (revision 2505)
1624 @@ -25,6 +25,7 @@
1625  #include "plugin.h"
1626  
1627  #include "sys-socket.h"
1628 +#include "version.h"
1629  
1630  int http_response_write_header(server *srv, connection *con) {
1631         buffer *b;
1632 @@ -104,7 +105,7 @@
1633  
1634         if (!have_server) {
1635                 if (buffer_is_empty(con->conf.server_tag)) {
1636 -                       buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_NAME "/" PACKAGE_VERSION));
1637 +                       buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_DESC));
1638                 } else if (con->conf.server_tag->used > 1) {
1639                         buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: "));
1640                         buffer_append_string_encoded(b, CONST_BUF_LEN(con->conf.server_tag), ENCODING_HTTP_HEADER);
1641 Index: src/SConscript
1642 ===================================================================
1643 --- src/SConscript      (.../tags/lighttpd-1.4.22)      (revision 2505)
1644 +++ src/SConscript      (.../branches/lighttpd-1.4.x)   (revision 2505)
1645 @@ -70,7 +70,7 @@
1646         'mod_cml' : {
1647                 'src' : [ 'mod_cml_lua.c', 'mod_cml.c', 'mod_cml_funcs.c' ],
1648                 'lib' : [ env['LIBPCRE'], env['LIBMEMCACHE'], env['LIBLUA'], env['LIBLUALIB'] ] },
1649 -       'mod_uploadprogress' : { 'src' : [ 'mod_uploadprogress.c' ] },
1650 +#      'mod_uploadprogress' : { 'src' : [ 'mod_uploadprogress.c' ] },
1651         'mod_evasive' : { 'src' : [ 'mod_evasive.c' ] },
1652         'mod_ssi' : { 'src' : [ 'mod_ssi_exprparser.c', 'mod_ssi_expr.c', 'mod_ssi.c' ], 'lib' : [ env['LIBPCRE'] ] },
1653         'mod_flv_streaming' : { 'src' : [ 'mod_flv_streaming.c' ] },
1654 @@ -153,8 +153,6 @@
1655  instbin = env.Program(bin_targets, src, LINKFLAGS = bin_linkflags, LIBS= [ env['LIBS'], common_lib, env['LIBDL'] ])
1656  env.Depends(instbin, configparser)
1657  
1658 -spawn_fcgi = env.Program("spawn-fcgi", "spawn-fcgi.c")
1659 -
1660  if env['COMMON_LIB'] == 'bin':
1661         common_lib = instbin[1]
1662  
1663 @@ -168,9 +166,6 @@
1664  
1665  inst = []
1666  
1667 -Default(spawn_fcgi)
1668 -inst += env.Install('${bindir}', spawn_fcgi)
1669 -
1670  if env['build_dynamic']:
1671         Default(instbin[0], instlib)
1672         inst += env.Install('${sbindir}', instbin[0])
1673 Index: src/mod_cml_funcs.c
1674 ===================================================================
1675 --- src/mod_cml_funcs.c (.../tags/lighttpd-1.4.22)      (revision 2505)
1676 +++ src/mod_cml_funcs.c (.../branches/lighttpd-1.4.x)   (revision 2505)
1677 @@ -93,7 +93,7 @@
1678         return 1;
1679  }
1680  
1681 -int f_dir_files_iter(lua_State *L) {
1682 +static int f_dir_files_iter(lua_State *L) {
1683         DIR *d;
1684         struct dirent *de;
1685  
1686 @@ -211,7 +211,7 @@
1687         }
1688  
1689         if (NULL == (r = mc_aget(mc,
1690 -                                lua_tostring(L, 1), lua_strlen(L, 1)))) {
1691 +                                (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
1692  
1693                 lua_pushboolean(L, 0);
1694                 return 1;
1695 @@ -248,7 +248,7 @@
1696         }
1697  
1698         if (NULL == (r = mc_aget(mc,
1699 -                                lua_tostring(L, 1), lua_strlen(L, 1)))) {
1700 +                                (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
1701                 lua_pushnil(L);
1702                 return 1;
1703         }
1704 @@ -285,7 +285,7 @@
1705         }
1706  
1707         if (NULL == (r = mc_aget(mc,
1708 -                                lua_tostring(L, 1), lua_strlen(L, 1)))) {
1709 +                                (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
1710                 lua_pushnil(L);
1711                 return 1;
1712         }
1713 Index: src/mod_simple_vhost.c
1714 ===================================================================
1715 --- src/mod_simple_vhost.c      (.../tags/lighttpd-1.4.22)      (revision 2505)
1716 +++ src/mod_simple_vhost.c      (.../branches/lighttpd-1.4.x)   (revision 2505)
1717 @@ -270,6 +270,7 @@
1718  }
1719  
1720  
1721 +int mod_simple_vhost_plugin_init(plugin *p);
1722  int mod_simple_vhost_plugin_init(plugin *p) {
1723         p->version     = LIGHTTPD_VERSION_ID;
1724         p->name        = buffer_init_string("simple_vhost");
1725 Index: src/mod_userdir.c
1726 ===================================================================
1727 --- src/mod_userdir.c   (.../tags/lighttpd-1.4.22)      (revision 2505)
1728 +++ src/mod_userdir.c   (.../branches/lighttpd-1.4.x)   (revision 2505)
1729 @@ -314,6 +314,7 @@
1730  
1731  /* this function is called at dlopen() time and inits the callbacks */
1732  
1733 +int mod_userdir_plugin_init(plugin *p);
1734  int mod_userdir_plugin_init(plugin *p) {
1735         p->version     = LIGHTTPD_VERSION_ID;
1736         p->name        = buffer_init_string("userdir");
1737 Index: src/mod_proxy.c
1738 ===================================================================
1739 --- src/mod_proxy.c     (.../tags/lighttpd-1.4.22)      (revision 2505)
1740 +++ src/mod_proxy.c     (.../branches/lighttpd-1.4.x)   (revision 2505)
1741 @@ -332,7 +332,7 @@
1742         return HANDLER_GO_ON;
1743  }
1744  
1745 -void proxy_connection_close(server *srv, handler_ctx *hctx) {
1746 +static void proxy_connection_close(server *srv, handler_ctx *hctx) {
1747         plugin_data *p;
1748         connection *con;
1749  
1750 @@ -356,20 +356,35 @@
1751  static int proxy_establish_connection(server *srv, handler_ctx *hctx) {
1752         struct sockaddr *proxy_addr;
1753         struct sockaddr_in proxy_addr_in;
1754 +#if defined(HAVE_IPV6) && defined(HAVE_INET_PTON)
1755 +       struct sockaddr_in6 proxy_addr_in6;
1756 +#endif
1757         socklen_t servlen;
1758  
1759         plugin_data *p    = hctx->plugin_data;
1760         data_proxy *host= hctx->host;
1761         int proxy_fd       = hctx->fd;
1762  
1763 -       memset(&proxy_addr, 0, sizeof(proxy_addr));
1764  
1765 -       proxy_addr_in.sin_family = AF_INET;
1766 -       proxy_addr_in.sin_addr.s_addr = inet_addr(host->host->ptr);
1767 -       proxy_addr_in.sin_port = htons(host->port);
1768 -       servlen = sizeof(proxy_addr_in);
1769 +#if defined(HAVE_IPV6) && defined(HAVE_INET_PTON)
1770 +       if (strstr(host->host->ptr, ":")) {
1771 +               memset(&proxy_addr_in6, 0, sizeof(proxy_addr_in6));
1772 +               proxy_addr_in6.sin6_family = AF_INET6;
1773 +               inet_pton(AF_INET6, host->host->ptr, (char *) &proxy_addr_in6.sin6_addr);
1774 +               proxy_addr_in6.sin6_port = htons(host->port);
1775 +               servlen = sizeof(proxy_addr_in6);
1776 +               proxy_addr = (struct sockaddr *) &proxy_addr_in6;
1777 +       } else
1778 +#endif
1779 +       {
1780 +               memset(&proxy_addr_in, 0, sizeof(proxy_addr_in));
1781 +               proxy_addr_in.sin_family = AF_INET;
1782 +               proxy_addr_in.sin_addr.s_addr = inet_addr(host->host->ptr);
1783 +               proxy_addr_in.sin_port = htons(host->port);
1784 +               servlen = sizeof(proxy_addr_in);
1785 +               proxy_addr = (struct sockaddr *) &proxy_addr_in;
1786 +       }
1787  
1788 -       proxy_addr = (struct sockaddr *) &proxy_addr_in;
1789  
1790         if (-1 == connect(proxy_fd, proxy_addr, servlen)) {
1791                 if (errno == EINPROGRESS || errno == EALREADY) {
1792 @@ -395,7 +410,7 @@
1793         return 0;
1794  }
1795  
1796 -void proxy_set_header(connection *con, const char *key, const char *value) {
1797 +static void proxy_set_header(connection *con, const char *key, const char *value) {
1798      data_string *ds_dst;
1799  
1800      if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
1801 @@ -407,7 +422,7 @@
1802      array_insert_unique(con->request.headers, (data_unset *)ds_dst);
1803  }
1804  
1805 -void proxy_append_header(connection *con, const char *key, const char *value) {
1806 +static void proxy_append_header(connection *con, const char *key, const char *value) {
1807      data_string *ds_dst;
1808  
1809      if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
1810 @@ -741,9 +756,16 @@
1811  
1812         switch(hctx->state) {
1813         case PROXY_STATE_INIT:
1814 -               if (-1 == (hctx->fd = socket(AF_INET, SOCK_STREAM, 0))) {
1815 +               if (strstr(host->host->ptr,":")) {
1816 +                   if (-1 == (hctx->fd = socket(AF_INET6, SOCK_STREAM, 0))) {
1817                         log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
1818                         return HANDLER_ERROR;
1819 +                   }
1820 +               } else {
1821 +                   if (-1 == (hctx->fd = socket(AF_INET, SOCK_STREAM, 0))) {
1822 +                       log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
1823 +                       return HANDLER_ERROR;
1824 +                   }
1825                 }
1826                 hctx->fde_ndx = -1;
1827  
1828 @@ -1209,7 +1231,7 @@
1829  
1830                 if (ndx >= (int) extension->value->used) {
1831                         /* didn't found a higher id, wrap to the start */
1832 -                       for (ndx = 0; ndx < (int) k; ndx++) {
1833 +                       for (ndx = 0; ndx <= (int) k; ndx++) {
1834                                 host = (data_proxy *)extension->value->data[ndx];
1835                                 if (!host->is_disabled) break;
1836                         }
1837 @@ -1321,6 +1343,7 @@
1838  }
1839  
1840  
1841 +int mod_proxy_plugin_init(plugin *p);
1842  int mod_proxy_plugin_init(plugin *p) {
1843         p->version      = LIGHTTPD_VERSION_ID;
1844         p->name         = buffer_init_string("proxy");
1845 Index: src/mod_extforward.c
1846 ===================================================================
1847 --- src/mod_extforward.c        (.../tags/lighttpd-1.4.22)      (revision 2505)
1848 +++ src/mod_extforward.c        (.../branches/lighttpd-1.4.x)   (revision 2505)
1849 @@ -80,6 +80,7 @@
1850  
1851  typedef struct {
1852         array *forwarder;
1853 +       array *headers;
1854  } plugin_config;
1855  
1856  typedef struct {
1857 @@ -135,6 +136,7 @@
1858                         if (!s) continue;
1859  
1860                         array_free(s->forwarder);
1861 +                       array_free(s->headers);
1862  
1863                         free(s);
1864                 }
1865 @@ -154,7 +156,8 @@
1866         size_t i = 0;
1867  
1868         config_values_t cv[] = {
1869 -               { "extforward.forwarder",             NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },       /* 0 */
1870 +               { "extforward.forwarder",       NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },       /* 0 */
1871 +               { "extforward.headers",         NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },       /* 1 */
1872                 { NULL,                         NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
1873         };
1874  
1875 @@ -167,8 +170,10 @@
1876  
1877                 s = calloc(1, sizeof(plugin_config));
1878                 s->forwarder    = array_init();
1879 +               s->headers      = array_init();
1880  
1881                 cv[0].destination = s->forwarder;
1882 +               cv[1].destination = s->headers;
1883  
1884                 p->config_storage[i] = s;
1885  
1886 @@ -187,6 +192,7 @@
1887         plugin_config *s = p->config_storage[0];
1888  
1889         PATCH(forwarder);
1890 +       PATCH(headers);
1891  
1892         /* skip the first, the global context */
1893         for (i = 1; i < srv->config_context->used; i++) {
1894 @@ -202,6 +208,8 @@
1895  
1896                         if (buffer_is_equal_string(du->key, CONST_STR_LEN("extforward.forwarder"))) {
1897                                 PATCH(forwarder);
1898 +                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("extforward.headers"))) {
1899 +                               PATCH(headers);
1900                         }
1901                 }
1902         }
1903 @@ -294,37 +302,37 @@
1904         return NULL;
1905  }
1906  
1907 -struct addrinfo *ipstr_to_sockaddr(const char *host)
1908 -{
1909 -   struct addrinfo hints, *res0;
1910 -   int result;
1911 +static struct addrinfo *ipstr_to_sockaddr(const char *host) {
1912 +       struct addrinfo hints, *res0;
1913 +       int result;
1914  
1915 -   memset(&hints, 0, sizeof(hints));
1916 +       memset(&hints, 0, sizeof(hints));
1917  #ifndef AI_NUMERICSERV
1918 -/** 
1919 - * quoting $ man getaddrinfo
1920 - *
1921 - * NOTES
1922 - *        AI_ADDRCONFIG, AI_ALL, and AI_V4MAPPED are available since glibc 2.3.3.  
1923 - *        AI_NUMERICSERV is available since glibc 2.3.4.
1924 - */
1925 +       /**
1926 +         * quoting $ man getaddrinfo
1927 +         *
1928 +         * NOTES
1929 +         *        AI_ADDRCONFIG, AI_ALL, and AI_V4MAPPED are available since glibc 2.3.3.
1930 +         *        AI_NUMERICSERV is available since glibc 2.3.4.
1931 +         */
1932  #define AI_NUMERICSERV 0
1933  #endif
1934 -   hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
1935 +       hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
1936  
1937 -   result = getaddrinfo(host, NULL, &hints, &res0);
1938 -   if ( result != 0 )
1939 -   {
1940 -      fprintf(stderr,"could not resolve hostname %s because %s\n", host,gai_strerror(result));
1941 -      if (result == EAI_SYSTEM)
1942 -         perror("The system error is ");
1943 -      return NULL;
1944 -   }
1945 -   else
1946 -      if (res0==0)
1947 -         fprintf(stderr, "Problem in resolving hostname %s: succeeded, but no information returned\n", host);
1948 +       result = getaddrinfo(host, NULL, &hints, &res0);
1949  
1950 -   return res0;
1951 +       if (result != 0) {
1952 +               fprintf(stderr, "could not resolve hostname %s because %s\n", host, gai_strerror(result));
1953 +
1954 +               if (result == EAI_SYSTEM)
1955 +                       perror("The system error is ");
1956 +
1957 +               return NULL;
1958 +       } else if (res0 == 0) {
1959 +               fprintf(stderr, "Problem in resolving hostname %s: succeeded, but no information returned\n", host);
1960 +       }
1961 +
1962 +       return res0;
1963  }
1964  
1965  
1966 @@ -351,16 +359,26 @@
1967         mod_extforward_patch_connection(srv, con, p);
1968  
1969         if (con->conf.log_request_handling) {
1970 -               log_error_write(srv, __FILE__, __LINE__, "s", 
1971 -                               "-- mod_extforward_uri_handler called");
1972 +               log_error_write(srv, __FILE__, __LINE__, "s",
1973 +                       "-- mod_extforward_uri_handler called");
1974         }
1975  
1976 -       if ((NULL == (forwarded = (data_string *) array_get_element(con->request.headers,"X-Forwarded-For")) &&
1977 -            NULL == (forwarded = (data_string *) array_get_element(con->request.headers,  "Forwarded-For")))) {
1978 +       if (p->conf.headers->used) {
1979 +               data_string *ds;
1980 +               size_t k;
1981  
1982 +               for(k = 0; k < p->conf.headers->used; k++) {
1983 +                       ds = (data_string *) p->conf.headers->data[k];
1984 +                       if (NULL != (forwarded = (data_string*) array_get_element(con->request.headers, ds->value->ptr))) break;
1985 +               }
1986 +       } else {
1987 +               forwarded = (data_string *) array_get_element(con->request.headers,"X-Forwarded-For");
1988 +               if (NULL == forwarded) forwarded = (data_string *) array_get_element(con->request.headers,  "Forwarded-For");
1989 +       }
1990 +
1991 +       if (NULL == forwarded) {
1992                 if (con->conf.log_request_handling) {
1993 -                       log_error_write(srv, __FILE__, __LINE__, "s", 
1994 -                                       "no X-Forwarded-For|Forwarded-For: found, skipping");
1995 +                       log_error_write(srv, __FILE__, __LINE__, "s", "no forward header found, skipping");
1996                 }
1997  
1998                 return HANDLER_GO_ON;
1999 @@ -368,11 +386,10 @@
2000  
2001  #ifdef HAVE_IPV6
2002         dst_addr_str = inet_ntop(con->dst_addr.plain.sa_family,
2003 -                     con->dst_addr.plain.sa_family == AF_INET6 ?
2004 -                      (struct sockaddr *)&(con->dst_addr.ipv6.sin6_addr) :
2005 -                      (struct sockaddr *)&(con->dst_addr.ipv4.sin_addr),
2006 -                     b2,
2007 -                     (sizeof b2) - 1);
2008 +               con->dst_addr.plain.sa_family == AF_INET6 ?
2009 +                       (struct sockaddr *)&(con->dst_addr.ipv6.sin6_addr) :
2010 +                       (struct sockaddr *)&(con->dst_addr.ipv4.sin_addr),
2011 +               b2, (sizeof b2) - 1);
2012  #else
2013         dst_addr_str = inet_ntoa(con->dst_addr.ipv4.sin_addr);
2014  #endif
2015 @@ -420,6 +437,7 @@
2016                         }
2017                 }
2018  #else
2019 +               UNUSED(addrs_left);
2020                 sock.ipv4.sin_addr.s_addr = inet_addr(real_remote_addr);
2021                 sock.plain.sa_family = (sock.ipv4.sin_addr.s_addr == 0xFFFFFFFF) ? AF_UNSPEC : AF_INET;
2022  #endif
2023 @@ -439,7 +457,7 @@
2024                         buffer_copy_string(con->dst_addr_buf, real_remote_addr);
2025                 
2026                         if (con->conf.log_request_handling) {
2027 -                               log_error_write(srv, __FILE__, __LINE__, "ss",
2028 +                               log_error_write(srv, __FILE__, __LINE__, "ss",
2029                                                 "patching con->dst_addr_buf for the accesslog:", real_remote_addr);
2030                         }
2031                         /* Now, clean the conf_cond cache, because we may have changed the results of tests */
2032 @@ -479,6 +497,7 @@
2033  
2034  /* this function is called at dlopen() time and inits the callbacks */
2035  
2036 +int mod_extforward_plugin_init(plugin *p);
2037  int mod_extforward_plugin_init(plugin *p) {
2038         p->version     = LIGHTTPD_VERSION_ID;
2039         p->name        = buffer_init_string("extforward");
2040 Index: src/Makefile.am
2041 ===================================================================
2042 --- src/Makefile.am     (.../tags/lighttpd-1.4.22)      (revision 2505)
2043 +++ src/Makefile.am     (.../branches/lighttpd-1.4.x)   (revision 2505)
2044 @@ -2,21 +2,37 @@
2045  
2046  noinst_PROGRAMS=proc_open lemon # simple-fcgi #graphic evalo bench ajp ssl error_test adserver gen-license
2047  sbin_PROGRAMS=lighttpd lighttpd-angel
2048 -bin_PROGRAMS=spawn-fcgi
2049  LEMON=$(top_builddir)/src/lemon$(EXEEXT)
2050  
2051  lemon_SOURCES=lemon.c
2052  
2053  lighttpd_angel_SOURCES=lighttpd-angel.c
2054  
2055 -#simple_fcgi_SOURCES=simple-fcgi.c
2056 -#simple_fcgi_LDADD=-lfcgi
2057 +.PHONY: versionstamp parsers
2058  
2059 +all: versionstamp
2060 +
2061 +versionstamp:
2062 +       @test -f versionstamp.h || touch versionstamp.h; \
2063 +       REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
2064 +       if test $$REVISION = "exported"; then \
2065 +               REVISION="$$(LANG=C cd "$(top_srcdir)"; git describe --always 2>/dev/null)"; \
2066 +       fi; \
2067 +       if test -n "$$REVISION"; then \
2068 +               echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
2069 +       else \
2070 +               echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
2071 +       fi; \
2072 +       if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
2073 +               mv versionstamp.h.tmp versionstamp.h; \
2074 +       else \
2075 +               rm versionstamp.h.tmp; \
2076 +       fi
2077 +
2078  if CROSS_COMPILING
2079  configparser.c configparser.h:
2080  mod_ssi_exprparser.c mod_ssi_exprparser.h:
2081  
2082 -.PHONY: parsers
2083  parsers:
2084  else
2085  configparser.h: configparser.c
2086 @@ -29,12 +45,12 @@
2087         rm -f mod_ssi_exprparser.h
2088         $(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
2089  
2090 -.PHONY: parsers
2091  parsers: configparser.c mod_ssi_exprparser.c
2092  endif
2093  
2094  BUILT_SOURCES = parsers
2095  MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
2096 +CLEANFILES = versionstamp.h versionstamp.h.tmp
2097  
2098  common_src=buffer.c log.c \
2099        keyvalue.c chunk.c  \
2100 @@ -58,8 +74,6 @@
2101  src = server.c response.c connections.c network.c \
2102        configfile.c configparser.c request.c proc_open.c
2103  
2104 -spawn_fcgi_SOURCES=spawn-fcgi.c
2105 -
2106  lib_LTLIBRARIES =
2107  
2108  if NO_RDYNAMIC
2109 @@ -259,9 +273,10 @@
2110        configparser.h mod_ssi_exprparser.h \
2111        sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
2112        splaytree.h proc_open.h status_counter.h \
2113 -      mod_magnet_cache.h
2114 +      mod_magnet_cache.h \
2115 +      version.h
2116  
2117 -DEFS= @DEFS@ -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
2118 +DEFS= @DEFS@ -DHAVE_VERSION_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
2119  
2120  lighttpd_SOURCES = $(src)
2121  lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS)
2122 @@ -287,3 +302,4 @@
2123  
2124  noinst_HEADERS   = $(hdr)
2125  EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c SConscript
2126 +
2127 Index: src/config.h.cmake
2128 ===================================================================
2129 Index: src/mod_expire.c
2130 ===================================================================
2131 --- src/mod_expire.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
2132 +++ src/mod_expire.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
2133 @@ -75,10 +75,10 @@
2134         return HANDLER_GO_ON;
2135  }
2136  
2137 -static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, int *offset) {
2138 +static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, time_t *offset) {
2139         char *ts;
2140         int type = -1;
2141 -       int retts = 0;
2142 +       time_t retts = 0;
2143  
2144         UNUSED(p);
2145  
2146 @@ -302,8 +302,7 @@
2147                 if (ds->key->used == 0) continue;
2148  
2149                 if (0 == strncmp(con->uri.path->ptr, ds->key->ptr, ct_len)) {
2150 -                       int ts;
2151 -                       time_t t;
2152 +                       time_t ts, expires;
2153                         size_t len;
2154                         stat_cache_entry *sce = NULL;
2155  
2156 @@ -312,25 +311,26 @@
2157                         switch(mod_expire_get_offset(srv, p, ds->value, &ts)) {
2158                         case 0:
2159                                 /* access */
2160 -                               t = (ts + srv->cur_ts);
2161 +                               expires = (ts + srv->cur_ts);
2162                                 break;
2163                         case 1:
2164                                 /* modification */
2165  
2166 -                               t = (ts + sce->st.st_mtime);
2167 +                               expires = (ts + sce->st.st_mtime);
2168                                 break;
2169                         default:
2170                                 /* -1 is handled at parse-time */
2171                                 break;
2172                         }
2173  
2174 +                       /* expires should be at least srv->cur_ts */
2175 +                       if (expires < srv->cur_ts) expires = srv->cur_ts;
2176  
2177                         if (0 == (len = strftime(p->expire_tstmp->ptr, p->expire_tstmp->size - 1,
2178 -                                          "%a, %d %b %Y %H:%M:%S GMT", gmtime(&(t))))) {
2179 +                                          "%a, %d %b %Y %H:%M:%S GMT", gmtime(&(expires))))) {
2180                                 /* could not set expire header, out of mem */
2181  
2182                                 return HANDLER_GO_ON;
2183 -
2184                         }
2185  
2186                         p->expire_tstmp->used = len + 1;
2187 @@ -340,7 +340,7 @@
2188  
2189                         /* HTTP/1.1 */
2190                         buffer_copy_string_len(p->expire_tstmp, CONST_STR_LEN("max-age="));
2191 -                       buffer_append_long(p->expire_tstmp, ts);
2192 +                       buffer_append_long(p->expire_tstmp, expires - srv->cur_ts); /* as expires >= srv->cur_ts the difference is >= 0 */
2193  
2194                         response_header_overwrite(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
2195  
2196 @@ -354,6 +354,7 @@
2197  
2198  /* this function is called at dlopen() time and inits the callbacks */
2199  
2200 +int mod_expire_plugin_init(plugin *p);
2201  int mod_expire_plugin_init(plugin *p) {
2202         p->version     = LIGHTTPD_VERSION_ID;
2203         p->name        = buffer_init_string("expire");
2204 Index: src/http_auth.c
2205 ===================================================================
2206 --- src/http_auth.c     (.../tags/lighttpd-1.4.22)      (revision 2505)
2207 +++ src/http_auth.c     (.../branches/lighttpd-1.4.x)   (revision 2505)
2208 @@ -865,7 +865,11 @@
2209                 buffer_free(username);
2210                 buffer_free(password);
2211  
2212 -               log_error_write(srv, __FILE__, __LINE__, "s", "get_password failed");
2213 +               if (AUTH_BACKEND_UNSET == p->conf.auth_backend) {
2214 +                       log_error_write(srv, __FILE__, __LINE__, "s", "auth.backend is not set");
2215 +               } else {
2216 +                       log_error_write(srv, __FILE__, __LINE__, "s", "get_password failed");
2217 +               }
2218  
2219                 return 0;
2220         }
2221 Index: src/mod_redirect.c
2222 ===================================================================
2223 --- src/mod_redirect.c  (.../tags/lighttpd-1.4.22)      (revision 2505)
2224 +++ src/mod_redirect.c  (.../branches/lighttpd-1.4.x)   (revision 2505)
2225 @@ -271,6 +271,7 @@
2226  }
2227  
2228  
2229 +int mod_redirect_plugin_init(plugin *p);
2230  int mod_redirect_plugin_init(plugin *p) {
2231         p->version     = LIGHTTPD_VERSION_ID;
2232         p->name        = buffer_init_string("redirect");
2233 Index: src/mod_usertrack.c
2234 ===================================================================
2235 --- src/mod_usertrack.c (.../tags/lighttpd-1.4.22)      (revision 2505)
2236 +++ src/mod_usertrack.c (.../branches/lighttpd-1.4.x)   (revision 2505)
2237 @@ -255,6 +255,7 @@
2238  
2239  /* this function is called at dlopen() time and inits the callbacks */
2240  
2241 +int mod_usertrack_plugin_init(plugin *p);
2242  int mod_usertrack_plugin_init(plugin *p) {
2243         p->version     = LIGHTTPD_VERSION_ID;
2244         p->name        = buffer_init_string("usertrack");
2245 Index: src/mod_webdav.c
2246 ===================================================================
2247 --- src/mod_webdav.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
2248 +++ src/mod_webdav.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
2249 @@ -1096,7 +1096,7 @@
2250  }
2251  #endif
2252  
2253 -int webdav_lockdiscovery(server *srv, connection *con,
2254 +static int webdav_lockdiscovery(server *srv, connection *con,
2255                 buffer *locktoken, const char *lockscope, const char *locktype, int depth) {
2256  
2257         buffer *b;
2258 @@ -1156,7 +1156,7 @@
2259   *
2260   *
2261   */
2262 -int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
2263 +static int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
2264         int has_lock = 1;
2265  
2266  #ifdef USE_LOCKS
2267 @@ -2474,6 +2474,7 @@
2268  
2269  /* this function is called at dlopen() time and inits the callbacks */
2270  
2271 +int mod_webdav_plugin_init(plugin *p);
2272  int mod_webdav_plugin_init(plugin *p) {
2273         p->version     = LIGHTTPD_VERSION_ID;
2274         p->name        = buffer_init_string("webdav");
2275 Index: src/mod_status.c
2276 ===================================================================
2277 --- src/mod_status.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
2278 +++ src/mod_status.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
2279 @@ -18,6 +18,7 @@
2280  #include "plugin.h"
2281  
2282  #include "inet_ntop_cache.h"
2283 +#include "version.h"
2284  
2285  typedef struct {
2286         buffer *config_url;
2287 @@ -701,7 +702,7 @@
2288                            "  <title>Status</title>\n"
2289                            " </head>\n"
2290                            " <body>\n"
2291 -                          "  <h1>" PACKAGE_NAME " " PACKAGE_VERSION "</h1>\n"
2292 +                          "  <h1>" PACKAGE_DESC "</h1>\n"
2293                            "  <table summary=\"status\" border=\"1\">\n"));
2294  
2295         mod_status_header_append(b, "Server-Features");
2296 @@ -853,6 +854,7 @@
2297         return HANDLER_GO_ON;
2298  }
2299  
2300 +int mod_status_plugin_init(plugin *p);
2301  int mod_status_plugin_init(plugin *p) {
2302         p->version     = LIGHTTPD_VERSION_ID;
2303         p->name        = buffer_init_string("status");
2304 Index: src/mod_compress.c
2305 ===================================================================
2306 --- src/mod_compress.c  (.../tags/lighttpd-1.4.22)      (revision 2505)
2307 +++ src/mod_compress.c  (.../branches/lighttpd-1.4.x)   (revision 2505)
2308 @@ -104,7 +104,7 @@
2309  }
2310  
2311  /* 0 on success, -1 for error */
2312 -int mkdir_recursive(char *dir) {
2313 +static int mkdir_recursive(char *dir) {
2314         char *p = dir;
2315  
2316         if (!dir || !dir[0])
2317 @@ -126,7 +126,7 @@
2318  }
2319  
2320  /* 0 on success, -1 for error */
2321 -int mkdir_for_file(char *filename) {
2322 +static int mkdir_for_file(char *filename) {
2323         char *p = filename;
2324  
2325         if (!filename || !filename[0])
2326 @@ -815,6 +815,7 @@
2327         return HANDLER_GO_ON;
2328  }
2329  
2330 +int mod_compress_plugin_init(plugin *p);
2331  int mod_compress_plugin_init(plugin *p) {
2332         p->version     = LIGHTTPD_VERSION_ID;
2333         p->name        = buffer_init_string("compress");
2334 Index: src/mod_ssi.c
2335 ===================================================================
2336 --- src/mod_ssi.c       (.../tags/lighttpd-1.4.22)      (revision 2505)
2337 +++ src/mod_ssi.c       (.../branches/lighttpd-1.4.x)   (revision 2505)
2338 @@ -37,6 +37,7 @@
2339  #endif
2340  
2341  #include "etag.h"
2342 +#include "version.h"
2343  
2344  /* The newest modified time of included files for include statement */
2345  static volatile time_t include_file_last_mtime = 0;
2346 @@ -139,7 +140,7 @@
2347         return HANDLER_GO_ON;
2348  }
2349  
2350 -int ssi_env_add(array *env, const char *key, const char *val) {
2351 +static int ssi_env_add(array *env, const char *key, const char *val) {
2352         data_string *ds;
2353  
2354         if (NULL == (ds = (data_string *)array_get_unused_element(env, TYPE_STRING))) {
2355 @@ -199,6 +200,34 @@
2356                 }
2357         }
2358  
2359 +       for (i = 0; i < con->environment->used; i++) {
2360 +               data_string *ds;
2361 +
2362 +               ds = (data_string *)con->environment->data[i];
2363 +
2364 +               if (ds->value->used && ds->key->used) {
2365 +                       size_t j;
2366 +
2367 +                       buffer_reset(srv->tmp_buf);
2368 +                       buffer_prepare_append(srv->tmp_buf, ds->key->used + 2);
2369 +
2370 +                       for (j = 0; j < ds->key->used - 1; j++) {
2371 +                               char c = '_';
2372 +                               if (light_isalpha(ds->key->ptr[j])) {
2373 +                                       /* upper-case */
2374 +                                       c = ds->key->ptr[j] & ~32;
2375 +                               } else if (light_isdigit(ds->key->ptr[j])) {
2376 +                                       /* copy */
2377 +                                       c = ds->key->ptr[j];
2378 +                               }
2379 +                               srv->tmp_buf->ptr[srv->tmp_buf->used++] = c;
2380 +                       }
2381 +                       srv->tmp_buf->ptr[srv->tmp_buf->used] = '\0';
2382 +
2383 +                       ssi_env_add(p->ssi_cgi_env, srv->tmp_buf->ptr, ds->value->ptr);
2384 +               }
2385 +       }
2386 +
2387         return 0;
2388  }
2389  
2390 @@ -216,7 +245,7 @@
2391  
2392         array_reset(p->ssi_cgi_env);
2393  
2394 -       ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_NAME"/"PACKAGE_VERSION);
2395 +       ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_DESC);
2396         ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_NAME"),
2397  #ifdef HAVE_IPV6
2398                      inet_ntop(srv_sock->addr.plain.sa_family,
2399 @@ -656,17 +685,22 @@
2400                 if (p->if_is_false) break;
2401  
2402                 b = chunkqueue_get_append_buffer(con->write_queue);
2403 -               buffer_copy_string_len(b, CONST_STR_LEN("<pre>"));
2404                 for (i = 0; i < p->ssi_vars->used; i++) {
2405                         data_string *ds = (data_string *)p->ssi_vars->data[p->ssi_vars->sorted[i]];
2406  
2407                         buffer_append_string_buffer(b, ds->key);
2408 -                       buffer_append_string_len(b, CONST_STR_LEN(": "));
2409 -                       buffer_append_string_buffer(b, ds->value);
2410 -                       buffer_append_string_len(b, CONST_STR_LEN("<br />"));
2411 +                       buffer_append_string_len(b, CONST_STR_LEN("="));
2412 +                       buffer_append_string_encoded(b, CONST_BUF_LEN(ds->value), ENCODING_MINIMAL_XML);
2413 +                       buffer_append_string_len(b, CONST_STR_LEN("\n"));
2414 +               }
2415 +               for (i = 0; i < p->ssi_cgi_env->used; i++) {
2416 +                       data_string *ds = (data_string *)p->ssi_cgi_env->data[p->ssi_cgi_env->sorted[i]];
2417  
2418 +                       buffer_append_string_buffer(b, ds->key);
2419 +                       buffer_append_string_len(b, CONST_STR_LEN("="));
2420 +                       buffer_append_string_encoded(b, CONST_BUF_LEN(ds->value), ENCODING_MINIMAL_XML);
2421 +                       buffer_append_string_len(b, CONST_STR_LEN("\n"));
2422                 }
2423 -               buffer_append_string_len(b, CONST_STR_LEN("</pre>"));
2424  
2425                 break;
2426         case SSI_EXEC: {
2427 @@ -1125,6 +1159,7 @@
2428  
2429  /* this function is called at dlopen() time and inits the callbacks */
2430  
2431 +int mod_ssi_plugin_init(plugin *p);
2432  int mod_ssi_plugin_init(plugin *p) {
2433         p->version     = LIGHTTPD_VERSION_ID;
2434         p->name        = buffer_init_string("ssi");
2435 Index: src/mod_auth.c
2436 ===================================================================
2437 --- src/mod_auth.c      (.../tags/lighttpd-1.4.22)      (revision 2505)
2438 +++ src/mod_auth.c      (.../branches/lighttpd-1.4.x)   (revision 2505)
2439 @@ -313,20 +313,20 @@
2440  
2441         config_values_t cv[] = {
2442                 { "auth.backend",                   NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
2443 -               { "auth.backend.plain.groupfile",   NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
2444 -               { "auth.backend.plain.userfile",    NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
2445 -               { "auth.require",                   NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION },
2446 -               { "auth.backend.ldap.hostname",     NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
2447 -               { "auth.backend.ldap.base-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
2448 -               { "auth.backend.ldap.filter",       NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
2449 -               { "auth.backend.ldap.ca-file",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
2450 -               { "auth.backend.ldap.starttls",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
2451 -               { "auth.backend.ldap.bind-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
2452 +               { "auth.backend.plain.groupfile",   NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
2453 +               { "auth.backend.plain.userfile",    NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
2454 +               { "auth.require",                   NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION },  /* 3 */
2455 +               { "auth.backend.ldap.hostname",     NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
2456 +               { "auth.backend.ldap.base-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
2457 +               { "auth.backend.ldap.filter",       NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
2458 +               { "auth.backend.ldap.ca-file",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
2459 +               { "auth.backend.ldap.starttls",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
2460 +               { "auth.backend.ldap.bind-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
2461                 { "auth.backend.ldap.bind-pw",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
2462 -               { "auth.backend.ldap.allow-empty-pw",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
2463 -               { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
2464 -               { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
2465 -               { "auth.debug",                     NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },  /* 13 */
2466 +               { "auth.backend.ldap.allow-empty-pw",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
2467 +               { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
2468 +               { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
2469 +               { "auth.debug",                     NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },  /* 14 */
2470                 { NULL,                             NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
2471         };
2472  
2473 @@ -614,6 +614,7 @@
2474  #endif
2475  }
2476  
2477 +int mod_auth_plugin_init(plugin *p);
2478  int mod_auth_plugin_init(plugin *p) {
2479         p->version     = LIGHTTPD_VERSION_ID;
2480         p->name        = buffer_init_string("auth");
2481 Index: src/settings.h
2482 ===================================================================
2483 --- src/settings.h      (.../tags/lighttpd-1.4.22)      (revision 2505)
2484 +++ src/settings.h      (.../branches/lighttpd-1.4.x)   (revision 2505)
2485 @@ -13,6 +13,7 @@
2486   * 64kB (no real reason, just a guess)
2487   */
2488  #define BUFFER_MAX_REUSE_SIZE  (4 * 1024)
2489 +#define MAX_READ_LIMIT (4*1024*1024)
2490  
2491  /**
2492   * max size of the HTTP request header
2493 Index: src/mod_cml_lua.c
2494 ===================================================================
2495 --- src/mod_cml_lua.c   (.../tags/lighttpd-1.4.22)      (revision 2505)
2496 +++ src/mod_cml_lua.c   (.../branches/lighttpd-1.4.x)   (revision 2505)
2497 @@ -105,7 +105,7 @@
2498  }
2499  
2500  
2501 -int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
2502 +static int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
2503         size_t is_key = 1;
2504         size_t i;
2505         char *key = NULL, *val = NULL;
2506 Index: src/version.h
2507 ===================================================================
2508 --- src/version.h       (.../tags/lighttpd-1.4.22)      (revision 0)
2509 +++ src/version.h       (.../branches/lighttpd-1.4.x)   (revision 2505)
2510 @@ -0,0 +1,12 @@
2511 +#ifndef _VERSION_H_
2512 +#define _VERSION_H_
2513 +
2514 +#ifdef HAVE_VERSION_H
2515 +#include "versionstamp.h"
2516 +#else
2517 +#define REPO_VERSION ""
2518 +#endif
2519 +
2520 +#define PACKAGE_DESC PACKAGE_NAME "/" PACKAGE_VERSION REPO_VERSION
2521 +
2522 +#endif
2523 Index: src/mod_evasive.c
2524 ===================================================================
2525 --- src/mod_evasive.c   (.../tags/lighttpd-1.4.22)      (revision 2505)
2526 +++ src/mod_evasive.c   (.../branches/lighttpd-1.4.x)   (revision 2505)
2527 @@ -27,6 +27,7 @@
2528  
2529  typedef struct {
2530         unsigned short max_conns;
2531 +       unsigned short silent;
2532  } plugin_config;
2533  
2534  typedef struct {
2535 @@ -72,7 +73,8 @@
2536         size_t i = 0;
2537  
2538         config_values_t cv[] = {
2539 -               { "evasive.max-conns-per-ip",    NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
2540 +               { "evasive.max-conns-per-ip",    NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },   /* 0 */
2541 +               { "evasive.silent",              NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
2542                 { NULL,                          NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
2543         };
2544  
2545 @@ -83,8 +85,10 @@
2546  
2547                 s = calloc(1, sizeof(plugin_config));
2548                 s->max_conns       = 0;
2549 +               s->silent          = 0;
2550  
2551                 cv[0].destination = &(s->max_conns);
2552 +               cv[1].destination = &(s->silent);
2553  
2554                 p->config_storage[i] = s;
2555  
2556 @@ -103,6 +107,7 @@
2557         plugin_config *s = p->config_storage[0];
2558  
2559         PATCH(max_conns);
2560 +       PATCH(silent);
2561  
2562         /* skip the first, the global context */
2563         for (i = 1; i < srv->config_context->used; i++) {
2564 @@ -118,6 +123,8 @@
2565  
2566                         if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.max-conns-per-ip"))) {
2567                                 PATCH(max_conns);
2568 +                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("evasive.silent"))) {
2569 +                               PATCH(silent);
2570                         }
2571                 }
2572         }
2573 @@ -172,9 +179,11 @@
2574                 conns_by_ip++;
2575  
2576                 if (conns_by_ip > p->conf.max_conns) {
2577 -                       log_error_write(srv, __FILE__, __LINE__, "ss",
2578 -                               inet_ntop_cache_get_ip(srv, &(con->dst_addr)),
2579 -                               "turned away. Too many connections.");
2580 +                       if (!p->conf.silent) {
2581 +                               log_error_write(srv, __FILE__, __LINE__, "ss",
2582 +                                       inet_ntop_cache_get_ip(srv, &(con->dst_addr)),
2583 +                                       "turned away. Too many connections.");
2584 +                       }
2585  
2586                         con->http_status = 403;
2587                         con->mode = DIRECT;
2588 @@ -186,6 +195,7 @@
2589  }
2590  
2591  
2592 +int mod_evasive_plugin_init(plugin *p);
2593  int mod_evasive_plugin_init(plugin *p) {
2594         p->version     = LIGHTTPD_VERSION_ID;
2595         p->name        = buffer_init_string("evasive");
2596 Index: src/mod_setenv.c
2597 ===================================================================
2598 --- src/mod_setenv.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
2599 +++ src/mod_setenv.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
2600 @@ -230,6 +230,7 @@
2601  
2602  /* this function is called at dlopen() time and inits the callbacks */
2603  
2604 +int mod_setenv_plugin_init(plugin *p);
2605  int mod_setenv_plugin_init(plugin *p) {
2606         p->version     = LIGHTTPD_VERSION_ID;
2607         p->name        = buffer_init_string("setenv");
2608 Index: src/mod_indexfile.c
2609 ===================================================================
2610 --- src/mod_indexfile.c (.../tags/lighttpd-1.4.22)      (revision 2505)
2611 +++ src/mod_indexfile.c (.../branches/lighttpd-1.4.x)   (revision 2505)
2612 @@ -206,6 +206,7 @@
2613  
2614  /* this function is called at dlopen() time and inits the callbacks */
2615  
2616 +int mod_indexfile_plugin_init(plugin *p);
2617  int mod_indexfile_plugin_init(plugin *p) {
2618         p->version     = LIGHTTPD_VERSION_ID;
2619         p->name        = buffer_init_string("indexfile");
2620 Index: src/mod_uploadprogress.c
2621 ===================================================================
2622 Index: src/mod_fastcgi.c
2623 ===================================================================
2624 --- src/mod_fastcgi.c   (.../tags/lighttpd-1.4.22)      (revision 2505)
2625 +++ src/mod_fastcgi.c   (.../branches/lighttpd-1.4.x)   (revision 2505)
2626 @@ -49,6 +49,8 @@
2627  #include <sys/wait.h>
2628  #endif
2629  
2630 +#include "version.h"
2631 +
2632  #define FCGI_ENV_ADD_CHECK(ret, con) \
2633         if (ret == -1) { \
2634                 con->http_status = 400; \
2635 @@ -316,12 +318,6 @@
2636  } plugin_config;
2637  
2638  typedef struct {
2639 -       size_t *ptr;
2640 -       size_t used;
2641 -       size_t size;
2642 -} buffer_uint;
2643 -
2644 -typedef struct {
2645         char **ptr;
2646  
2647         size_t size;
2648 @@ -331,7 +327,6 @@
2649  /* generic plugin data, shared between all connections */
2650  typedef struct {
2651         PLUGIN_DATA;
2652 -       buffer_uint fcgi_request_id;
2653  
2654         buffer *fcgi_env;
2655  
2656 @@ -389,7 +384,7 @@
2657  /* ok, we need a prototype */
2658  static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
2659  
2660 -int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
2661 +static int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
2662         buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
2663         buffer_append_string_buffer(b, host->id);
2664         if (proc) {
2665 @@ -400,7 +395,7 @@
2666         return 0;
2667  }
2668  
2669 -int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
2670 +static int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
2671  #define CLEAN(x) \
2672         fastcgi_status_copy_procname(b, host, proc); \
2673         buffer_append_string_len(b, CONST_STR_LEN(x)); \
2674 @@ -465,7 +460,7 @@
2675         free(hctx);
2676  }
2677  
2678 -fcgi_proc *fastcgi_process_init() {
2679 +static fcgi_proc *fastcgi_process_init() {
2680         fcgi_proc *f;
2681  
2682         f = calloc(1, sizeof(*f));
2683 @@ -478,7 +473,7 @@
2684         return f;
2685  }
2686  
2687 -void fastcgi_process_free(fcgi_proc *f) {
2688 +static void fastcgi_process_free(fcgi_proc *f) {
2689         if (!f) return;
2690  
2691         fastcgi_process_free(f->next);
2692 @@ -489,7 +484,7 @@
2693         free(f);
2694  }
2695  
2696 -fcgi_extension_host *fastcgi_host_init() {
2697 +static fcgi_extension_host *fastcgi_host_init() {
2698         fcgi_extension_host *f;
2699  
2700         f = calloc(1, sizeof(*f));
2701 @@ -506,7 +501,7 @@
2702         return f;
2703  }
2704  
2705 -void fastcgi_host_free(fcgi_extension_host *h) {
2706 +static void fastcgi_host_free(fcgi_extension_host *h) {
2707         if (!h) return;
2708  
2709         buffer_free(h->id);
2710 @@ -525,7 +520,7 @@
2711  
2712  }
2713  
2714 -fcgi_exts *fastcgi_extensions_init() {
2715 +static fcgi_exts *fastcgi_extensions_init() {
2716         fcgi_exts *f;
2717  
2718         f = calloc(1, sizeof(*f));
2719 @@ -533,7 +528,7 @@
2720         return f;
2721  }
2722  
2723 -void fastcgi_extensions_free(fcgi_exts *f) {
2724 +static void fastcgi_extensions_free(fcgi_exts *f) {
2725         size_t i;
2726  
2727         if (!f) return;
2728 @@ -563,7 +558,7 @@
2729         free(f);
2730  }
2731  
2732 -int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
2733 +static int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
2734         fcgi_extension *fe;
2735         size_t i;
2736  
2737 @@ -633,12 +628,9 @@
2738  
2739  FREE_FUNC(mod_fastcgi_free) {
2740         plugin_data *p = p_d;
2741 -       buffer_uint *r = &(p->fcgi_request_id);
2742  
2743         UNUSED(srv);
2744  
2745 -       if (r->ptr) free(r->ptr);
2746 -
2747         buffer_free(p->fcgi_env);
2748         buffer_free(p->path);
2749         buffer_free(p->parse_response);
2750 @@ -710,8 +702,8 @@
2751         dst = malloc(key_len + val_len + 3);
2752         memcpy(dst, key, key_len);
2753         dst[key_len] = '=';
2754 -       /* add the \0 from the value */
2755 -       memcpy(dst + key_len + 1, val, val_len + 1);
2756 +       memcpy(dst + key_len + 1, val, val_len);
2757 +       dst[key_len + 1 + val_len] = '\0';
2758  
2759         for (i = 0; i < env->used; i++) {
2760                 if (0 == strncmp(dst, env->ptr[i], key_len + 1)) {
2761 @@ -1056,10 +1048,7 @@
2762                                                         "child exited with status",
2763                                                         WEXITSTATUS(status), host->bin_path);
2764                                         log_error_write(srv, __FILE__, __LINE__, "s",
2765 -                                                       "If you're trying to run PHP as a FastCGI backend, make sure you're using the FastCGI-enabled version.\n"
2766 -                                                       "You can find out if it is the right one by executing 'php -v' and it should display '(cgi-fcgi)' "
2767 -                                                       "in the output, NOT '(cgi)' NOR '(cli)'.\n"
2768 -                                                       "For more information, check http://trac.lighttpd.net/trac/wiki/Docs%3AModFastCGI#preparing-php-as-a-fastcgi-program"
2769 +                                                       "If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.\n"
2770                                                         "If this is PHP on Gentoo, add 'fastcgi' to the USE flags.");
2771                                 } else if (WIFSIGNALED(status)) {
2772                                         log_error_write(srv, __FILE__, __LINE__, "sd",
2773 @@ -1434,52 +1423,7 @@
2774  }
2775  
2776  
2777 -static size_t fcgi_requestid_new(server *srv, plugin_data *p) {
2778 -       size_t m = 0;
2779 -       size_t i;
2780 -       buffer_uint *r = &(p->fcgi_request_id);
2781 -
2782 -       UNUSED(srv);
2783 -
2784 -       for (i = 0; i < r->used; i++) {
2785 -               if (r->ptr[i] > m) m = r->ptr[i];
2786 -       }
2787 -
2788 -       if (r->size == 0) {
2789 -               r->size = 16;
2790 -               r->ptr = malloc(sizeof(*r->ptr) * r->size);
2791 -       } else if (r->used == r->size) {
2792 -               r->size += 16;
2793 -               r->ptr = realloc(r->ptr, sizeof(*r->ptr) * r->size);
2794 -       }
2795 -
2796 -       r->ptr[r->used++] = ++m;
2797 -
2798 -       return m;
2799 -}
2800 -
2801 -static int fcgi_requestid_del(server *srv, plugin_data *p, size_t request_id) {
2802 -       size_t i;
2803 -       buffer_uint *r = &(p->fcgi_request_id);
2804 -
2805 -       UNUSED(srv);
2806 -
2807 -       for (i = 0; i < r->used; i++) {
2808 -               if (r->ptr[i] == request_id) break;
2809 -       }
2810 -
2811 -       if (i != r->used) {
2812 -               /* found */
2813 -
2814 -               if (i != r->used - 1) {
2815 -                       r->ptr[i] = r->ptr[r->used - 1];
2816 -               }
2817 -               r->used--;
2818 -       }
2819 -
2820 -       return 0;
2821 -}
2822 -void fcgi_connection_close(server *srv, handler_ctx *hctx) {
2823 +static void fcgi_connection_close(server *srv, handler_ctx *hctx) {
2824         plugin_data *p;
2825         connection  *con;
2826  
2827 @@ -1495,10 +1439,6 @@
2828                 srv->cur_fds--;
2829         }
2830  
2831 -       if (hctx->request_id != 0) {
2832 -               fcgi_requestid_del(srv, p, hctx->request_id);
2833 -       }
2834 -
2835         if (hctx->host && hctx->proc) {
2836                 if (hctx->got_proc) {
2837                         /* after the connect the process gets a load */
2838 @@ -1556,8 +1496,6 @@
2839                 hctx->fd = -1;
2840         }
2841  
2842 -       fcgi_requestid_del(srv, p, hctx->request_id);
2843 -
2844         fcgi_set_state(srv, hctx, FCGI_STATE_INIT);
2845  
2846         hctx->request_id = 0;
2847 @@ -1885,10 +1823,18 @@
2848         buffer_prepare_copy(p->fcgi_env, 1024);
2849  
2850  
2851 -       FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION)),con)
2852 +       if (buffer_is_empty(con->conf.server_tag)) {
2853 +               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC)),con)
2854 +       } else {
2855 +               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag)),con)
2856 +       }
2857  
2858         if (con->server_name->used) {
2859 -               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name)),con)
2860 +               size_t len = con->server_name->used - 1;
2861 +               char *colon = strchr(con->server_name->ptr, ':');
2862 +               if (colon) len = colon - con->server_name->ptr;
2863 +
2864 +               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len),con)
2865         } else {
2866  #ifdef HAVE_IPV6
2867                 s = inet_ntop(srv_sock->addr.plain.sa_family,
2868 @@ -2060,7 +2006,7 @@
2869  
2870                         fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"),
2871                                         con->request.orig_uri->ptr + (host->strip_request_uri->used - 2),
2872 -                                       con->request.orig_uri->used - (host->strip_request_uri->used - 2));
2873 +                                       con->request.orig_uri->used - (host->strip_request_uri->used - 2) - 1);
2874                 } else {
2875                         FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri)),con)
2876                 }
2877 @@ -2577,7 +2523,7 @@
2878                                                 joblist_append(srv, con);
2879  
2880                                                 buffer_copy_string_len(dcls->key, "Content-Length", sizeof("Content-Length")-1);
2881 -                                               buffer_copy_long(dcls->value, sce->st.st_size);
2882 +                                               buffer_copy_off_t(dcls->value, sce->st.st_size);
2883                                                 dcls = (data_string*) array_replace(con->response.headers, (data_unset *)dcls);
2884                                                 if (dcls) dcls->free((data_unset*)dcls);
2885  
2886 @@ -3011,7 +2957,7 @@
2887  
2888                 /* move the proc-list entry down the list */
2889                 if (hctx->request_id == 0) {
2890 -                       hctx->request_id = fcgi_requestid_new(srv, p);
2891 +                       hctx->request_id = 1; /* always use id 1 as we don't use multiplexing */
2892                 } else {
2893                         log_error_write(srv, __FILE__, __LINE__, "sd",
2894                                         "fcgi-request is already in use:", hctx->request_id);
2895 @@ -3639,7 +3585,11 @@
2896                                 */
2897  
2898                                 /* the rewrite is only done for /prefix/? matches */
2899 -                               if (extension->key->ptr[0] == '/' &&
2900 +                               if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
2901 +                                       buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
2902 +                                       con->uri.path->used = 1;
2903 +                                       con->uri.path->ptr[con->uri.path->used - 1] = '\0';
2904 +                               } else if (extension->key->ptr[0] == '/' &&
2905                                         con->uri.path->used > extension->key->used &&
2906                                         NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
2907                                         /* rewrite uri.path and pathinfo */
2908 @@ -3648,10 +3598,6 @@
2909  
2910                                         con->uri.path->used -= con->request.pathinfo->used - 1;
2911                                         con->uri.path->ptr[con->uri.path->used - 1] = '\0';
2912 -                               } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
2913 -                                       buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
2914 -                                       con->uri.path->used = 1;
2915 -                                       con->uri.path->ptr[con->uri.path->used - 1] = '\0';
2916                                 }
2917                         }
2918                 }
2919 @@ -3916,6 +3862,7 @@
2920  }
2921  
2922  
2923 +int mod_fastcgi_plugin_init(plugin *p);
2924  int mod_fastcgi_plugin_init(plugin *p) {
2925         p->version      = LIGHTTPD_VERSION_ID;
2926         p->name         = buffer_init_string("fastcgi");
2927 Index: src/CMakeLists.txt
2928 ===================================================================
2929 Index: src/mod_access.c
2930 ===================================================================
2931 --- src/mod_access.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
2932 +++ src/mod_access.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
2933 @@ -175,6 +175,7 @@
2934  }
2935  
2936  
2937 +int mod_access_plugin_init(plugin *p);
2938  int mod_access_plugin_init(plugin *p) {
2939         p->version     = LIGHTTPD_VERSION_ID;
2940         p->name        = buffer_init_string("access");
2941 Index: src/mod_accesslog.c
2942 ===================================================================
2943 --- src/mod_accesslog.c (.../tags/lighttpd-1.4.22)      (revision 2505)
2944 +++ src/mod_accesslog.c (.../branches/lighttpd-1.4.x)   (revision 2505)
2945 @@ -156,7 +156,7 @@
2946         return p;
2947  }
2948  
2949 -int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
2950 +static int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
2951         size_t i, j, k = 0, start = 0;
2952  
2953         if (format->used == 0) return -1;
2954 @@ -475,74 +475,9 @@
2955  
2956                 if (s->access_logfile->used < 2) continue;
2957  
2958 -               if (s->access_logfile->ptr[0] == '|') {
2959 -#ifdef HAVE_FORK
2960 -                       /* create write pipe and spawn process */
2961 -
2962 -                       int to_log_fds[2];
2963 -                       pid_t pid;
2964 -
2965 -                       if (pipe(to_log_fds)) {
2966 -                               log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
2967 -                               return HANDLER_ERROR;
2968 -                       }
2969 -
2970 -                       /* fork, execve */
2971 -                       switch (pid = fork()) {
2972 -                       case 0:
2973 -                               /* child */
2974 -
2975 -                               close(STDIN_FILENO);
2976 -                               dup2(to_log_fds[0], STDIN_FILENO);
2977 -                               close(to_log_fds[0]);
2978 -                               /* not needed */
2979 -                               close(to_log_fds[1]);
2980 -
2981 -                               openDevNull(STDERR_FILENO);
2982 -
2983 -                               /* we don't need the client socket */
2984 -                               for (i = 3; i < 256; i++) {
2985 -                                       close(i);
2986 -                               }
2987 -
2988 -                               /* exec the log-process (skip the | )
2989 -                                *
2990 -                                */
2991 -
2992 -                               execl("/bin/sh", "sh", "-c", s->access_logfile->ptr + 1, (char *)NULL);
2993 -
2994 -                               log_error_write(srv, __FILE__, __LINE__, "sss",
2995 -                                               "spawning log-process failed: ", strerror(errno),
2996 -                                               s->access_logfile->ptr + 1);
2997 -
2998 -                               exit(-1);
2999 -                               break;
3000 -                       case -1:
3001 -                               /* error */
3002 -                               log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
3003 -                               break;
3004 -                       default:
3005 -                               close(to_log_fds[0]);
3006 -
3007 -                               s->log_access_fd = to_log_fds[1];
3008 -
3009 -                               break;
3010 -                       }
3011 -#else
3012 -                       return -1;
3013 -#endif
3014 -               } else if (-1 == (s->log_access_fd =
3015 -                                 open(s->access_logfile->ptr, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
3016 -
3017 -                       log_error_write(srv, __FILE__, __LINE__, "ssb",
3018 -                                       "opening access-log failed:",
3019 -                                       strerror(errno), s->access_logfile);
3020 -
3021 +               if (-1 == (s->log_access_fd = open_logfile_or_pipe(srv, s->access_logfile->ptr)))
3022                         return HANDLER_ERROR;
3023 -               }
3024 -#ifdef FD_CLOEXEC
3025 -               fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
3026 -#endif
3027 +
3028         }
3029  
3030         return HANDLER_GO_ON;
3031 @@ -876,6 +811,7 @@
3032  }
3033  
3034  
3035 +int mod_accesslog_plugin_init(plugin *p);
3036  int mod_accesslog_plugin_init(plugin *p) {
3037         p->version     = LIGHTTPD_VERSION_ID;
3038         p->name        = buffer_init_string("accesslog");
3039 Index: src/server.c
3040 ===================================================================
3041 --- src/server.c        (.../tags/lighttpd-1.4.22)      (revision 2505)
3042 +++ src/server.c        (.../branches/lighttpd-1.4.x)   (revision 2505)
3043 @@ -29,6 +29,7 @@
3044  #include "plugin.h"
3045  #include "joblist.h"
3046  #include "network_backends.h"
3047 +#include "version.h"
3048  
3049  #ifdef HAVE_GETOPT_H
3050  #include <getopt.h>
3051 @@ -64,6 +65,17 @@
3052  /* #define USE_ALARM */
3053  #endif
3054  
3055 +#ifdef HAVE_GETUID
3056 +# ifndef HAVE_ISSETUGID
3057 +
3058 +static int l_issetugid() {
3059 +       return (geteuid() != getuid() || getegid() != getgid());
3060 +}
3061 +
3062 +#  define issetugid l_issetugid
3063 +# endif
3064 +#endif
3065 +
3066  static volatile sig_atomic_t srv_shutdown = 0;
3067  static volatile sig_atomic_t graceful_shutdown = 0;
3068  static volatile sig_atomic_t handle_sig_alarm = 1;
3069 @@ -325,7 +337,7 @@
3070  #else
3071  # define TEXT_SSL
3072  #endif
3073 -       char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL \
3074 +       char *b = PACKAGE_DESC TEXT_SSL \
3075  " - a light and fast webserver\n" \
3076  "Build-Date: " __DATE__ " " __TIME__ "\n";
3077  ;
3078 @@ -462,7 +474,7 @@
3079  #else
3080  # define TEXT_SSL
3081  #endif
3082 -       char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
3083 +       char *b = PACKAGE_DESC TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
3084  " - a light and fast webserver\n" \
3085  "usage:\n" \
3086  " -f <name>  filename of the config-file\n" \
3087 @@ -589,7 +601,7 @@
3088  
3089         /* UID handling */
3090  #ifdef HAVE_GETUID
3091 -       if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
3092 +       if (!i_am_root && issetugid()) {
3093                 /* we are setuid-root */
3094  
3095                 log_error_write(srv, __FILE__, __LINE__, "s",
3096 Index: src/mod_dirlisting.c
3097 ===================================================================
3098 --- src/mod_dirlisting.c        (.../tags/lighttpd-1.4.22)      (revision 2505)
3099 +++ src/mod_dirlisting.c        (.../branches/lighttpd-1.4.x)   (revision 2505)
3100 @@ -31,6 +31,8 @@
3101  #include <attr/attributes.h>
3102  #endif
3103  
3104 +#include "version.h"
3105 +
3106  /* plugin config for all request/connections */
3107  
3108  typedef struct {
3109 @@ -52,8 +54,11 @@
3110         unsigned short hide_dot_files;
3111         unsigned short show_readme;
3112         unsigned short hide_readme_file;
3113 +       unsigned short encode_readme;
3114         unsigned short show_header;
3115         unsigned short hide_header_file;
3116 +       unsigned short encode_header;
3117 +       unsigned short auto_layout;
3118  
3119         excludes_buffer *excludes;
3120  
3121 @@ -73,7 +78,7 @@
3122         plugin_config conf;
3123  } plugin_data;
3124  
3125 -excludes_buffer *excludes_buffer_init(void) {
3126 +static excludes_buffer *excludes_buffer_init(void) {
3127         excludes_buffer *exb;
3128  
3129         exb = calloc(1, sizeof(*exb));
3130 @@ -81,7 +86,7 @@
3131         return exb;
3132  }
3133  
3134 -int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
3135 +static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
3136  #ifdef HAVE_PCRE_H
3137         size_t i;
3138         const char *errptr;
3139 @@ -128,7 +133,7 @@
3140  #endif
3141  }
3142  
3143 -void excludes_buffer_free(excludes_buffer *exb) {
3144 +static void excludes_buffer_free(excludes_buffer *exb) {
3145  #ifdef HAVE_PCRE_H
3146         size_t i;
3147  
3148 @@ -243,6 +248,9 @@
3149  #define CONFIG_HIDE_HEADER_FILE "dir-listing.hide-header-file"
3150  #define CONFIG_DIR_LISTING      "server.dir-listing"
3151  #define CONFIG_SET_FOOTER       "dir-listing.set-footer"
3152 +#define CONFIG_ENCODE_README    "dir-listing.encode-readme"
3153 +#define CONFIG_ENCODE_HEADER    "dir-listing.encode-header"
3154 +#define CONFIG_AUTO_LAYOUT      "dir-listing.auto-layout"
3155  
3156  
3157  SETDEFAULTS_FUNC(mod_dirlisting_set_defaults) {
3158 @@ -260,7 +268,10 @@
3159                 { CONFIG_SHOW_HEADER,      NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
3160                 { CONFIG_HIDE_HEADER_FILE, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
3161                 { CONFIG_DIR_LISTING,      NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
3162 -               { CONFIG_SET_FOOTER,       NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
3163 +               { CONFIG_SET_FOOTER,       NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },  /* 10 */
3164 +               { CONFIG_ENCODE_README,    NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
3165 +               { CONFIG_ENCODE_HEADER,    NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
3166 +               { CONFIG_AUTO_LAYOUT,      NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
3167  
3168                 { NULL,                          NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
3169         };
3170 @@ -282,6 +293,10 @@
3171                 s->hide_readme_file = 0;
3172                 s->show_header = 0;
3173                 s->hide_header_file = 0;
3174 +               s->encode_readme = 1;
3175 +               s->encode_header = 1;
3176 +               s->auto_layout = 1;
3177 +
3178                 s->encoding = buffer_init();
3179                 s->set_footer = buffer_init();
3180  
3181 @@ -296,6 +311,9 @@
3182                 cv[8].destination = &(s->hide_header_file);
3183                 cv[9].destination = &(s->dir_listing); /* old name */
3184                 cv[10].destination = s->set_footer;
3185 +               cv[11].destination = &(s->encode_readme);
3186 +               cv[12].destination = &(s->encode_header);
3187 +               cv[13].destination = &(s->auto_layout);
3188  
3189                 p->config_storage[i] = s;
3190                 ca = ((data_config *)srv->config_context->data[i])->value;
3191 @@ -326,6 +344,9 @@
3192         PATCH(hide_header_file);
3193         PATCH(excludes);
3194         PATCH(set_footer);
3195 +       PATCH(encode_readme);
3196 +       PATCH(encode_header);
3197 +       PATCH(auto_layout);
3198  
3199         /* skip the first, the global context */
3200         for (i = 1; i < srv->config_context->used; i++) {
3201 @@ -360,6 +381,12 @@
3202                                 PATCH(set_footer);
3203                         } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_EXCLUDE))) {
3204                                 PATCH(excludes);
3205 +                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_ENCODE_README))) {
3206 +                               PATCH(encode_readme);
3207 +                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_ENCODE_HEADER))) {
3208 +                               PATCH(encode_header);
3209 +                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_AUTO_LAYOUT))) {
3210 +                               PATCH(auto_layout);
3211                         }
3212                 }
3213         }
3214 @@ -454,57 +481,59 @@
3215  static void http_list_directory_header(server *srv, connection *con, plugin_data *p, buffer *out) {
3216         UNUSED(srv);
3217  
3218 -       buffer_append_string_len(out, CONST_STR_LEN(
3219 -               "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
3220 -               "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n"
3221 -               "<head>\n"
3222 -               "<title>Index of "
3223 -       ));
3224 -       buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_MINIMAL_XML);
3225 -       buffer_append_string_len(out, CONST_STR_LEN("</title>\n"));
3226 -
3227 -       if (p->conf.external_css->used > 1) {
3228 -               buffer_append_string_len(out, CONST_STR_LEN("<link rel=\"stylesheet\" type=\"text/css\" href=\""));
3229 -               buffer_append_string_buffer(out, p->conf.external_css);
3230 -               buffer_append_string_len(out, CONST_STR_LEN("\" />\n"));
3231 -       } else {
3232 +       if (p->conf.auto_layout) {
3233                 buffer_append_string_len(out, CONST_STR_LEN(
3234 -                       "<style type=\"text/css\">\n"
3235 -                       "a, a:active {text-decoration: none; color: blue;}\n"
3236 -                       "a:visited {color: #48468F;}\n"
3237 -                       "a:hover, a:focus {text-decoration: underline; color: red;}\n"
3238 -                       "body {background-color: #F5F5F5;}\n"
3239 -                       "h2 {margin-bottom: 12px;}\n"
3240 -                       "table {margin-left: 12px;}\n"
3241 -                       "th, td {"
3242 -                       " font: 90% monospace;"
3243 -                       " text-align: left;"
3244 -                       "}\n"
3245 -                       "th {"
3246 -                       " font-weight: bold;"
3247 -                       " padding-right: 14px;"
3248 -                       " padding-bottom: 3px;"
3249 -                       "}\n"
3250 -                       "td {padding-right: 14px;}\n"
3251 -                       "td.s, th.s {text-align: right;}\n"
3252 -                       "div.list {"
3253 -                       " background-color: white;"
3254 -                       " border-top: 1px solid #646464;"
3255 -                       " border-bottom: 1px solid #646464;"
3256 -                       " padding-top: 10px;"
3257 -                       " padding-bottom: 14px;"
3258 -                       "}\n"
3259 -                       "div.foot {"
3260 -                       " font: 90% monospace;"
3261 -                       " color: #787878;"
3262 -                       " padding-top: 4px;"
3263 -                       "}\n"
3264 -                       "</style>\n"
3265 +                       "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
3266 +                       "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n"
3267 +                       "<head>\n"
3268 +                       "<title>Index of "
3269                 ));
3270 +               buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_MINIMAL_XML);
3271 +               buffer_append_string_len(out, CONST_STR_LEN("</title>\n"));
3272 +
3273 +               if (p->conf.external_css->used > 1) {
3274 +                       buffer_append_string_len(out, CONST_STR_LEN("<link rel=\"stylesheet\" type=\"text/css\" href=\""));
3275 +                       buffer_append_string_buffer(out, p->conf.external_css);
3276 +                       buffer_append_string_len(out, CONST_STR_LEN("\" />\n"));
3277 +               } else {
3278 +                       buffer_append_string_len(out, CONST_STR_LEN(
3279 +                               "<style type=\"text/css\">\n"
3280 +                               "a, a:active {text-decoration: none; color: blue;}\n"
3281 +                               "a:visited {color: #48468F;}\n"
3282 +                               "a:hover, a:focus {text-decoration: underline; color: red;}\n"
3283 +                               "body {background-color: #F5F5F5;}\n"
3284 +                               "h2 {margin-bottom: 12px;}\n"
3285 +                               "table {margin-left: 12px;}\n"
3286 +                               "th, td {"
3287 +                               " font: 90% monospace;"
3288 +                               " text-align: left;"
3289 +                               "}\n"
3290 +                               "th {"
3291 +                               " font-weight: bold;"
3292 +                               " padding-right: 14px;"
3293 +                               " padding-bottom: 3px;"
3294 +                               "}\n"
3295 +                               "td {padding-right: 14px;}\n"
3296 +                               "td.s, th.s {text-align: right;}\n"
3297 +                               "div.list {"
3298 +                               " background-color: white;"
3299 +                               " border-top: 1px solid #646464;"
3300 +                               " border-bottom: 1px solid #646464;"
3301 +                               " padding-top: 10px;"
3302 +                               " padding-bottom: 14px;"
3303 +                               "}\n"
3304 +                               "div.foot {"
3305 +                               " font: 90% monospace;"
3306 +                               " color: #787878;"
3307 +                               " padding-top: 4px;"
3308 +                               "}\n"
3309 +                               "</style>\n"
3310 +                       ));
3311 +               }
3312 +
3313 +               buffer_append_string_len(out, CONST_STR_LEN("</head>\n<body>\n"));
3314         }
3315  
3316 -       buffer_append_string_len(out, CONST_STR_LEN("</head>\n<body>\n"));
3317 -
3318         /* HEADER.txt */
3319         if (p->conf.show_header) {
3320                 stream s;
3321 @@ -515,9 +544,13 @@
3322                 buffer_append_string_len(p->tmp_buf, CONST_STR_LEN("HEADER.txt"));
3323  
3324                 if (-1 != stream_open(&s, p->tmp_buf)) {
3325 -                       buffer_append_string_len(out, CONST_STR_LEN("<pre class=\"header\">"));
3326 -                       buffer_append_string_encoded(out, s.start, s.size, ENCODING_MINIMAL_XML);
3327 -                       buffer_append_string_len(out, CONST_STR_LEN("</pre>"));
3328 +                       if (p->conf.encode_header) {
3329 +                               buffer_append_string_len(out, CONST_STR_LEN("<pre class=\"header\">"));
3330 +                               buffer_append_string_encoded(out, s.start, s.size, ENCODING_MINIMAL_XML);
3331 +                               buffer_append_string_len(out, CONST_STR_LEN("</pre>"));
3332 +                       } else {
3333 +                               buffer_append_string_len(out, s.start, s.size);
3334 +                       }
3335                 }
3336                 stream_close(&s);
3337         }
3338 @@ -564,30 +597,36 @@
3339                 buffer_append_string_len(p->tmp_buf, CONST_STR_LEN("README.txt"));
3340  
3341                 if (-1 != stream_open(&s, p->tmp_buf)) {
3342 -                       buffer_append_string_len(out, CONST_STR_LEN("<pre class=\"readme\">"));
3343 -                       buffer_append_string_encoded(out, s.start, s.size, ENCODING_MINIMAL_XML);
3344 -                       buffer_append_string_len(out, CONST_STR_LEN("</pre>"));
3345 +                       if (p->conf.encode_readme) {
3346 +                               buffer_append_string_len(out, CONST_STR_LEN("<pre class=\"readme\">"));
3347 +                               buffer_append_string_encoded(out, s.start, s.size, ENCODING_MINIMAL_XML);
3348 +                               buffer_append_string_len(out, CONST_STR_LEN("</pre>"));
3349 +                       } else {
3350 +                               buffer_append_string_len(out, s.start, s.size);
3351 +                       }
3352                 }
3353                 stream_close(&s);
3354         }
3355  
3356 -       buffer_append_string_len(out, CONST_STR_LEN(
3357 -               "<div class=\"foot\">"
3358 -       ));
3359 +       if(p->conf.auto_layout) {
3360 +               buffer_append_string_len(out, CONST_STR_LEN(
3361 +                       "<div class=\"foot\">"
3362 +               ));
3363  
3364 -       if (p->conf.set_footer->used > 1) {
3365 -               buffer_append_string_buffer(out, p->conf.set_footer);
3366 -       } else if (buffer_is_empty(con->conf.server_tag)) {
3367 -               buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_NAME "/" PACKAGE_VERSION));
3368 -       } else {
3369 -               buffer_append_string_buffer(out, con->conf.server_tag);
3370 +               if (p->conf.set_footer->used > 1) {
3371 +                       buffer_append_string_buffer(out, p->conf.set_footer);
3372 +               } else if (buffer_is_empty(con->conf.server_tag)) {
3373 +                       buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_DESC));
3374 +               } else {
3375 +                       buffer_append_string_buffer(out, con->conf.server_tag);
3376 +               }
3377 +
3378 +               buffer_append_string_len(out, CONST_STR_LEN(
3379 +                       "</div>\n"
3380 +                       "</body>\n"
3381 +                       "</html>\n"
3382 +               ));
3383         }
3384 -
3385 -       buffer_append_string_len(out, CONST_STR_LEN(
3386 -               "</div>\n"
3387 -               "</body>\n"
3388 -               "</html>\n"
3389 -       ));
3390  }
3391  
3392  static int http_list_directory(server *srv, connection *con, plugin_data *p, buffer *dir) {
3393 @@ -904,6 +943,7 @@
3394  
3395  /* this function is called at dlopen() time and inits the callbacks */
3396  
3397 +int mod_dirlisting_plugin_init(plugin *p);
3398  int mod_dirlisting_plugin_init(plugin *p) {
3399         p->version     = LIGHTTPD_VERSION_ID;
3400         p->name        = buffer_init_string("dirlisting");
3401 Index: src/mod_magnet.c
3402 ===================================================================
3403 --- src/mod_magnet.c    (.../tags/lighttpd-1.4.22)      (revision 2505)
3404 +++ src/mod_magnet.c    (.../branches/lighttpd-1.4.x)   (revision 2505)
3405 @@ -365,6 +365,8 @@
3406                 MAGNET_ENV_REQUEST_METHOD,
3407                 MAGNET_ENV_REQUEST_URI,
3408                 MAGNET_ENV_REQUEST_ORIG_URI,
3409 +               MAGNET_ENV_REQUEST_PATH_INFO,
3410 +               MAGNET_ENV_REQUEST_REMOTE_IP,
3411                 MAGNET_ENV_REQUEST_PROTOCOL
3412                 } type;
3413  } magnet_env_t;
3414 @@ -387,6 +389,8 @@
3415                 { "request.method", MAGNET_ENV_REQUEST_METHOD },
3416                 { "request.uri", MAGNET_ENV_REQUEST_URI },
3417                 { "request.orig-uri", MAGNET_ENV_REQUEST_ORIG_URI },
3418 +               { "request.path-info", MAGNET_ENV_REQUEST_PATH_INFO },
3419 +               { "request.remote-ip", MAGNET_ENV_REQUEST_REMOTE_IP },
3420                 { "request.protocol", MAGNET_ENV_REQUEST_PROTOCOL },
3421  
3422                 { NULL, MAGNET_ENV_UNSET }
3423 @@ -420,6 +424,8 @@
3424                 break;
3425         case MAGNET_ENV_REQUEST_URI:      dest = con->request.uri; break;
3426         case MAGNET_ENV_REQUEST_ORIG_URI: dest = con->request.orig_uri; break;
3427 +       case MAGNET_ENV_REQUEST_PATH_INFO: dest = con->request.pathinfo; break;
3428 +       case MAGNET_ENV_REQUEST_REMOTE_IP: dest = con->dst_addr_buf; break;
3429         case MAGNET_ENV_REQUEST_PROTOCOL:
3430                 buffer_copy_string(srv->tmp_buf, get_http_version_name(con->request.http_version));
3431                 dest = srv->tmp_buf;
3432 @@ -840,6 +846,7 @@
3433  
3434  /* this function is called at dlopen() time and inits the callbacks */
3435  
3436 +int mod_magnet_plugin_init(plugin *p);
3437  int mod_magnet_plugin_init(plugin *p) {
3438         p->version     = LIGHTTPD_VERSION_ID;
3439         p->name        = buffer_init_string("magnet");
3440 @@ -856,6 +863,7 @@
3441  }
3442  
3443  #else
3444 +int mod_magnet_plugin_init(plugin *p);
3445  int mod_magnet_plugin_init(plugin *p) {
3446         UNUSED(p);
3447         return -1;
3448 Index: src/log.c
3449 ===================================================================
3450 --- src/log.c   (.../tags/lighttpd-1.4.22)      (revision 2505)
3451 +++ src/log.c   (.../branches/lighttpd-1.4.x)   (revision 2505)
3452 @@ -54,13 +54,94 @@
3453         return (tmpfd != -1) ? 0 : -1;
3454  }
3455  
3456 +int open_logfile_or_pipe(server *srv, const char* logfile) {
3457 +       int fd;
3458 +
3459 +       if (logfile[0] == '|') {
3460 +#ifdef HAVE_FORK
3461 +               /* create write pipe and spawn process */
3462 +
3463 +               int to_log_fds[2];
3464 +               pid_t pid;
3465 +               int i;
3466 +
3467 +               if (pipe(to_log_fds)) {
3468 +                       log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
3469 +                       return -1;
3470 +               }
3471 +
3472 +               /* fork, execve */
3473 +               switch (pid = fork()) {
3474 +               case 0:
3475 +                       /* child */
3476 +                       close(STDIN_FILENO);
3477 +
3478 +                       /* dup the filehandle to STDIN */
3479 +                       if (to_log_fds[0] != STDIN_FILENO) {
3480 +                               if (STDIN_FILENO != dup2(to_log_fds[0], STDIN_FILENO)) {
3481 +                                       log_error_write(srv, __FILE__, __LINE__, "ss",
3482 +                                               "dup2 failed: ", strerror(errno));
3483 +                                       exit(-1);
3484 +                               }
3485 +                               close(to_log_fds[0]);
3486 +                       }
3487 +                       close(to_log_fds[1]);
3488 +
3489 +#ifndef FD_CLOEXEC
3490 +                       /* we don't need the client socket */
3491 +                       for (i = 3; i < 256; i++) {
3492 +                               close(i);
3493 +                       }
3494 +#endif
3495 +
3496 +                       /* close old stderr */
3497 +                       openDevNull(STDERR_FILENO);
3498 +
3499 +                       /* exec the log-process (skip the | ) */
3500 +                       execl("/bin/sh", "sh", "-c", logfile + 1, NULL);
3501 +                       log_error_write(srv, __FILE__, __LINE__, "sss",
3502 +                                       "spawning log process failed: ", strerror(errno),
3503 +                                       logfile + 1);
3504 +
3505 +                       exit(-1);
3506 +                       break;
3507 +               case -1:
3508 +                       /* error */
3509 +                       log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
3510 +                       return -1;
3511 +               default:
3512 +                       close(to_log_fds[0]);
3513 +                       fd = to_log_fds[1];
3514 +                       break;
3515 +               }
3516 +
3517 +#else
3518 +               return -1;
3519 +#endif
3520 +       } else if (-1 == (fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
3521 +               log_error_write(srv, __FILE__, __LINE__, "SSSS",
3522 +                               "opening errorlog '", logfile,
3523 +                               "' failed: ", strerror(errno));
3524 +
3525 +               return -1;
3526 +       }
3527 +
3528 +#ifdef FD_CLOEXEC
3529 +       fcntl(fd, F_SETFD, FD_CLOEXEC);
3530 +#endif
3531 +
3532 +       return fd;
3533 +}
3534 +
3535 +
3536  /**
3537   * open the errorlog
3538   *
3539 - * we have 3 possibilities:
3540 + * we have 4 possibilities:
3541   * - stderr (default)
3542   * - syslog
3543   * - logfile
3544 + * - pipe
3545   *
3546   * if the open failed, report to the user and die
3547   *
3548 @@ -80,18 +161,10 @@
3549         } else if (!buffer_is_empty(srv->srvconf.errorlog_file)) {
3550                 const char *logfile = srv->srvconf.errorlog_file->ptr;
3551  
3552 -               if (-1 == (srv->errorlog_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
3553 -                       log_error_write(srv, __FILE__, __LINE__, "SSSS",
3554 -                                       "opening errorlog '", logfile,
3555 -                                       "' failed: ", strerror(errno));
3556 -
3557 +               if (-1 == (srv->errorlog_fd = open_logfile_or_pipe(srv, logfile))) {
3558                         return -1;
3559                 }
3560 -#ifdef FD_CLOEXEC
3561 -               /* close fd on exec (cgi) */
3562 -               fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
3563 -#endif
3564 -               srv->errorlog_mode = ERRORLOG_FILE;
3565 +               srv->errorlog_mode = (logfile[0] == '|') ? ERRORLOG_PIPE : ERRORLOG_FILE;
3566         }
3567  
3568         log_error_write(srv, __FILE__, __LINE__, "s", "server started");
3569 @@ -122,7 +195,7 @@
3570   */
3571  
3572  int log_error_cycle(server *srv) {
3573 -       /* only cycle if we are not in syslog-mode */
3574 +       /* only cycle if the error log is a file */
3575  
3576         if (srv->errorlog_mode == ERRORLOG_FILE) {
3577                 const char *logfile = srv->srvconf.errorlog_file->ptr;
3578 @@ -130,7 +203,7 @@
3579  
3580                 int new_fd;
3581  
3582 -               if (-1 == (new_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
3583 +               if (-1 == (new_fd = open_logfile_or_pipe(srv, logfile))) {
3584                         /* write to old log */
3585                         log_error_write(srv, __FILE__, __LINE__, "SSSSS",
3586                                         "cycling errorlog '", logfile,
3587 @@ -158,6 +231,7 @@
3588  
3589  int log_error_close(server *srv) {
3590         switch(srv->errorlog_mode) {
3591 +       case ERRORLOG_PIPE:
3592         case ERRORLOG_FILE:
3593                 close(srv->errorlog_fd);
3594                 break;
3595 @@ -177,6 +251,7 @@
3596         va_list ap;
3597  
3598         switch(srv->errorlog_mode) {
3599 +       case ERRORLOG_PIPE:
3600         case ERRORLOG_FILE:
3601         case ERRORLOG_STDERR:
3602                 /* cache the generated timestamp */
3603 @@ -270,6 +345,7 @@
3604         va_end(ap);
3605  
3606         switch(srv->errorlog_mode) {
3607 +       case ERRORLOG_PIPE:
3608         case ERRORLOG_FILE:
3609                 buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
3610                 write(srv->errorlog_fd, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
3611 Index: src/log.h
3612 ===================================================================
3613 --- src/log.h   (.../tags/lighttpd-1.4.22)      (revision 2505)
3614 +++ src/log.h   (.../branches/lighttpd-1.4.x)   (revision 2505)
3615 @@ -10,6 +10,8 @@
3616  
3617  #define WP() log_error_write(srv, __FILE__, __LINE__, "");
3618  
3619 +int open_logfile_or_pipe(server *srv, const char* logfile);
3620 +
3621  int log_error_open(server *srv);
3622  int log_error_close(server *srv);
3623  int log_error_write(server *srv, const char *filename, unsigned int line, const char *fmt, ...);
3624 Index: src/fdevent.c
3625 ===================================================================
3626 --- src/fdevent.c       (.../tags/lighttpd-1.4.22)      (revision 2505)
3627 +++ src/fdevent.c       (.../branches/lighttpd-1.4.x)   (revision 2505)
3628 @@ -92,7 +92,7 @@
3629         return 0;
3630  }
3631  
3632 -fdnode *fdnode_init() {
3633 +static fdnode *fdnode_init() {
3634         fdnode *fdn;
3635  
3636         fdn = calloc(1, sizeof(*fdn));
3637 @@ -100,7 +100,7 @@
3638         return fdn;
3639  }
3640  
3641 -void fdnode_free(fdnode *fdn) {
3642 +static void fdnode_free(fdnode *fdn) {
3643         free(fdn);
3644  }
3645  
3646 Index: tests/fcgi-responder.c
3647 ===================================================================
3648 --- tests/fcgi-responder.c      (.../tags/lighttpd-1.4.22)      (revision 2505)
3649 +++ tests/fcgi-responder.c      (.../branches/lighttpd-1.4.x)   (revision 2505)
3650 @@ -40,7 +40,13 @@
3651                         printf("Status: 500 Internal Foo\r\n\r\n");
3652                 }
3653  
3654 -               printf("test123");
3655 +               if (0 == strcmp(p, "path_info")) {
3656 +                       printf("%s", getenv("PATH_INFO"));
3657 +               } else if (0 == strcmp(p, "script_name")) {
3658 +                       printf("%s", getenv("SCRIPT_NAME"));
3659 +               } else {
3660 +                       printf("test123");
3661 +               }
3662         }
3663  
3664         return 0;
3665 Index: tests/mod-fastcgi.t
3666 ===================================================================
3667 --- tests/mod-fastcgi.t (.../tags/lighttpd-1.4.22)      (revision 2505)
3668 +++ tests/mod-fastcgi.t (.../branches/lighttpd-1.4.x)   (revision 2505)
3669 @@ -7,7 +7,7 @@
3670  }
3671  
3672  use strict;
3673 -use Test::More tests => 50;
3674 +use Test::More tests => 52;
3675  use LightyTest;
3676  
3677  my $tf = LightyTest->new();
3678 @@ -166,7 +166,7 @@
3679         $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo/bar' } ];
3680         ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off');
3681  
3682 -       
3683 +
3684         ok($tf->stop_proc == 0, "Stopping lighttpd");
3685  
3686  
3687 @@ -282,7 +282,7 @@
3688  
3689  
3690  SKIP: {
3691 -       skip "no fcgi-responder found", 9 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe"; 
3692 +       skip "no fcgi-responder found", 11 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe";
3693         
3694         $tf->{CONFIGFILE} = 'fastcgi-responder.conf';
3695         ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
3696 @@ -319,6 +319,23 @@
3697         ok($tf->handle_http($t) == 0, 'line-ending \r\n + \r\n');
3698  
3699         $t->{REQUEST}  = ( <<EOF
3700 +GET /abc/def/ghi?path_info HTTP/1.0
3701 +Host: wsgi.example.org
3702 +EOF
3703 + );
3704 +       $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/abc/def/ghi' } ];
3705 +       ok($tf->handle_http($t) == 0, 'PATH_INFO (wsgi)');
3706 +
3707 +       $t->{REQUEST}  = ( <<EOF
3708 +GET /abc/def/ghi?script_name HTTP/1.0
3709 +Host: wsgi.example.org
3710 +EOF
3711 + );
3712 +       $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '' } ];
3713 +       ok($tf->handle_http($t) == 0, 'SCRIPT_NAME (wsgi)');
3714 +
3715 +
3716 +       $t->{REQUEST}  = ( <<EOF
3717  GET /index.fcgi?die-at-end HTTP/1.0
3718  Host: www.example.org
3719  EOF
3720 Index: tests/fastcgi-responder.conf
3721 ===================================================================
3722 --- tests/fastcgi-responder.conf        (.../tags/lighttpd-1.4.22)      (revision 2505)
3723 +++ tests/fastcgi-responder.conf        (.../branches/lighttpd-1.4.x)   (revision 2505)
3724 @@ -159,3 +159,15 @@
3725    server.name = "zzz.example.org"
3726  }
3727  
3728 +$HTTP["host"] == "wsgi.example.org" {
3729 +       fastcgi.server = (
3730 +               "/"  =>
3731 +                       ( (
3732 +                               "host" => "127.0.0.1", "port" => 10000,
3733 +                               "fix-root-scriptname" => "enable",
3734 +                               "check-local" => "disable",
3735 +                               "bin-path" => env.SRCDIR + "/fcgi-responder",
3736 +                               "max-procs" => 1,
3737 +                       ) ),
3738 +       )
3739 +}
3740 Index: tests/LightyTest.pm
3741 ===================================================================
3742 --- tests/LightyTest.pm (.../tags/lighttpd-1.4.22)      (revision 2505)
3743 +++ tests/LightyTest.pm (.../branches/lighttpd-1.4.x)   (revision 2505)
3744 @@ -6,7 +6,8 @@
3745  use Test::More;
3746  use Socket;
3747  use Cwd 'abs_path';
3748 -use POSIX ":sys_wait_h";
3749 +use POSIX qw(:sys_wait_h dup2);
3750 +use Errno qw(EADDRINUSE);
3751  
3752  sub mtime {
3753         my $file = shift;
3754 @@ -344,8 +345,14 @@
3755                 return -1;
3756         }
3757         if ($child == 0) {
3758 -               my $cmd = $self->{BINDIR}.'/spawn-fcgi -n -p '.$port.' -f "'.$binary.'"';
3759 -               exec $cmd or die($?);
3760 +               my $iaddr   = inet_aton('localhost') || die "no host: localhost";
3761 +               my $proto   = getprotobyname('tcp');
3762 +               socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
3763 +               setsockopt(SOCK, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) || die "setsockopt: $!";
3764 +               bind(SOCK, sockaddr_in($port, $iaddr)) || die "bind: $!";
3765 +               listen(SOCK, 1024) || die "listen: $!";
3766 +               dup2(fileno(SOCK), 0) || die "dup2: $!";
3767 +               exec $binary or die($?);
3768         } else {
3769                 if (0 != $self->wait_for_port_with_proc($port, $child)) {
3770                         diag(sprintf('The process %i is not up (port %i, %s)', $child, $port, $binary));
3771 Index: configure.ac
3772 ===================================================================
3773 --- configure.ac        (.../tags/lighttpd-1.4.22)      (revision 0)
3774 +++ configure.ac        (.../branches/lighttpd-1.4.x)   (revision 2505)
3775 @@ -0,0 +1,714 @@
3776 +#                                               -*- Autoconf -*-
3777 +# Process this file with autoconf to produce a configure script.
3778 +AC_PREREQ(2.57)
3779 +AC_INIT([lighttpd], [1.4.23], [contact@lighttpd.net])
3780 +AC_CONFIG_SRCDIR([src/server.c])
3781 +AC_CONFIG_HEADER([config.h])
3782 +
3783 +AC_CANONICAL_TARGET
3784 +
3785 +AM_INIT_AUTOMAKE
3786 +
3787 +# Checks for programs.
3788 +AC_PROG_CC
3789 +AM_PROG_CC_C_O
3790 +AC_PROG_LD
3791 +AC_PROG_INSTALL
3792 +AC_PROG_AWK
3793 +AC_PROG_CPP
3794 +dnl AC_PROG_CXX
3795 +AC_PROG_LN_S
3796 +AC_PROG_MAKE_SET
3797 +
3798 +dnl check environment
3799 +AC_AIX
3800 +AC_ISC_POSIX
3801 +AC_MINIX
3802 +
3803 +dnl AC_CANONICAL_HOST
3804 +case $host_os in
3805 +       *darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;;
3806 +        * ) NO_RDYNAMIC=no;;
3807 +esac
3808 +AM_CONDITIONAL(NO_RDYNAMIC, test x$NO_RDYNAMIC = xyes)
3809 +
3810 +AC_EXEEXT
3811 +
3812 +dnl more automake stuff
3813 +AM_C_PROTOTYPES
3814 +
3815 +dnl libtool
3816 +AC_DISABLE_STATIC
3817 +AC_ENABLE_SHARED
3818 +
3819 +AC_LIBTOOL_DLOPEN
3820 +AC_PROG_LIBTOOL
3821 +
3822 +dnl for solaris
3823 +CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
3824 +
3825 +# Checks for header files.
3826 +AC_HEADER_STDC
3827 +AC_HEADER_SYS_WAIT
3828 +AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
3829 +sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \
3830 +getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
3831 +sys/mman.h sys/event.h sys/port.h pwd.h sys/syslimits.h \
3832 +sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h])
3833 +
3834 +# Checks for typedefs, structures, and compiler characteristics.
3835 +AC_C_CONST
3836 +AC_C_INLINE
3837 +AC_C_CHAR_UNSIGNED
3838 +AC_TYPE_OFF_T
3839 +AC_TYPE_PID_T
3840 +AC_TYPE_SIZE_T
3841 +
3842 +AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
3843 +AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>])
3844 +AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
3845 +#include <sys/socket.h>])
3846 +
3847 +# Checks for library functions.
3848 +AC_FUNC_FORK
3849 +dnl AC_FUNC_MALLOC
3850 +#AC_FUNC_MMAP
3851 +dnl AC_FUNC_REALLOC
3852 +AC_TYPE_SIGNAL
3853 +AC_FUNC_STAT
3854 +AC_FUNC_STRFTIME
3855 +AC_CHECK_FUNCS([issetugid inet_pton])
3856 +
3857 +dnl Checks for database.
3858 +MYSQL_INCLUDE=""
3859 +MYSQL_LIBS=""
3860 +
3861 +AC_MSG_CHECKING(for MySQL support)
3862 +AC_ARG_WITH(mysql,
3863 +    AC_HELP_STRING([--with-mysql@<:@=PATH@:>@],[Include MySQL support. PATH is the path to 'mysql_config']),
3864 +    [WITH_MYSQL=$withval],[WITH_MYSQL=no])
3865 +
3866 +if test "$WITH_MYSQL" != "no"; then
3867 +  AC_MSG_RESULT(yes)
3868 +  if test "$WITH_MYSQL" = "yes"; then
3869 +    AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
3870 +  else
3871 +    MYSQL_CONFIG=$WITH_MYSQL
3872 +  fi
3873 +
3874 +  if test "$MYSQL_CONFIG" = ""; then
3875 +    AC_MSG_ERROR(mysql_config is not found)
3876 +  fi
3877 +  if test \! -x $MYSQL_CONFIG; then
3878 +    AC_MSG_ERROR(mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config)
3879 +  fi
3880 +
3881 +  if $MYSQL_CONFIG | grep -- '--include' > /dev/null ; then
3882 +    MYSQL_INCLUDE="`$MYSQL_CONFIG --include | sed s/\'//g`"
3883 +  else
3884 +    MYSQL_INCLUDE="`$MYSQL_CONFIG --cflags | sed s/\'//g`"
3885 +  fi
3886 +  MYSQL_LIBS="`$MYSQL_CONFIG --libs | sed s/\'//g`"
3887 +
3888 +  AC_MSG_CHECKING(for MySQL includes at)
3889 +  AC_MSG_RESULT($MYSQL_INCLUDE)
3890 +
3891 +  AC_MSG_CHECKING(for MySQL libraries at)
3892 +  AC_MSG_RESULT($MYSQL_LIBS)
3893 +dnl check for errmsg.h, which isn't installed by some versions of 3.21
3894 +  old_CPPFLAGS="$CPPFLAGS"
3895 +  CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
3896 +  AC_CHECK_HEADERS(errmsg.h mysql.h)
3897 +  CPPFLAGS="$old_CPPFLAGS"
3898 +
3899 +  AC_DEFINE([HAVE_MYSQL], [1], [mysql support])
3900 +else
3901 +  AC_MSG_RESULT(no)
3902 +fi
3903 +
3904 +AC_SUBST(MYSQL_LIBS)
3905 +AC_SUBST(MYSQL_INCLUDE)
3906 +
3907 +dnl Check for LDAP
3908 +AC_MSG_CHECKING(for LDAP support)
3909 +AC_ARG_WITH(ldap, AC_HELP_STRING([--with-ldap],[enable LDAP support]),
3910 +[WITH_LDAP=$withval], [WITH_LDAP=no])
3911 +AC_MSG_RESULT([$withval])
3912 +if test "$WITH_LDAP" != "no"; then
3913 + AC_CHECK_LIB(ldap, ldap_bind, [
3914 +  AC_CHECK_HEADERS([ldap.h],[
3915 +    LDAP_LIB=-lldap
3916 +    AC_DEFINE([HAVE_LIBLDAP], [1], [libldap])
3917 +    AC_DEFINE([HAVE_LDAP_H], [1])
3918 +    AC_DEFINE([LDAP_DEPRECATED], [1], [Using deprecated ldap api])
3919 +  ])
3920 + ])
3921 + AC_SUBST(LDAP_LIB)
3922 + AC_CHECK_LIB(lber, ber_printf, [
3923 +  AC_CHECK_HEADERS([lber.h],[
3924 +    LBER_LIB=-llber
3925 +    AC_DEFINE([HAVE_LIBLBER], [1], [liblber])
3926 +    AC_DEFINE([HAVE_LBER_H], [1])
3927 +  ])
3928 + ])
3929 + AC_SUBST(LBER_LIB)
3930 +fi
3931 +
3932 +dnl Check for xattr
3933 +AC_MSG_CHECKING(for extended attributes support)
3934 +AC_ARG_WITH(attr, AC_HELP_STRING([--with-attr],[enable extended attribute support]),
3935 +[WITH_ATTR=$withval],[WITH_ATTR=no])
3936 +AC_MSG_RESULT($withval)
3937 +if test "$WITH_ATTR" != "no"; then
3938 + AC_CHECK_LIB(attr, attr_get, [
3939 +       AC_CHECK_HEADERS([attr/attributes.h],[
3940 +               ATTR_LIB=-lattr
3941 +               AC_DEFINE([HAVE_XATTR], [1], [libattr])
3942 +               AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1])
3943 +       ])
3944 + ])
3945 + AC_SUBST(ATTR_LIB)
3946 +fi
3947 +
3948 +## openssl on solaris needs -lsocket -lnsl
3949 +AC_SEARCH_LIBS(socket,socket)
3950 +AC_SEARCH_LIBS(gethostbyname,nsl socket)
3951 +AC_SEARCH_LIBS(hstrerror,resolv)
3952 +
3953 +save_LIBS=$LIBS
3954 +AC_SEARCH_LIBS(dlopen,dl,[
3955 +  AC_CHECK_HEADERS([dlfcn.h],[
3956 +    if test "$ac_cv_search_dlopen" != no; then
3957 +      test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen"
3958 +    fi
3959 +
3960 +    AC_DEFINE([HAVE_LIBDL], [1], [libdl])
3961 +    AC_DEFINE([HAVE_DLFCN_H], [1])
3962 +  ])
3963 +])
3964 +LIBS=$save_LIBS
3965 +AC_SUBST(DL_LIB)
3966 +
3967 +dnl Check for valgrind
3968 +AC_MSG_CHECKING(for valgrind)
3969 +AC_ARG_WITH(valgrind, AC_HELP_STRING([--with-valgrind],[enable internal support for valgrind]),
3970 +[WITH_VALGRIND=$withval],[WITH_VALGRIND=no])
3971 +AC_MSG_RESULT([$WITH_VALGRIND])
3972 +if test "$WITH_VALGRIND" != "no"; then
3973 + AC_CHECK_HEADERS([valgrind/valgrind.h])
3974 +fi
3975 +
3976 +dnl Check for openssl
3977 +AC_MSG_CHECKING(for OpenSSL)
3978 +AC_ARG_WITH(openssl,
3979 +    AC_HELP_STRING([--with-openssl@<:@=DIR@:>@],[Include openssl support (default no)]),
3980 +    [WITH_OPENSSL=$withval],[WITH_OPENSSL=no])
3981 +
3982 +if test "$WITH_OPENSSL" != "no"; then
3983 +    use_openssl=yes
3984 +    if test "$WITH_OPENSSL" != "yes"; then
3985 +       CPPFLAGS="$CPPFLAGS -I$WITH_OPENSSL/include"
3986 +       LDFLAGS="$LDFLAGS -L$WITH_OPENSSL/lib"
3987 +    fi
3988 +else
3989 +    use_openssl=no
3990 +fi
3991 +AC_MSG_RESULT([$use_openssl])
3992 +
3993 +AC_ARG_WITH(openssl-includes,
3994 +    AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
3995 +    [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
3996 +)
3997 +
3998 +AC_ARG_WITH(openssl-libs,
3999 +    AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
4000 +    [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
4001 +)
4002 +
4003 +AC_ARG_WITH(kerberos5,
4004 +    AC_HELP_STRING([--with-kerberos5],[use Kerberos5 support with OpenSSL]),
4005 +    [ use_kerberos=yes ], [use_kerberos=no]
4006 +)
4007 +
4008 +if test "x$use_openssl" = "xyes"; then
4009 +    if test "x$use_kerberos" != "xyes"; then
4010 +        CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
4011 +    fi
4012 +
4013 +    AC_CHECK_HEADERS([openssl/ssl.h])
4014 +    OLDLIBS="$LIBS"
4015 +    AC_CHECK_LIB(crypto, BIO_f_base64, [
4016 +      AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto"
4017 +                                AC_DEFINE(HAVE_LIBSSL, [], [Have libssl]) ], [], [ -lcrypto "$DL_LIB" ])
4018 +    ], [], [])
4019 +    LIBS="$OLDLIBS"
4020 +    AC_SUBST(SSL_LIB)
4021 +fi
4022 +
4023 +AC_MSG_CHECKING(for perl regular expressions support)
4024 +AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes)]),
4025 +    [WITH_PCRE=$withval],[WITH_PCRE=yes])
4026 +AC_MSG_RESULT([$WITH_PCRE])
4027 +
4028 +if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then
4029 +  AC_PATH_PROG(PCRECONFIG, pcre-config)
4030 +
4031 +  if test x"$PCRECONFIG" != x; then
4032 +    PCRE_LIB=`$PCRECONFIG --libs`
4033 +    CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
4034 +    AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
4035 +    AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
4036 +  else
4037 +     AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
4038 +  fi
4039 +fi
4040 +
4041 +AC_SUBST(PCRE_LIB)
4042 +
4043 +AC_MSG_CHECKING(for zlib support)
4044 +AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib],[Enable zlib support for mod_compress]),
4045 +    [WITH_ZLIB=$withval],[WITH_ZLIB=yes])
4046 +AC_MSG_RESULT([$WITH_ZLIB])
4047 +
4048 +if test "$WITH_ZLIB" != "no"; then
4049 +  AC_CHECK_LIB(z, deflate, [
4050 +    AC_CHECK_HEADERS([zlib.h],[
4051 +      Z_LIB=-lz
4052 +      AC_DEFINE([HAVE_LIBZ], [1], [libz])
4053 +      AC_DEFINE([HAVE_ZLIB_H], [1])
4054 +    ])
4055 +  ])
4056 +  if test x$Z_LIB = x; then
4057 +     AC_MSG_ERROR([zlib-headers and/or libs where not found, install them or build with --without-zlib])
4058 +  fi
4059 +fi
4060 +AC_SUBST(Z_LIB)
4061 +
4062 +AC_MSG_CHECKING(for bzip2 support)
4063 +AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2],[Enable bzip2 support for mod_compress]),
4064 +    [WITH_BZIP2=$withval],[WITH_BZIP2=yes])
4065 +AC_MSG_RESULT([$WITH_BZIP2])
4066 +
4067 +if test "$WITH_BZIP2" != "no"; then
4068 +  AC_CHECK_LIB(bz2, BZ2_bzCompress, [
4069 +    AC_CHECK_HEADERS([bzlib.h],[
4070 +      BZ_LIB=-lbz2
4071 +      AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2])
4072 +      AC_DEFINE([HAVE_BZLIB_H], [1])
4073 +    ])
4074 +  ])
4075 +  if test x$BZ_LIB = x; then
4076 +     AC_MSG_ERROR([bzip2-headers and/or libs where not found, install them or build with --without-bzip2])
4077 +  fi
4078 +fi
4079 +AC_SUBST(BZ_LIB)
4080 +
4081 +if test -z "$PKG_CONFIG"; then
4082 +  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
4083 +fi
4084 +
4085 +dnl Check for gamin
4086 +AC_MSG_CHECKING(for FAM)
4087 +AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]),
4088 +[WITH_FAM=$withval],[WITH_FAM=no])
4089 +AC_MSG_RESULT([$WITH_FAM])
4090 +
4091 +if test "$WITH_FAM" != "no"; then
4092 +  AC_CHECK_LIB(fam, FAMOpen2, [
4093 +    AC_CHECK_HEADERS([fam.h],[
4094 +      FAM_LIBS=-lfam
4095 +      AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
4096 +      AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
4097 +    ])
4098 +  ])
4099 +  if test "x$FAM_LIBS" = x; then
4100 +    PKG_CHECK_MODULES(FAM, gamin >= 0.1.0, [
4101 +      AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
4102 +      AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
4103 +    ])
4104 +  fi
4105 +  OLD_LIBS=$LIBS
4106 +  LIBS=$FAM_LIBS
4107 +  AC_CHECK_FUNCS([FAMNoExists])
4108 +  LIBS=$OLD_LIBS
4109 +  
4110 +  if test x$FAM_LIBS = x; then
4111 +     AC_MSG_ERROR([fam/gamin-headers and/or libs where not found, install them or build with --without-fam])
4112 +  fi
4113 +fi
4114 +
4115 +AC_MSG_CHECKING(for properties in mod_webdav)
4116 +AC_ARG_WITH(webdav-props, AC_HELP_STRING([--with-webdav-props],[properties in mod_webdav]),
4117 +[WITH_WEBDAV_PROPS=$withval],[WITH_WEBDAV_PROPS=no])
4118 +AC_MSG_RESULT([$WITH_WEBDAV_PROPS])
4119 +
4120 +if test "$WITH_WEBDAV_PROPS" != "no"; then
4121 + PKG_CHECK_MODULES(XML, libxml-2.0, [
4122 +    AC_DEFINE([HAVE_LIBXML2], [1], [libxml2])
4123 +    AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h])
4124 + ])
4125 + PKG_CHECK_MODULES(SQLITE, sqlite3, [
4126 +    AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
4127 +    AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
4128 + ])
4129 +
4130 + AC_MSG_CHECKING(for locks in mod_webdav)
4131 + AC_ARG_WITH(webdav-locks, AC_HELP_STRING([--with-webdav-locks],[locks in mod_webdav]),
4132 + [WITH_WEBDAV_LOCKS=$withval],[WITH_WEBDAV_LOCKS=no])
4133 + AC_MSG_RESULT([$WITH_WEBDAV_LOCKS])
4134 +
4135 + if test "$WITH_WEBDAV_LOCKS" != "no"; then
4136 +   AC_CHECK_LIB(uuid, uuid_unparse, [
4137 +         AC_CHECK_HEADERS([uuid/uuid.h],[
4138 +                 UUID_LIBS=-luuid
4139 +                 AC_DEFINE([HAVE_UUID], [1], [libuuid])
4140 +                AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available])
4141 +         ])
4142 + ])
4143 +
4144 + fi
4145 +fi
4146 +AC_SUBST(UUID_LIBS)
4147 +
4148 +dnl Check for gdbm
4149 +AC_MSG_CHECKING(for gdbm)
4150 +AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm],[gdbm storage for mod_trigger_b4_dl]),
4151 +[WITH_GDBM=$withval],[WITH_GDBM=no])
4152 +AC_MSG_RESULT([$WITH_GDBM])
4153 +
4154 +if test "$WITH_GDBM" != "no"; then
4155 + AC_CHECK_LIB(gdbm, gdbm_open, [
4156 +         AC_CHECK_HEADERS([gdbm.h],[
4157 +                 GDBM_LIB=-lgdbm
4158 +                 AC_DEFINE([HAVE_GDBM], [1], [libgdbm])
4159 +                AC_DEFINE([HAVE_GDBM_H], [1])
4160 +         ])
4161 + ])
4162 + AC_SUBST(GDBM_LIB)
4163 +fi
4164 +
4165 +dnl Check for memcache
4166 +AC_MSG_CHECKING(for memcache)
4167 +AC_ARG_WITH(memcache, AC_HELP_STRING([--with-memcache],[memcached storage for mod_trigger_b4_dl]),
4168 +[WITH_MEMCACHE=$withval],[WITH_MEMCACHE=no])
4169 +AC_MSG_RESULT([$WITH_MEMCACHE])
4170 +if test "$WITH_MEMCACHE" != "no"; then
4171 + AC_CHECK_LIB(memcache, mc_new, [
4172 +         AC_CHECK_HEADERS([memcache.h],[
4173 +                 MEMCACHE_LIB=-lmemcache
4174 +                 AC_DEFINE([HAVE_MEMCACHE], [1], [libmemcache])
4175 +                AC_DEFINE([HAVE_MEMCACHE_H], [1], [memcache.h])
4176 +         ])
4177 + ])
4178 + AC_SUBST(MEMCACHE_LIB)
4179 +fi
4180 +
4181 +dnl Check for lua
4182 +AC_MSG_CHECKING(if lua-support is requested)
4183 +AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
4184 +[WITH_LUA=$withval],[WITH_LUA=no])
4185 +
4186 +AC_MSG_RESULT($WITH_LUA)
4187 +if test "$WITH_LUA" != "no"; then
4188 + if test "$WITH_LUA" = "yes"; then
4189 +  WITH_LUA=lua
4190 + fi
4191 + PKG_CHECK_MODULES(LUA, $WITH_LUA >= 5.1, [
4192 +   AC_DEFINE([HAVE_LUA], [1], [liblua])
4193 +   AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
4194 + ],[
4195 +   # for debian based systems
4196 +   PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
4197 +     AC_DEFINE([HAVE_LUA], [1], [liblua])
4198 +     AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
4199 +   ])
4200 + ])
4201 +
4202 + AC_SUBST(LUA_CFLAGS)
4203 + AC_SUBST(LUA_LIBS)
4204 +fi
4205 +
4206 +save_LIBS=$LIBS
4207 +AC_SEARCH_LIBS(crypt,crypt,[
4208 +  AC_CHECK_HEADERS([crypt.h],[
4209 +    AC_DEFINE([HAVE_CRYPT_H], [1])
4210 +  ])
4211 +
4212 +  AC_DEFINE([HAVE_LIBCRYPT], [1], [libcrypt])
4213 +  if test "$ac_cv_search_crypt" != no; then
4214 +    test "$ac_cv_search_crypt" = "none required" || CRYPT_LIB="$ac_cv_search_crypt"
4215 +  fi
4216 +])
4217 +LIBS=$save_LIBS
4218 +AC_SUBST(CRYPT_LIB)
4219 +
4220 +save_LIBS=$LIBS
4221 +AC_SEARCH_LIBS(sendfilev,sendfile,[
4222 +  if test "$ac_cv_search_sendfilev" != no; then
4223 +    test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev"
4224 +    AC_DEFINE([HAVE_SENDFILEV], [1], [solaris sendfilev])
4225 +  fi
4226 +])
4227 +LIBS=$save_LIBS
4228 +AC_SUBST(SENDFILE_LIB)
4229 +
4230 +case $host_os in
4231 +       *mingw* ) LIBS="$LIBS -lwsock32";;
4232 +        * ) ;;
4233 +esac
4234 +
4235 +AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
4236 +                 strdup strerror strstr strtol sendfile  getopt socket lstat \
4237 +                 gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
4238 +                 getuid select signal pathconf madvise posix_fadvise posix_madvise \
4239 +                 writev sigaction sendfile64 send_file kqueue port_create localtime_r gmtime_r])
4240 +
4241 +AC_MSG_CHECKING(for Large File System support)
4242 +AC_ARG_ENABLE(lfs,
4243 + AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]),
4244 + [case "${enableval}" in
4245 +   yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
4246 +    no) ;;
4247 +     *) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;;
4248 +  esac],[CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
4249 +        enable_lfs=yes])
4250 +AC_MSG_RESULT($enableval)
4251 +
4252 +AC_CHECK_SIZEOF(long)
4253 +AC_CHECK_SIZEOF(off_t)
4254 +
4255 +if test "x$ac_cv_func_sendfile" = xyes; then
4256 +       # check if sendfile works
4257 +        AC_MSG_CHECKING(if sendfile works)
4258 +       if test "x$cross_compiling" = xno; then
4259 +       AC_TRY_RUN([
4260 +                   #ifdef HAVE_SYS_SENDFILE_H
4261 +                   #include <sys/sendfile.h>
4262 +                   #endif /* HAVE_SYS_SENDFILE_H */
4263 +                   #include <errno.h>
4264 +                   int main() {
4265 +                     int o = 0;
4266 +                     if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1;
4267 +                     return 0;
4268 +                   } ],
4269 +                   AC_MSG_RESULT(yes),
4270 +                   [ AC_MSG_RESULT(no)
4271 +                   AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) ] )
4272 +       else
4273 +             AC_MSG_RESULT(no, cross-compiling)
4274 +             AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])
4275 +       fi
4276 +fi
4277 +
4278 +dnl Check for IPv6 support
4279 +
4280 +AC_ARG_ENABLE(ipv6,
4281 + AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
4282 + [case "${enableval}" in
4283 +   yes) ipv6=true ;;
4284 +    no) ipv6=false ;;
4285 +     *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
4286 +  esac],[ipv6=true])
4287 +
4288 +if test x$ipv6 = xtrue; then
4289 +  AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
4290 +  [AC_TRY_LINK([ #include <sys/types.h>
4291 +#include <sys/socket.h>
4292 +#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ],
4293 +  [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
4294 +
4295 +  if test "$ac_cv_ipv6_support" = yes; then
4296 +    AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
4297 +  fi
4298 +fi
4299 +
4300 +
4301 +AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
4302 +
4303 +dnl check for fastcgi lib, for the tests only
4304 +fastcgi_found=no
4305 +AC_CHECK_LIB(fcgi, FCGI_Accept, [
4306 + AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h],[
4307 +   fastcgi_found=yes
4308 + ])
4309 +])
4310 +
4311 +AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
4312 +
4313 +
4314 +# check for extra compiler options (warning options)
4315 +if test "${GCC}" = "yes"; then
4316 +    CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
4317 +fi
4318 +
4319 +AC_ARG_ENABLE(extra-warnings,
4320 + AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
4321 + [case "${enableval}" in
4322 +   yes) extrawarnings=true ;;
4323 +    no) extrawarnings=false ;;
4324 +     *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
4325 +  esac],[extrawarnings=false])
4326 +
4327 +if test x$extrawarnings = xtrue; then
4328 +    CFLAGS="${CFLAGS} -g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wno-pointer-sign -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -Wformat-security"
4329 +fi
4330 +
4331 +dnl build version-id
4332 +LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'`
4333 +AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id])
4334 +
4335 +AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile \
4336 +                tests/docroot/Makefile \
4337 +                tests/docroot/123/Makefile \
4338 +                tests/docroot/www/Makefile \
4339 +                tests/docroot/www/go/Makefile \
4340 +                tests/docroot/www/indexfile/Makefile \
4341 +                tests/docroot/www/expire/Makefile \
4342 +                distribute.sh])
4343 +AC_OUTPUT
4344 +
4345 +
4346 +do_build="mod_cgi mod_fastcgi mod_extforward mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog"
4347 +do_build="$do_build mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfile mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming"
4348 +
4349 +plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl"
4350 +features="regex-conditionals"
4351 +if test ! "x$PCRE_LIB" = x; then
4352 +       do_build="$do_build $plugins"
4353 +       enable_feature="$features"
4354 +else
4355 +       no_build="$no_build $plugins"
4356 +       disable_feature="$features"
4357 +fi
4358 +
4359 +plugins="mod_mysql_vhost"
4360 +if test ! "x$MYSQL_LIBS" = x; then
4361 +       do_build="$do_build $plugins"
4362 +else
4363 +       no_build="$no_build $plugins"
4364 +fi
4365 +
4366 +plugins="mod_cml mod_magnet"
4367 +if test ! "x$LUA_LIBS" = x; then
4368 +       do_build="$do_build $plugins"
4369 +else
4370 +       no_build="$no_build $plugins"
4371 +fi
4372 +
4373 +features="storage-gdbm"
4374 +if test ! "x$GDBM_LIB" = x; then
4375 +       enable_feature="$enable_feature $features"
4376 +else
4377 +       disable_feature="$disable_feature $features"
4378 +fi
4379 +
4380 +features="storage-memcache"
4381 +if test ! "x$MEMCACHE_LIB" = x; then
4382 +       enable_feature="$enable_feature $features"
4383 +else
4384 +       disable_feature="$disable_feature $features"
4385 +fi
4386 +
4387 +features="compress-gzip compress-deflate"
4388 +if test ! "x$Z_LIB" = x; then
4389 +       enable_feature="$enable_feature $features"
4390 +else
4391 +       disable_feature="$disable_feature $features"
4392 +fi
4393 +
4394 +features="compress-bzip2"
4395 +if test ! "x$BZ_LIB" = x; then
4396 +       enable_feature="$enable_feature $features"
4397 +else
4398 +       disable_feature="$disable_feature $features"
4399 +fi
4400 +
4401 +features="auth-ldap"
4402 +if test ! "x$LDAP_LIB" = x; then
4403 +       enable_feature="$enable_feature $features"
4404 +else
4405 +       disable_feature="$disable_feature $features"
4406 +fi
4407 +
4408 +features="network-openssl"
4409 +if test ! "x$SSL_LIB" = x; then
4410 +       enable_feature="$enable_feature $features"
4411 +else
4412 +       disable_feature="$disable_feature $features"
4413 +fi
4414 +
4415 +# no crypt call
4416 +features="auth-crypt"
4417 +if test "$ac_cv_search_crypt" = no; then
4418 +       disable_feature="$disable_feature $features"
4419 +else
4420 +       enable_feature="$enable_feature $features"
4421 +fi
4422 +
4423 +features="network-ipv6"
4424 +if test "$ac_cv_ipv6_support" = yes; then
4425 +       enable_feature="$enable_feature $features"
4426 +else
4427 +       disable_feature="$disable_feature $features"
4428 +fi
4429 +
4430 +features="large-files"
4431 +if test "$enable_lfs" = yes; then
4432 +       enable_feature="$enable_feature $features"
4433 +else
4434 +       disable_feature="$disable_feature $features"
4435 +fi
4436 +
4437 +features="stat-cache-fam"
4438 +if test ! "x$FAM_LIBS" = x; then
4439 +       enable_feature="$enable_feature $features"
4440 +else
4441 +       disable_feature="$disable_feature $features"
4442 +fi
4443 +
4444 +features="webdav-properties"
4445 +if test "x$XML_LIBS" \!= x -a "x$SQLITE_LIBS" \!= x; then
4446 +       enable_feature="$enable_feature $features"
4447 +else
4448 +       disable_feature="$disable_feature $features"
4449 +fi
4450 +
4451 +features="webdav-locks"
4452 +if test "x$UUID_LIBS" \!= x; then
4453 +       enable_feature="$enable_feature $features"
4454 +else
4455 +       disable_feature="$disable_feature $features"
4456 +fi
4457 +
4458 +
4459 +## output
4460 +
4461 +$ECHO
4462 +$ECHO "Plugins:"
4463 +$ECHO
4464 +
4465 +$ECHO "enabled: "
4466 +for p in $do_build; do
4467 +       $ECHO "  $p"
4468 +done | sort
4469 +
4470 +$ECHO "disabled: "
4471 +for p in $no_build; do
4472 +       $ECHO "  $p"
4473 +done | sort
4474 +
4475 +$ECHO
4476 +$ECHO "Features:"
4477 +$ECHO
4478 +
4479 +$ECHO "enabled: "
4480 +for p in $enable_feature; do
4481 +       $ECHO "  $p"
4482 +done | sort
4483 +
4484 +$ECHO "disabled: "
4485 +for p in $disable_feature; do
4486 +       $ECHO "  $p"
4487 +done | sort
4488 +
4489 +$ECHO
4490 Index: doc/lighttpd.1
4491 ===================================================================
4492 --- doc/lighttpd.1      (.../tags/lighttpd-1.4.22)      (revision 2505)
4493 +++ doc/lighttpd.1      (.../branches/lighttpd-1.4.x)   (revision 2505)
4494 @@ -1,18 +0,0 @@
4495 -.TH LIGHTTPD 1 2003-12-21
4496 -.SH NAME
4497 -lighttpd - a fast, secure and flexible webserver
4498 -.SH SYNOPSIS
4499 -lighttpd -D -f <configfile>
4500 -.SH DESCRIPTION
4501 -.SH FILES
4502 -/etc/lighttpd/lighttpd.conf
4503 -.SH CONFORMING TO
4504 -HTTP/1.0
4505 -HTTP/1.0
4506 -HTTP-Authentification - Basic, Digest
4507 -FastCGI
4508 -CGI/1.1
4509 -.SH SEE ALSO
4510 -spawn-fcgi(1)
4511 -.SH AUTHOR
4512 -jan@kneschke.de
4513 Index: doc/spawn-fcgi.1
4514 ===================================================================
4515 --- doc/spawn-fcgi.1    (.../tags/lighttpd-1.4.22)      (revision 2505)
4516 +++ doc/spawn-fcgi.1    (.../branches/lighttpd-1.4.x)   (revision 2505)
4517 @@ -1,13 +0,0 @@
4518 -.TH SPAWNFCGI 1 2003-12-21
4519 -.SH NAME
4520 -spawn-fcgi \- spawning FastCGI processes
4521 -.SH SYNOPSIS
4522 -spawn-fcgi -f <fastcgi-binary> [-p <port> | -s <socket>] [-C <num-of-php-procs>] [-c <chroot-dir>] [-u <username>] [-g <groupname>]
4523 -spawn-fcgi -v
4524 -spawn-fcgi -h
4525 -.SH DESCRIPTION
4526 -spawn-fcgi is used to spawn remote FastCGI processes.
4527 -.SH SEE ALSO
4528 -lighttpd(1)
4529 -.SH AUTHOR
4530 -jan@kneschke.de
4531 Index: doc/configuration.txt
4532 ===================================================================
4533 --- doc/configuration.txt       (.../tags/lighttpd-1.4.22)      (revision 2505)
4534 +++ doc/configuration.txt       (.../branches/lighttpd-1.4.x)   (revision 2505)
4535 @@ -281,6 +281,12 @@
4536  server.use-ipv6
4537    bind to the IPv6 socket
4538  
4539 +server.defer-accept
4540 +  set TCP_DEFER_ACCEPT to the specified value on the socket if the value is > 0
4541 +  and TCP_DEFER_ACCEPT is available on the platform (linux2.4+)
4542 +
4543 +  default: 0
4544 +
4545  server.tag
4546    set the string returned by the Server: response header
4547  
4548 Index: doc/lighttpd.8
4549 ===================================================================
4550 --- doc/lighttpd.8      (.../tags/lighttpd-1.4.22)      (revision 0)
4551 +++ doc/lighttpd.8      (.../branches/lighttpd-1.4.x)   (revision 2505)
4552 @@ -0,0 +1,70 @@
4553 +.TH LIGHTTPD "8" "2009-03-07" "" ""
4554 +.
4555 +.SH NAME
4556 +lighttpd \- a fast, secure and flexible web server
4557 +.
4558 +.SH SYNOPSIS
4559 +\fBlighttpd\fP [\fB\-ptDvVh\fP] \fB\-f\fP \fIconfigfile\fP [\fB\-m\fP \fImoduledir\fP]
4560 +.
4561 +.SH DESCRIPTION
4562 +\fBlighttpd\fP (pronounced 'lighty') is an advanced HTTP daemon that aims
4563 +to be secure, fast, compliant and very flexible.  It has been optimized for
4564 +high performance.  Its feature set includes, but is not limited to, FastCGI,
4565 +CGI, basic and digest HTTP authentication, output compression, URL rewriting.
4566 +.PP
4567 +This manual page only lists the command line arguments.  For details
4568 +on how to configure \fBlighttpd\fP and its modules see the files in the
4569 +doc-directory.
4570 +.
4571 +.SH OPTIONS
4572 +The following options are supported:
4573 +.TP 8
4574 +\fB\-f\ \fP \fIconfigfile\fP
4575 +Load configuration file \fIconfigfile\fP.
4576 +.TP 8
4577 +\fB\-m\ \fP \fImoduledir\fP
4578 +Use
4579 +\fImoduledir\fP
4580 +as the directory that contains modules, instead of the default.
4581 +.TP 8
4582 +\fB\-p\fP
4583 +Print the parsed configuration file in its internal form and exit.
4584 +.TP 8
4585 +\fB\-t\fP
4586 +Test the configuration file for syntax errors and exit.
4587 +.TP 8
4588 +\fB\-D\fP
4589 +Do not daemonize (go into background). The default is to daemonize.
4590 +.TP 8
4591 +\fB\-v\fP
4592 +Show version and exit.
4593 +.TP 8
4594 +\fB\-V\fP
4595 +Show compile-time features and exit.
4596 +.TP 8
4597 +\fB\-h\fP
4598 +Show a brief help message and exit.
4599 +.
4600 +.SH FILES
4601 +.TP 8
4602 +/etc/lighttpd/lighttpd.conf
4603 +The standard location for the configuration file.
4604 +.TP 8
4605 +/var/run/lighttpd.pid
4606 +The standard location for the PID of the running \fBlighttpd\fP process.
4607 +.
4608 +.SH SEE ALSO
4609 +Online Documentation: http://wiki.lighttpd.net/
4610 +.PP
4611 +spawn-fcgi(1)
4612 +.PP
4613 +\fIHypertext Transfer Protocol -- HTTP/1.1\fP, RFC 2616.
4614 +.PP
4615 +\fIHTTP Authentication: Basic and Digest Access Authentication\fP, RFC 2617.
4616 +.PP
4617 +\fIThe Common Gateway Interface Version 1.1\fP, RFC 3875.
4618 +.PP
4619 +\fIThe FastCGI specification\fP.
4620 +.
4621 +.SH AUTHOR
4622 +Jan Kneschke <jan@kneschke.de>
4623 Index: doc/evhost.txt
4624 ===================================================================
4625 --- doc/evhost.txt      (.../tags/lighttpd-1.4.22)      (revision 2505)
4626 +++ doc/evhost.txt      (.../branches/lighttpd-1.4.x)   (revision 2505)
4627 @@ -33,6 +33,7 @@
4628    %2 => domain name without tld
4629    %3 => subdomain 1 name
4630    %4 => subdomain 2 name
4631 +  %_ => the complete hostname (without port info)
4632  
4633    evhost.path-pattern = "/home/www/servers/%3/pages/"
4634  
4635 Index: doc/dirlisting.txt
4636 ===================================================================
4637 --- doc/dirlisting.txt  (.../tags/lighttpd-1.4.22)      (revision 2505)
4638 +++ doc/dirlisting.txt  (.../branches/lighttpd-1.4.x)   (revision 2505)
4639 @@ -80,3 +80,47 @@
4640    Example: ::
4641  
4642      dir-listing.encoding = "utf-8"
4643 +
4644 +dir-listing.show-readme
4645 +  shows README.txt after the dirlisting if it exists in the directory
4646 +
4647 +  Default: disabled
4648 +
4649 +dir-listing.hide-readme-file
4650 +  hides README.txt in the dirlisting
4651 +
4652 +  Default: disabled
4653 +
4654 +dir-listing.show-header
4655 +  shows HEADER.txt before the dirlisting if it exists in the directory
4656 +
4657 +  Default: disabled
4658 +
4659 +dir-listing.hide-header-file
4660 +  hides HEADER.txt in the dirlisting
4661 +
4662 +  Default: disabled
4663 +
4664 +dir-listing.set-footer
4665 +
4666 +  Default: empty, uses server.tag instead
4667 +
4668 +dir-listing.encode-readme
4669 +  encodes all control characers, '&', '<', '>' and '\x7f' as &#x**;
4670 +
4671 +  Default: enabled
4672 +
4673 +dir-listing.encode-header
4674 +  encodes all control characers, '&', '<', '>' and '\x7f' as &#x**;
4675 +
4676 +  Default: enabled
4677 +
4678 +dir-listing.auto-layout
4679 +  Disable this if you want your own html header and footer; specify
4680 +  them in HEADER.txt and README.txt
4681 +
4682 +  you have to enable dir-list.show-readme/header for this of course
4683 +
4684 +  .external-css and .set-footer will be ignored if this is disabled
4685 +
4686 +  Default: enabled
4687 Index: doc/lighttpd.conf
4688 ===================================================================
4689 --- doc/lighttpd.conf   (.../tags/lighttpd-1.4.22)      (revision 2505)
4690 +++ doc/lighttpd.conf   (.../branches/lighttpd-1.4.x)   (revision 2505)
4691 @@ -16,7 +16,6 @@
4692  #                               "mod_redirect",
4693  #                               "mod_alias",
4694                                  "mod_access",
4695 -#                               "mod_cml",
4696  #                               "mod_trigger_b4_dl",
4697  #                               "mod_auth",
4698  #                               "mod_status",
4699 @@ -35,8 +34,8 @@
4700  #                               "mod_rrdtool",
4701                                  "mod_accesslog" )
4702  
4703 -## a static document-root, for virtual-hosting take look at the
4704 -## server.virtual-* options
4705 +## A static document-root. For virtual hosting take a look at the
4706 +## mod_simple_vhost module.
4707  server.document-root        = "/srv/www/htdocs/"
4708  
4709  ## where to send error-messages to
4710 @@ -299,11 +298,6 @@
4711  # trigger-before-download.deny-url = "http://127.0.0.1/index.html"
4712  # trigger-before-download.trigger-timeout = 10
4713  
4714 -## for mod_cml
4715 -## don't forget to add index.cml to server.indexfiles
4716 -# cml.extension               = ".cml"
4717 -# cml.memcache-hosts          = ( "127.0.0.1:11211" )
4718 -
4719  #### variable usage:
4720  ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
4721  #bar = 1
4722 Index: doc/extforward.txt
4723 ===================================================================
4724 --- doc/extforward.txt  (.../tags/lighttpd-1.4.22)      (revision 2505)
4725 +++ doc/extforward.txt  (.../branches/lighttpd-1.4.x)   (revision 2505)
4726 @@ -49,11 +49,20 @@
4727    Default: empty
4728  
4729    Example: ::
4730 -    
4731 +
4732      extforward.forwarder = ("10.0.0.232" => "trust")
4733  
4734 -  will translate ip addresses coming from 10.0.0.232 to real ip addresses extracted from X-Forwarded-For: HTTP request header.
4735 +  will translate ip addresses coming from 10.0.0.232 to real ip addresses extracted from "X-Forwarded-For" or "Forwarded-For" HTTP request header.
4736  
4737 +extforward.headers
4738 +  Sets headers to search for finding the originl addresses.
4739 +
4740 +  Example (for use with a Zeus ZXTM loadbalancer): ::
4741 +
4742 +    extforward.headers = ("X-Cluster-Client-Ip")
4743 +
4744 +  Default: empty, results in searching for "X-Forwarded-For" and "Forwarded-For"
4745 +
4746  Note
4747  =======
4748  
4749 Index: doc/Makefile.am
4750 ===================================================================
4751 --- doc/Makefile.am     (.../tags/lighttpd-1.4.22)      (revision 2505)
4752 +++ doc/Makefile.am     (.../branches/lighttpd-1.4.x)   (revision 2505)
4753 @@ -1,6 +1,5 @@
4754 -dist_man1_MANS=lighttpd.1 spawn-fcgi.1
4755 +dist_man8_MANS=lighttpd.8
4756  
4757 -
4758  DOCS=accesslog.txt \
4759  authentication.txt \
4760  cgi.txt \
4761 Index: SConstruct
4762 ===================================================================
4763 Index: NEWS
4764 ===================================================================
4765 --- NEWS        (.../tags/lighttpd-1.4.22)      (revision 2505)
4766 +++ NEWS        (.../branches/lighttpd-1.4.x)   (revision 2505)
4767 @@ -3,7 +3,46 @@
4768  NEWS
4769  ====
4770  
4771 -- 1.4.22 -
4772 +- 1.4.23 -
4773 +  * Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
4774 +  * New lighttpd man page (moved it to section 8) (fixes #1875)
4775 +  * Create rrd file for empty rrdfile in mod_rrdtool (#1788)
4776 +  * Fix workaround for incorrect path info/scriptname if fastcgi prefix is "/" (fixes #729)
4777 +  * Finally removed spawn-fcgi
4778 +  * Allow xattr to overwrite mime type (fixes #1929)
4779 +  * Remove link from errormsg about fastcgi apps (fixes #1942)
4780 +  * Strip trailing dot from "Host:" header
4781 +  * Remove the optional port info from SERVER_NAME (thx Mr_Bond)
4782 +  * Fix mod_proxy RoundRobin (off by one problem if only one backend is up)
4783 +  * Rename configure.in to configure.ac, with small cleanups (fixes #1932)
4784 +  * Add proper SUID bit detection (fixes #416)
4785 +  * Check for regular file in mod_cgi, so we don't try to start directories
4786 +  * Include mmap.h from chunk.h to fix some problems with #define mmap mmap64 (fixes #1923)
4787 +  * Add support for pipe logging for server.errorlog (fixes #296)
4788 +  * Add revision number to package version for svn/git checkouts
4789 +  * Use server.tag for SERVER_SOFTWARE if configured (fixes #357)
4790 +  * Fix trailing zero char in REQUEST_URI after "strip-request-uri" in mod_fastcgi
4791 +  * mod_magnet: Add env["request.remote-ip"] (fixes #1740)
4792 +  * mod_magnet: Add env["request.path-info"]
4793 +  * Change name/version separator back to "/" (affects every place where the version is printed)
4794 +  * Fix bug with FastCGI request id overflow under high load; just use always id 1 as we don't use multiplexing. (thx jgray)
4795 +  * Add some dirlisting enhancements (fixes #1458)
4796 +  * Add option to enable TCP_DEFER_ACCEPT (fixes #1447)
4797 +  * Limit amount of bytes read for one read-event (fixes #1070)
4798 +  * Add evasive.silent option (fixes #1438)
4799 +  * Make mod_extforward headers configurable (fixes #1545)
4800 +  * Add '%_' pattern for complete hostname in mod_evhost (fixes #1737)
4801 +  * Add IPv6 support to mod_proxy (fixes #1537)
4802 +  * mod_ssi printenv: print cgi env, add environment vars to cgi env (fixes #1713)
4803 +  * Fix error message if no auth backend was set
4804 +  * Fix SERVER_NAME port stripping (fixes #1968)
4805 +  * Fix x-sendfile 2gb limiting (fixes #1970)
4806 +  * Fix mod_cgi environment keys mangling (fixes #1969)
4807 +  * Fix workaround for incorrect path info/scriptname if scgi prefix is "/" (fixes #729)
4808 +  * Fix max-age value in mod_expire for 'modification' (fixes #1978)
4809 +  * Fix evasive.silent option (#1438)
4810 +
4811 +- 1.4.22 - 2009-03-07
4812    * Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)
4813    * Fix default vhost in mod_simple_vhost (fixes #1905)
4814    * Handle EINTR in mod_rrdtool (fixes #604)
4815 Index: CMakeLists.txt
4816 ===================================================================
4817
4818 Property changes on: .
4819 ___________________________________________________________________
4820 Modified: bzr:revision-info
4821    - timestamp: 2009-03-07 14:58:05.338000059 +0100
4822 committer: Stefan Bühler <stbuehler@web.de>
4823 properties: 
4824         branch-nick: lighttpd-1.4.x
4825
4826    + timestamp: 2009-03-07 22:04:32.213999987 +0100
4827 committer: Stefan Bühler <stbuehler@web.de>
4828 properties: 
4829         branch-nick: lighttpd-1.4.x
4830
4831 Modified: bzr:file-ids
4832    - 
4833    + doc/lighttpd.8     lighttpd.8-20090307205615-mc312p5ocjwthwte-1
4834
4835 Modified: bzr:revision-id:v3-trunk0
4836    - 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
4837 1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
4838 1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
4839 1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
4840 1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
4841 1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
4842 1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
4843 1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
4844 1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
4845 1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
4846 1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
4847 1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
4848 1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
4849 1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
4850 1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
4851 1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
4852 1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
4853 1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
4854 1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
4855 1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
4856 1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
4857 1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
4858 1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
4859 1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
4860 1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
4861 1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
4862 1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
4863 1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
4864 1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
4865 1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
4866 1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
4867 1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
4868 1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
4869 1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
4870 1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
4871 1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
4872 1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
4873 1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
4874 1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
4875 1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
4876 1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
4877 1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
4878 1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
4879 1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
4880 1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
4881 1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
4882 1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
4883 1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
4884 1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
4885 1176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
4886 1177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
4887 1178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
4888 1179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
4889 1180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
4890 1181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
4891 1182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
4892 1183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
4893 1184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
4894 1185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
4895 1186 stbuehler@web.de-20081001200802-l5og517etnneitk0
4896 1188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
4897 1189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
4898 1191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
4899 1192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
4900 1193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
4901 1195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
4902 1196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
4903 1197 stbuehler@web.de-20081016121114-65quosenmso8frf8
4904 1198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
4905 1199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
4906 1200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
4907 1201 stbuehler@web.de-20081205233903-708beaujtf26gprx
4908 1202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
4909 1203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
4910 1204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
4911 1205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
4912 1206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
4913 1208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
4914 1209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
4915 1210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
4916 1211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
4917 1212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
4918 1213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
4919 1214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
4920 1215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
4921 1216 stbuehler@web.de-20090205105134-6i5key9439wspueq
4922 1217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
4923 1218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3
4924 1219 stbuehler@web.de-20090205215425-vicbc6hzb3at7gj9
4925 1220 stbuehler@web.de-20090205220741-vqz9l1eui3dwnulq
4926 1221 stbuehler@web.de-20090205222705-8179v6jkv2x38l70
4927 1222 stbuehler@web.de-20090210194631-6epujtpen9xfxx5j
4928 1223 stbuehler@web.de-20090216134207-fg99ikt1ds21hx25
4929 1224 stbuehler@web.de-20090217085833-9g5c7j7zdylvezl5
4930 1225 stbuehler@web.de-20090217133414-y80hydn9raqgkgto
4931 1226 stbuehler@web.de-20090217224447-ve7ns45c9otbgz9h
4932 1227 stbuehler@web.de-20090219130703-117t93t4hr4j0e8d
4933 1228 stbuehler@web.de-20090219130728-m8nui64vin0w95b2
4934 1229 stbuehler@web.de-20090219131550-exi19tbqyd8fpa0d
4935 1230 stbuehler@web.de-20090224133046-toewpee0ybw5tuay
4936 1231 stbuehler@web.de-20090228205351-yqjhutdqf30jr66o
4937 1232 stbuehler@web.de-20090228213824-gnwuf6by8705g6zk
4938 1233 stbuehler@web.de-20090303100525-kamra70ocxpji0l5
4939 1234 stbuehler@web.de-20090303100929-p4w2995k61yhxws2
4940 1235 stbuehler@web.de-20090307135056-02q8f6l1e5jehu9y
4941 1236 stbuehler@web.de-20090307135805-z488kad68sgcjtzz
4942
4943    + 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
4944 1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
4945 1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
4946 1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
4947 1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
4948 1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
4949 1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
4950 1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
4951 1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
4952 1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
4953 1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
4954 1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
4955 1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
4956 1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
4957 1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
4958 1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
4959 1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
4960 1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
4961 1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
4962 1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
4963 1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
4964 1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
4965 1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
4966 1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
4967 1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
4968 1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
4969 1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
4970 1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
4971 1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
4972 1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
4973 1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
4974 1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
4975 1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
4976 1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
4977 1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
4978 1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
4979 1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
4980 1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
4981 1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
4982 1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
4983 1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
4984 1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
4985 1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
4986 1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
4987 1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
4988 1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
4989 1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
4990 1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
4991 1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
4992 1176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
4993 1177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
4994 1178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
4995 1179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
4996 1180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
4997 1181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
4998 1182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
4999 1183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
5000 1184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
5001 1185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
5002 1186 stbuehler@web.de-20081001200802-l5og517etnneitk0
5003 1188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
5004 1189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
5005 1191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
5006 1192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
5007 1193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
5008 1195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
5009 1196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
5010 1197 stbuehler@web.de-20081016121114-65quosenmso8frf8
5011 1198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
5012 1199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
5013 1200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
5014 1201 stbuehler@web.de-20081205233903-708beaujtf26gprx
5015 1202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
5016 1203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
5017 1204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
5018 1205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
5019 1206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
5020 1208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
5021 1209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
5022 1210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
5023 1211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
5024 1212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
5025 1213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
5026 1214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
5027 1215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
5028 1216 stbuehler@web.de-20090205105134-6i5key9439wspueq
5029 1217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
5030 1218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3
5031 1219 stbuehler@web.de-20090205215425-vicbc6hzb3at7gj9
5032 1220 stbuehler@web.de-20090205220741-vqz9l1eui3dwnulq
5033 1221 stbuehler@web.de-20090205222705-8179v6jkv2x38l70
5034 1222 stbuehler@web.de-20090210194631-6epujtpen9xfxx5j
5035 1223 stbuehler@web.de-20090216134207-fg99ikt1ds21hx25
5036 1224 stbuehler@web.de-20090217085833-9g5c7j7zdylvezl5
5037 1225 stbuehler@web.de-20090217133414-y80hydn9raqgkgto
5038 1226 stbuehler@web.de-20090217224447-ve7ns45c9otbgz9h
5039 1227 stbuehler@web.de-20090219130703-117t93t4hr4j0e8d
5040 1228 stbuehler@web.de-20090219130728-m8nui64vin0w95b2
5041 1229 stbuehler@web.de-20090219131550-exi19tbqyd8fpa0d
5042 1230 stbuehler@web.de-20090224133046-toewpee0ybw5tuay
5043 1231 stbuehler@web.de-20090228205351-yqjhutdqf30jr66o
5044 1232 stbuehler@web.de-20090228213824-gnwuf6by8705g6zk
5045 1233 stbuehler@web.de-20090303100525-kamra70ocxpji0l5
5046 1234 stbuehler@web.de-20090303100929-p4w2995k61yhxws2
5047 1235 stbuehler@web.de-20090307135056-02q8f6l1e5jehu9y
5048 1236 stbuehler@web.de-20090307135805-z488kad68sgcjtzz
5049 1237 stbuehler@web.de-20090307154555-xybvl7sxrha6vhds
5050 1238 stbuehler@web.de-20090307204326-10m0681831yvhi3k
5051 1239 stbuehler@web.de-20090307204846-seq3cmzn6dy9927i
5052 1240 stbuehler@web.de-20090307205519-ha3s58fcum106yl0
5053 1241 stbuehler@web.de-20090307210432-jdlv5pp9m519vyv2
5054
5055
This page took 0.664077 seconds and 4 git commands to generate.