]> git.pld-linux.org Git - packages/lighttpd.git/blobdiff - lighttpd-branch.diff
- exclude configure.ac from branch.diff to avoid version bump; rel 7
[packages/lighttpd.git] / lighttpd-branch.diff
index 42747f75569e60d446cfa608d6f1acabea61f293..c9ee19e9c4d51d7924b8eb10ba8cb0f92ffdc883 100644 (file)
-Index: configure.in
+Index: ChangeLog
 ===================================================================
-Index: src/spawn-fcgi.c
+Index: .cvsignore
+===================================================================
+Index: src/.cvsignore
 ===================================================================
---- src/spawn-fcgi.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/spawn-fcgi.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -1,481 +0,0 @@
--#include <sys/types.h>
--#include <sys/time.h>
--#include <sys/stat.h>
--
--#include <stdlib.h>
--#include <string.h>
--#include <errno.h>
--#include <stdio.h>
--#include <unistd.h>
--#include <fcntl.h>
--
--#ifdef HAVE_CONFIG_H
--#include "config.h"
--#endif
--
--
--#ifdef HAVE_PWD_H
--#include <grp.h>
--#include <pwd.h>
--#endif
--
--#ifdef HAVE_GETOPT_H
--#include <getopt.h>
--#endif
--
--#define FCGI_LISTENSOCK_FILENO 0
--
--#include "sys-socket.h"
--
--#ifdef HAVE_SYS_WAIT_H
--#include <sys/wait.h>
--#endif
--
--/* for solaris 2.5 and netbsd 1.3.x */
--#ifndef HAVE_SOCKLEN_T
--typedef int socklen_t;
--#endif
--
--#ifdef HAVE_SYS_UN_H
--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) {
--      int fcgi_fd;
--      int socket_type, status, rc = 0;
--      struct timeval tv = { 0, 100 * 1000 };
--
--      struct sockaddr_un fcgi_addr_un;
--      struct sockaddr_in fcgi_addr_in;
--      struct sockaddr *fcgi_addr;
--
--      socklen_t servlen;
--
--      if (child_count < 2) {
--              child_count = 5;
--      }
--
--      if (child_count > 256) {
--              child_count = 256;
--      }
--
--
--      if (unixsocket) {
--              memset(&fcgi_addr_un, 0, sizeof(fcgi_addr_un));
--
--              fcgi_addr_un.sun_family = AF_UNIX;
--              strcpy(fcgi_addr_un.sun_path, unixsocket);
--
--#ifdef SUN_LEN
--              servlen = SUN_LEN(&fcgi_addr_un);
--#else
--              /* stevens says: */
--              servlen = strlen(fcgi_addr_un.sun_path) + sizeof(fcgi_addr_un.sun_family);
--#endif
--              socket_type = AF_UNIX;
--              fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
--      } else {
--              memset(&fcgi_addr_in, 0, sizeof(fcgi_addr_in));
--              fcgi_addr_in.sin_family = AF_INET;
--              if (addr != NULL) {
--                      fcgi_addr_in.sin_addr.s_addr = inet_addr(addr);
--              } else {
--                      fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
--              }
--              fcgi_addr_in.sin_port = htons(port);
--              servlen = sizeof(fcgi_addr_in);
--
--              socket_type = AF_INET;
--              fcgi_addr = (struct sockaddr *) &fcgi_addr_in;
--      }
--
--      if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
--              fprintf(stderr, "%s.%d\n",
--                      __FILE__, __LINE__);
--              return -1;
--      }
--
--      if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {
--              /* server is not up, spawn in  */
--              pid_t child;
--              int val;
--
--              if (unixsocket) unlink(unixsocket);
--
--              close(fcgi_fd);
--
--              /* reopen socket */
--              if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
--                      fprintf(stderr, "%s.%d\n",
--                              __FILE__, __LINE__);
--                      return -1;
--              }
--
--              val = 1;
--              if (setsockopt(fcgi_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
--                      fprintf(stderr, "%s.%d\n",
--                              __FILE__, __LINE__);
--                      return -1;
--              }
--
--              /* create socket */
--              if (-1 == bind(fcgi_fd, fcgi_addr, servlen)) {
--                      fprintf(stderr, "%s.%d: bind failed: %s\n",
--                              __FILE__, __LINE__,
--                              strerror(errno));
--                      return -1;
--              }
--
--              if (-1 == listen(fcgi_fd, 1024)) {
--                      fprintf(stderr, "%s.%d: fd = -1\n",
--                              __FILE__, __LINE__);
--                      return -1;
--              }
--
--              while (fork_count-- > 0) {
--
--                      if (!nofork) {
--                              child = fork();
--                      } else {
--                              child = 0;
--                      }
--
--                      switch (child) {
--                      case 0: {
--                              char cgi_childs[64];
--                              int max_fd = 0;
--
--                              int i = 0;
--
--                              /* loose control terminal */
--                              setsid();
--
--                              /* is safe as we limit to 256 childs */
--                              sprintf(cgi_childs, "PHP_FCGI_CHILDREN=%d", child_count);
--
--                              if(fcgi_fd != FCGI_LISTENSOCK_FILENO) {
--                                      close(FCGI_LISTENSOCK_FILENO);
--                                      dup2(fcgi_fd, FCGI_LISTENSOCK_FILENO);
--                                      close(fcgi_fd);
--                              }
--
--                              max_fd = open("/dev/null", O_RDWR);
--                              close(STDERR_FILENO);
--                              dup2(max_fd, STDERR_FILENO);
--                              close(max_fd);
--
--                              max_fd = open("/dev/null", O_RDWR);
--                              close(STDOUT_FILENO);
--                              dup2(max_fd, STDOUT_FILENO);
--                              close(max_fd);
--
--                              /* we don't need the client socket */
--                              for (i = 3; i < max_fd; i++) {
--                                      if (i != FCGI_LISTENSOCK_FILENO) close(i);
--                              }
--
--                              /* create environment */
--
--                              putenv(cgi_childs);
--
--                              /* fork and replace shell */
--                              if (appArgv) {
--                                      execv(appArgv[0], appArgv);
--
--                              } else {
--                                      char *b = malloc(strlen("exec ") + strlen(appPath) + 1);
--                                      strcpy(b, "exec ");
--                                      strcat(b, appPath);
--
--                                      /* exec the cgi */
--                                      execl("/bin/sh", "sh", "-c", b, (char *)NULL);
--                              }
--
--                              exit(errno);
--
--                              break;
--                      }
--                      case -1:
--                              /* error */
--                              break;
--                      default:
--                              /* father */
--
--                              /* wait */
--                              select(0, NULL, NULL, NULL, &tv);
--
--                              switch (waitpid(child, &status, WNOHANG)) {
--                              case 0:
--                                      fprintf(stdout, "%s.%d: child spawned successfully: PID: %d\n",
--                                              __FILE__, __LINE__,
--                                              child);
--
--                                      /* write pid file */
--                                      if (pid_fd != -1) {
--                                              /* assume a 32bit pid_t */
--                                              char pidbuf[12];
--
--                                              snprintf(pidbuf, sizeof(pidbuf) - 1, "%d", child);
--
--                                              write(pid_fd, pidbuf, strlen(pidbuf));
--                                              /* avoid eol for the last one */
--                                              if (fork_count != 0) {
--                                                      write(pid_fd, "\n", 1);
--                                              }
--                                      }
--
--                                      break;
--                              case -1:
--                                      break;
--                              default:
--                                      if (WIFEXITED(status)) {
--                                              fprintf(stderr, "%s.%d: child exited with: %d\n",
--                                                      __FILE__, __LINE__, WEXITSTATUS(status));
--                                              rc = WEXITSTATUS(status);
--                                      } else if (WIFSIGNALED(status)) {
--                                              fprintf(stderr, "%s.%d: child signaled: %d\n",
--                                                      __FILE__, __LINE__,
--                                                      WTERMSIG(status));
--                                              rc = 1;
--                                      } else {
--                                              fprintf(stderr, "%s.%d: child died somehow: %d\n",
--                                                      __FILE__, __LINE__,
--                                                      status);
--                                              rc = status;
--                                      }
--                              }
--
--                              break;
--                      }
--              }
--              close(pid_fd);
--              pid_fd = -1;
--      } else {
--              fprintf(stderr, "%s.%d: socket is already used, can't spawn\n",
--                      __FILE__, __LINE__);
--              return -1;
--      }
--
--      close(fcgi_fd);
--
--      return rc;
--}
--
--
--void show_version () {
--      char *b = "spawn-fcgi" "-" PACKAGE_VERSION \
--" - spawns fastcgi processes\n"
--;
--      write(1, b, strlen(b));
--}
--
--void show_help () {
--      char *b = \
--"Usage: spawn-fcgi [options] -- <fcgiapp> [fcgi app arguments]\n" \
--"\n" \
--"spawn-fcgi v" PACKAGE_VERSION " - spawns fastcgi processes\n" \
--"\n" \
--"Options:\n" \
--" -f <fcgiapp> filename of the fcgi-application\n" \
--" -a <addr>    bind to ip address\n" \
--" -p <port>    bind to tcp-port\n" \
--" -s <path>    bind to unix-domain socket\n" \
--" -C <childs>  (PHP only) numbers of childs to spawn (default 5)\n" \
--" -F <childs>  numbers of childs to fork (default 1)\n" \
--" -P <path>    name of PID-file for spawed process\n" \
--" -n           no fork (for daemontools)\n" \
--" -v           show version\n" \
--" -h           show this help\n" \
--"(root only)\n" \
--" -c <dir>     chroot to directory\n" \
--" -u <user>    change to user-id\n" \
--" -g <group>   change to group-id\n" \
--;
--      write(1, b, strlen(b));
--}
--
--
--int main(int argc, char **argv) {
--      char *fcgi_app = NULL, *changeroot = NULL, *username = NULL,
--               *groupname = NULL, *unixsocket = NULL, *pid_file = NULL,
--                *addr = NULL;
--      char **fcgi_app_argv = { NULL };
--      unsigned short port = 0;
--      int child_count = 5;
--      int fork_count = 1;
--      int i_am_root, o;
--      int pid_fd = -1;
--      int nofork = 0;
--      struct sockaddr_un un;
--
--      i_am_root = (getuid() == 0);
--
--      while (-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:F:s:P:"))) {
--              switch(o) {
--              case 'f': fcgi_app = optarg; break;
--              case 'a': addr = optarg;/* ip addr */ break;
--              case 'p': port = strtol(optarg, NULL, 10);/* port */ break;
--              case 'C': child_count = strtol(optarg, NULL, 10);/*  */ break;
--              case 'F': fork_count = strtol(optarg, NULL, 10);/*  */ break;
--              case 's': unixsocket = optarg; /* unix-domain socket */ break;
--              case 'c': if (i_am_root) { changeroot = optarg; }/* chroot() */ break;
--              case 'u': if (i_am_root) { username = optarg; } /* set user */ break;
--              case 'g': if (i_am_root) { groupname = optarg; } /* set group */ break;
--              case 'n': nofork = 1; break;
--              case 'P': pid_file = optarg; /* PID file */ break;
--              case 'v': show_version(); return 0;
--              case 'h': show_help(); return 0;
--              default:
--                      show_help();
--                      return -1;
--              }
--      }
--
--      if (optind < argc) {
--              fcgi_app_argv = &argv[optind];
--      }
--
--      if ((fcgi_app == NULL && fcgi_app_argv == NULL) || (port == 0 && unixsocket == NULL)) {
--              show_help();
--              return -1;
--      }
--
--      if (unixsocket && port) {
--              fprintf(stderr, "%s.%d: %s\n",
--                      __FILE__, __LINE__,
--                      "either a unix domain socket or a tcp-port, but not both\n");
--
--              return -1;
--      }
--
--      if (unixsocket && strlen(unixsocket) > sizeof(un.sun_path) - 1) {
--              fprintf(stderr, "%s.%d: %s\n",
--                      __FILE__, __LINE__,
--                      "path of the unix socket is too long\n");
--
--              return -1;
--      }
--
--      /* UID handling */
--      if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
--              /* we are setuid-root */
--
--              fprintf(stderr, "%s.%d: %s\n",
--                      __FILE__, __LINE__,
--                      "Are you nuts ? Don't apply a SUID bit to this binary\n");
--
--              return -1;
--      }
--
--      if (pid_file &&
--          (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)))) {
--              struct stat st;
--              if (errno != EEXIST) {
--                      fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
--                              __FILE__, __LINE__,
--                              pid_file, strerror(errno));
--
--                      return -1;
--              }
--
--              /* ok, file exists */
--
--              if (0 != stat(pid_file, &st)) {
--                      fprintf(stderr, "%s.%d: stating pid-file '%s' failed: %s\n",
--                              __FILE__, __LINE__,
--                              pid_file, strerror(errno));
--
--                      return -1;
--              }
--
--              /* is it a regular file ? */
--
--              if (!S_ISREG(st.st_mode)) {
--                      fprintf(stderr, "%s.%d: pid-file exists and isn't regular file: '%s'\n",
--                              __FILE__, __LINE__,
--                              pid_file);
--
--                      return -1;
--              }
--
--              if (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) {
--                      fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
--                              __FILE__, __LINE__,
--                              pid_file, strerror(errno));
--
--                      return -1;
--              }
--      }
--
--      if (i_am_root) {
--              struct group *grp = NULL;
--              struct passwd *pwd = NULL;
--
--              /* set user and group */
--
--              if (username) {
--                      if (NULL == (pwd = getpwnam(username))) {
--                              fprintf(stderr, "%s.%d: %s, %s\n",
--                                      __FILE__, __LINE__,
--                                      "can't find username", username);
--                              return -1;
--                      }
--
--                      if (pwd->pw_uid == 0) {
--                              fprintf(stderr, "%s.%d: %s\n",
--                                      __FILE__, __LINE__,
--                                      "I will not set uid to 0\n");
--                              return -1;
--                      }
--              }
--
--              if (groupname) {
--                      if (NULL == (grp = getgrnam(groupname))) {
--                              fprintf(stderr, "%s.%d: %s %s\n",
--                                      __FILE__, __LINE__,
--                                      "can't find groupname",
--                                      groupname);
--                              return -1;
--                      }
--                      if (grp->gr_gid == 0) {
--                              fprintf(stderr, "%s.%d: %s\n",
--                                      __FILE__, __LINE__,
--                                      "I will not set gid to 0\n");
--                              return -1;
--                      }
--
--                      /* do the change before we do the chroot() */
--                      setgid(grp->gr_gid);
--                      setgroups(0, NULL); 
--
--                      if (username) {
--                              initgroups(username, grp->gr_gid);
--                      }
--
--              }
--
--              if (changeroot) {
--                      if (-1 == chroot(changeroot)) {
--                              fprintf(stderr, "%s.%d: %s %s\n",
--                                      __FILE__, __LINE__,
--                                      "chroot failed: ", strerror(errno));
--                              return -1;
--                      }
--                      if (-1 == chdir("/")) {
--                              fprintf(stderr, "%s.%d: %s %s\n",
--                                      __FILE__, __LINE__,
--                                      "chdir failed: ", strerror(errno));
--                              return -1;
--                      }
--              }
--
--              /* drop root privs */
--              if (username) {
--                      setuid(pwd->pw_uid);
--              }
--      }
--
--       return fcgi_spawn_connection(fcgi_app, fcgi_app_argv, addr, port, unixsocket, fork_count, child_count, pid_fd, nofork);
--}
--#else
--int main() {
--      return -1;
--}
--#endif
 Index: src/configfile-glue.c
 ===================================================================
---- src/configfile-glue.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/configfile-glue.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -49,7 +49,7 @@
-                                               buffer_copy_string_buffer(ds->value, ((data_string *)(da->value->data[j]))->value);
-                                               if (!da->is_index_key) {
-                                                       /* the id's were generated automaticly, as we copy now we might have to renumber them
--                                                       * this is used to prepend server.modules by mod_indexfiles as it has to be loaded
-+                                                       * this is used to prepend server.modules by mod_indexfile as it has to be loaded
-                                                        * before mod_fastcgi and friends */
-                                                       buffer_copy_string_buffer(ds->key, ((data_string *)(da->value->data[j]))->key);
-                                               }
-@@ -181,7 +181,7 @@
-       return config_insert_values_internal(srv, ca, cv);
- }
+--- src/configfile-glue.c      (.../tags/lighttpd-1.4.23)
++++ src/configfile-glue.c      (.../branches/lighttpd-1.4.x)
+@@ -103,7 +103,6 @@
+                                       if (e != ds->value->ptr && !*e && l >=0 && l <= 65535) {
+                                               *((unsigned short *)(cv[i].destination)) = l;
+                                               break;
+-
+                                       }
+                               }
  
--unsigned short sock_addr_get_port(sock_addr *addr) {
-+static unsigned short sock_addr_get_port(sock_addr *addr) {
- #ifdef HAVE_IPV6
-       return ntohs(addr->plain.sa_family ? addr->ipv6.sin6_port : addr->ipv4.sin_port);
- #else
+@@ -112,10 +111,40 @@
+                               return -1;
+                       }
+                       default:
+-                              log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected a integer, range 0 ... 65535");
++                              log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected a short integer, range 0 ... 65535");
+                               return -1;
+                       }
+                       break;
++              case T_CONFIG_INT:
++                      switch(du->type) {
++                      case TYPE_INTEGER: {
++                              data_integer *di = (data_integer *)du;
++
++                              *((unsigned int *)(cv[i].destination)) = di->value;
++                              break;
++                      }
++                      case TYPE_STRING: {
++                              data_string *ds = (data_string *)du;
++
++                              if (ds->value->ptr && *ds->value->ptr) {
++                                      char *e;
++                                      long l = strtol(ds->value->ptr, &e, 10);
++                                      if (e != ds->value->ptr && !*e && l >= 0) {
++                                              *((unsigned int *)(cv[i].destination)) = l;
++                                              break;
++                                      }
++                              }
++
++
++                              log_error_write(srv, __FILE__, __LINE__, "ssb", "got a string but expected an integer:", cv[i].key, ds->value);
++
++                              return -1;
++                      }
++                      default:
++                              log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected an integer, range 0 ... 4294967295");
++                              return -1;
++                      }
++                      break;
+               case T_CONFIG_BOOLEAN:
+                       if (du->type == TYPE_STRING) {
+                               data_string *ds = (data_string *)du;
 Index: src/mod_cgi.c
 ===================================================================
---- src/mod_cgi.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_cgi.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -24,6 +24,7 @@
- #include <fcntl.h>
- #include "server.h"
-+#include "stat_cache.h"
- #include "keyvalue.h"
- #include "log.h"
- #include "connections.h"
-@@ -36,6 +37,8 @@
- # include <sys/filio.h>
- #endif
+--- src/mod_cgi.c      (.../tags/lighttpd-1.4.23)
++++ src/mod_cgi.c      (.../branches/lighttpd-1.4.x)
+@@ -56,6 +56,7 @@
  
-+#include "version.h"
-+
- enum {EOL_UNSET, EOL_N, EOL_RN};
+ typedef struct {
+       array *cgi;
++      unsigned short execute_x_only;
+ } plugin_config;
  
  typedef struct {
-@@ -776,25 +779,23 @@
-               /* not needed */
-               close(to_cgi_fds[1]);
--              /* HACK:
--               * this is not nice, but it works
--               *
--               * we feed the stderr of the CGI to our errorlog, if possible
--               */
--              if (srv->errorlog_mode == ERRORLOG_FILE) {
--                      close(STDERR_FILENO);
--                      dup2(srv->errorlog_fd, STDERR_FILENO);
--              }
--
-               /* create environment */
-               env.ptr = NULL;
-               env.size = 0;
-               env.used = 0;
--              cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
-+              if (buffer_is_empty(con->conf.server_tag)) {
-+                      cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
-+              } else {
-+                      cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
-+              }
+@@ -151,6 +152,7 @@
  
-               if (!buffer_is_empty(con->server_name)) {
--                      cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
-+                      size_t len = con->server_name->used - 1;
-+                      char *colon = strchr(con->server_name->ptr, ':');
-+                      if (colon) len = colon - con->server_name->ptr;
-+
-+                      cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
-               } else {
- #ifdef HAVE_IPV6
-                       s = inet_ntop(srv_sock->addr.plain.sa_family,
-@@ -1203,6 +1204,7 @@
-       size_t k, s_len;
-       plugin_data *p = p_d;
-       buffer *fn = con->physical.path;
-+      stat_cache_entry *sce = NULL;
+       config_values_t cv[] = {
+               { "cgi.assign",                  NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },       /* 0 */
++              { "cgi.execute-x-only",          NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },     /* 1 */
+               { NULL,                          NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET}
+       };
  
-       if (con->mode != DIRECT) return HANDLER_GO_ON;
+@@ -165,8 +167,10 @@
+               assert(s);
  
-@@ -1210,6 +1212,9 @@
+               s->cgi    = array_init();
++              s->execute_x_only = 0;
  
-       mod_cgi_patch_connection(srv, con, p);
+               cv[0].destination = s->cgi;
++              cv[1].destination = &(s->execute_x_only);
  
-+      if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) return HANDLER_GO_ON;
-+      if (!S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
-+
-       s_len = fn->used - 1;
+               p->config_storage[i] = s;
  
-       for (k = 0; k < p->conf.cgi->used; k++) {
-@@ -1369,6 +1374,7 @@
- }
+@@ -580,12 +584,9 @@
+ #if 0
+                               log_error_write(srv, __FILE__, __LINE__, "sd", "(debug) cgi exited fine, pid:", pid);
+ #endif
+-                              pid = 0;
+-
+                               return HANDLER_GO_ON;
+                       } else {
+                               log_error_write(srv, __FILE__, __LINE__, "sd", "cgi died, pid:", pid);
+-                              pid = 0;
+                               return HANDLER_GO_ON;
+                       }
+               }
+@@ -1005,7 +1006,7 @@
+                       args[i++] = cgi_handler->ptr;
+               }
+               args[i++] = con->physical.path->ptr;
+-              args[i++] = NULL;
++              args[i  ] = NULL;
+               /* search for the last / */
+               if (NULL != (c = strrchr(con->physical.path->ptr, '/'))) {
+@@ -1018,8 +1019,6 @@
+                       *c = '/';
+               }
  
+-              openDevNull(STDERR_FILENO);
+-
+               /* we don't need the client socket */
+               for (i = 3; i < 256; i++) {
+                       if (i != srv->errorlog_fd) close(i);
+@@ -1198,6 +1197,8 @@
  
-+int mod_cgi_plugin_init(plugin *p);
- int mod_cgi_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("cgi");
-Index: src/mod_cml.c
-===================================================================
---- src/mod_cml.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_cml.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -178,7 +178,7 @@
- }
- #undef PATCH
+                       if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.assign"))) {
+                               PATCH(cgi);
++                      } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.execute-x-only"))) {
++                              PATCH(execute_x_only);
+                       }
+               }
+       }
+@@ -1220,6 +1221,7 @@
  
--int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
-+static int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
-       buffer *b;
-       char *c;
+       if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) return HANDLER_GO_ON;
+       if (!S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
++      if (p->conf.execute_x_only == 1 && (sce->st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0) return HANDLER_GO_ON;
  
-@@ -305,6 +305,7 @@
-       }
- }
+       s_len = fn->used - 1;
  
-+int mod_cml_plugin_init(plugin *p);
- int mod_cml_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("cache");
-Index: src/mod_secure_download.c
+Index: src/network_write.c
 ===================================================================
---- src/mod_secure_download.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_secure_download.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -138,7 +138,7 @@
-  * @return if the supplied string is a valid MD5 string 1 is returned otherwise 0
-  */
+--- src/network_write.c        (.../tags/lighttpd-1.4.23)
++++ src/network_write.c        (.../branches/lighttpd-1.4.x)
+@@ -46,15 +46,27 @@
+                       toSend = c->mem->used - 1 - c->offset;
+ #ifdef __WIN32
+                       if ((r = send(fd, offset, toSend, 0)) < 0) {
+-                              log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed: ", strerror(errno), fd);
++                              /* no error handling for windows... */
++                              log_error_write(srv, __FILE__, __LINE__, "ssd", "send failed: ", strerror(errno), fd);
  
--int is_hex_len(const char *str, size_t len) {
-+static int is_hex_len(const char *str, size_t len) {
-       size_t i;
+                               return -1;
+                       }
+ #else
+                       if ((r = write(fd, offset, toSend)) < 0) {
+-                              log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed: ", strerror(errno), fd);
++                              switch (errno) {
++                              case EAGAIN:
++                              case EINTR:
++                                      r = 0;
++                                      break;
++                              case EPIPE:
++                              case ECONNRESET:
++                                      return -2;
++                              default:
++                                      log_error_write(srv, __FILE__, __LINE__, "ssd",
++                                              "write failed:", strerror(errno), fd);
  
-       if (NULL == str) return 0;
-@@ -293,6 +293,7 @@
+-                              return -1;
++                                      return -1;
++                              }
+                       }
+ #endif
  
- /* this function is called at dlopen() time and inits the callbacks */
+@@ -98,7 +110,7 @@
+                               return -1;
+                       }
  
-+int mod_secdownload_plugin_init(plugin *p);
- int mod_secdownload_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("secdownload");
-Index: src/base.h
-===================================================================
---- src/base.h (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/base.h (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -183,11 +183,15 @@
- } response;
+-#if defined USE_MMAP
++#ifdef USE_MMAP
+                       if (MAP_FAILED == (p = mmap(0, sce->st.st_size, PROT_READ, MAP_SHARED, ifd, 0))) {
+                               log_error_write(srv, __FILE__, __LINE__, "ss", "mmap failed: ", strerror(errno));
  
- typedef struct {
--      buffer *scheme;
-+      buffer *scheme; /* scheme without colon or slashes ( "http" or "https" ) */
-+
-+      /* authority with optional portnumber ("site.name" or "site.name:8080" ) NOTE: without "username:password@" */
-       buffer *authority;
+@@ -109,13 +121,26 @@
+                       close(ifd);
+                       if ((r = write(fd, p + offset, toSend)) <= 0) {
+-                              log_error_write(srv, __FILE__, __LINE__, "ss", "write failed: ", strerror(errno));
+-                              munmap(p, sce->st.st_size);
+-                              return -1;
++                              switch (errno) {
++                              case EAGAIN:
++                              case EINTR:
++                                      r = 0;
++                                      break;
++                              case EPIPE:
++                              case ECONNRESET:
++                                      munmap(p, sce->st.st_size);
++                                      return -2;
++                              default:
++                                      log_error_write(srv, __FILE__, __LINE__, "ssd",
++                                              "write failed:", strerror(errno), fd);
++                                      munmap(p, sce->st.st_size);
++
++                                      return -1;
++                              }
+                       }
+                       munmap(p, sce->st.st_size);
+-#else
++#else /* USE_MMAP */
+                       buffer_prepare_copy(srv->tmp_buf, toSend);
+                       lseek(ifd, offset, SEEK_SET);
+@@ -127,12 +152,33 @@
+                       }
+                       close(ifd);
+-                      if (-1 == (r = send(fd, srv->tmp_buf->ptr, toSend, 0))) {
+-                              log_error_write(srv, __FILE__, __LINE__, "ss", "write: ", strerror(errno));
++#ifdef __WIN32
++                      if ((r = send(fd, srv->tmp_buf->ptr, toSend, 0)) < 0) {
++                              /* no error handling for windows... */
++                              log_error_write(srv, __FILE__, __LINE__, "ssd", "send failed: ", strerror(errno), fd);
+                               return -1;
+                       }
+-#endif
++#else /* __WIN32 */
++                      if ((r = write(fd, srv->tmp_buf->ptr, toSend)) < 0) {
++                              switch (errno) {
++                              case EAGAIN:
++                              case EINTR:
++                                      r = 0;
++                                      break;
++                              case EPIPE:
++                              case ECONNRESET:
++                                      return -2;
++                              default:
++                                      log_error_write(srv, __FILE__, __LINE__, "ssd",
++                                              "write failed:", strerror(errno), fd);
++
++                                      return -1;
++                              }
++                      }
++#endif /* __WIN32 */
++#endif /* USE_MMAP */
 +
-+      /* path including leading slash ("/" or "/index.html") - urldecoded, and sanitized  ( buffer_path_simplify() && buffer_urldecode_path() ) */
-       buffer *path;
--      buffer *path_raw;
--      buffer *query;
-+      buffer *path_raw; /* raw path, as sent from client. no urldecoding or path simplifying */
-+      buffer *query; /* querystring ( everything after "?", ie: in "/index.php?foo=1", query is "foo=1" ) */
- } request_uri;
+                       c->offset += r;
+                       cq->bytes_out += r;
+Index: src/mod_secure_download.c
+===================================================================
+--- src/mod_secure_download.c  (.../tags/lighttpd-1.4.23)
++++ src/mod_secure_download.c  (.../branches/lighttpd-1.4.x)
+@@ -37,7 +37,7 @@
+       buffer *secret;
+       buffer *uri_prefix;
+-      unsigned short timeout;
++      unsigned int timeout;
+ } plugin_config;
  
  typedef struct {
-@@ -533,7 +537,7 @@
+@@ -99,7 +99,7 @@
+               { "secdownload.secret",            NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },       /* 0 */
+               { "secdownload.document-root",     NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },       /* 1 */
+               { "secdownload.uri-prefix",        NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },       /* 2 */
+-              { "secdownload.timeout",           NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },        /* 3 */
++              { "secdownload.timeout",           NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION },        /* 3 */
+               { NULL,                            NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
+       };
+@@ -245,8 +245,8 @@
+       }
+       /* timed-out */
+-      if ( (srv->cur_ts > ts && srv->cur_ts - ts > p->conf.timeout) ||
+-           (srv->cur_ts < ts && ts - srv->cur_ts > p->conf.timeout) ) {
++      if ( (srv->cur_ts > ts && (unsigned int) (srv->cur_ts - ts) > p->conf.timeout) ||
++           (srv->cur_ts < ts && (unsigned int) (ts - srv->cur_ts) > p->conf.timeout) ) {
+               /* "Gone" as the url will never be valid again instead of "408 - Timeout" where the request may be repeated */
+               con->http_status = 410;
+Index: src/base.h
+===================================================================
+--- src/base.h (.../tags/lighttpd-1.4.23)
++++ src/base.h (.../branches/lighttpd-1.4.x)
+@@ -84,6 +84,7 @@
+ typedef enum { T_CONFIG_UNSET,
+               T_CONFIG_STRING,
+               T_CONFIG_SHORT,
++              T_CONFIG_INT,
+               T_CONFIG_BOOLEAN,
+               T_CONFIG_ARRAY,
+               T_CONFIG_LOCAL,
+@@ -281,7 +282,7 @@
+       unsigned short etag_use_mtime;
+       unsigned short etag_use_size;
+       unsigned short force_lowercase_filenames; /* if the FS is case-insensitive, force all files to lower-case */
+-      unsigned short max_request_size;
++      unsigned int max_request_size;
+       unsigned short kbytes_per_second; /* connection kb/s limit */
+@@ -472,6 +473,7 @@
+       buffer *errorlog_file;
+       unsigned short errorlog_use_syslog;
++      buffer *breakagelog_file;
+       unsigned short dont_daemonize;
+       buffer *changeroot;
+@@ -490,7 +492,7 @@
+       unsigned short max_worker;
+       unsigned short max_fds;
+       unsigned short max_conns;
+-      unsigned short max_request_size;
++      unsigned int max_request_size;
+       unsigned short log_request_header_on_error;
+       unsigned short log_state_handling;
+@@ -538,7 +540,7 @@
  
        /* the errorlog */
        int errorlog_fd;
--      enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG } errorlog_mode;
-+      enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
+-      enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
++      enum { ERRORLOG_FILE, ERRORLOG_FD, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
        buffer *errorlog_buf;
  
        fdevents *ev, *ev_ins;
 Index: src/mod_rewrite.c
 ===================================================================
---- src/mod_rewrite.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_rewrite.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -63,7 +63,7 @@
-       free(hctx);
- }
+--- src/mod_rewrite.c  (.../tags/lighttpd-1.4.23)
++++ src/mod_rewrite.c  (.../branches/lighttpd-1.4.x)
+@@ -176,7 +176,7 @@
+       data_unset *du;
  
--rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
-+static rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
-       rewrite_rule_buffer *kvb;
+       if (NULL != (du = array_get_element(ca, option))) {
+-              data_array *da = (data_array *)du;
++              data_array *da;
+               size_t j;
  
-       kvb = calloc(1, sizeof(*kvb));
-@@ -71,7 +71,7 @@
-       return kvb;
- }
+               if (du->type != TYPE_ARRAY) {
+@@ -373,7 +373,7 @@
+                       }
+               } else {
+                       const char **list;
+-                      size_t start, end;
++                      size_t start;
+                       size_t k;
  
--int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
-+static int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
- #ifdef HAVE_PCRE_H
-       size_t i;
-       const char *errptr;
-@@ -121,7 +121,7 @@
- #endif
- }
+                       /* it matched */
+@@ -383,17 +383,15 @@
  
--void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
-+static void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
- #ifdef HAVE_PCRE_H
-       size_t i;
+                       buffer_reset(con->request.uri);
  
-@@ -444,6 +444,7 @@
-       return HANDLER_GO_ON;
- }
+-                      start = 0; end = pattern_len;
++                      start = 0;
+                       for (k = 0; k < pattern_len; k++) {
+                               if (pattern[k] == '$' || pattern[k] == '%') {
+                                       /* got one */
  
-+int mod_rewrite_plugin_init(plugin *p);
- int mod_rewrite_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("rewrite");
-Index: src/connections.c
-===================================================================
---- src/connections.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/connections.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -858,7 +858,7 @@
-  *
-  * we get called by the state-engine and by the fdevent-handler
-  */
--int connection_handle_read_state(server *srv, connection *con)  {
-+static int connection_handle_read_state(server *srv, connection *con)  {
-       connection_state_t ostate = con->state;
-       chunk *c, *last_chunk;
-       off_t last_offset;
-@@ -1156,7 +1156,7 @@
-       return 0;
- }
+                                       size_t num = pattern[k + 1] - '0';
  
--handler_t connection_handle_fdevent(void *s, void *context, int revents) {
-+static handler_t connection_handle_fdevent(void *s, void *context, int revents) {
-       server     *srv = (server *)s;
-       connection *con = context;
+-                                      end = k;
++                                      buffer_append_string_len(con->request.uri, pattern + start, k - start);
  
-Index: src/mod_staticfile.c
+-                                      buffer_append_string_len(con->request.uri, pattern + start, end - start);
+-
+                                       if (!isdigit((unsigned char)pattern[k + 1])) {
+                                               /* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
+                                               buffer_append_string_len(con->request.uri, pattern+k, pattern[k] == pattern[k+1] ? 1 : 2);
+Index: src/connections.c
 ===================================================================
---- src/mod_staticfile.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_staticfile.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -532,6 +532,7 @@
- /* this function is called at dlopen() time and inits the callbacks */
+--- src/connections.c  (.../tags/lighttpd-1.4.23)
++++ src/connections.c  (.../branches/lighttpd-1.4.x)
+@@ -782,13 +782,13 @@
+       CLEAN(request.pathinfo);
+       CLEAN(request.request);
+-      CLEAN(request.orig_uri);
++      /* CLEAN(request.orig_uri); */
+       CLEAN(uri.scheme);
+-      CLEAN(uri.authority);
+-      CLEAN(uri.path);
++      /* CLEAN(uri.authority); */
++      /* CLEAN(uri.path); */
+       CLEAN(uri.path_raw);
+-      CLEAN(uri.query);
++      /* CLEAN(uri.query); */
+       CLEAN(physical.doc_root);
+       CLEAN(physical.path);
+@@ -1401,6 +1401,11 @@
+                                               "state for fd", con->fd, connection_get_state(con->state));
+                       }
  
-+int mod_staticfile_plugin_init(plugin *p);
- int mod_staticfile_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("staticfile");
-Index: src/mod_alias.c
++                      buffer_reset(con->uri.authority);
++                      buffer_reset(con->uri.path);
++                      buffer_reset(con->uri.query);
++                      buffer_reset(con->request.orig_uri);
++
+                       if (http_request_parse(srv, con)) {
+                               /* we have to read some data from the POST request */
+@@ -1725,7 +1730,7 @@
+                               case HANDLER_FINISHED:
+                                       break;
+                               default:
+-                                      log_error_write(srv, __FILE__, __LINE__, "");
++                                      log_error_write(srv, __FILE__, __LINE__, "sd", "unhandling return value", r);
+                                       break;
+                               }
+                               break;
+Index: src/network.c
 ===================================================================
---- src/mod_alias.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_alias.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -187,6 +187,7 @@
+--- src/network.c      (.../tags/lighttpd-1.4.23)
++++ src/network.c      (.../branches/lighttpd-1.4.x)
+@@ -90,6 +90,7 @@
  
- /* this function is called at dlopen() time and inits the callbacks */
+       srv_socket = calloc(1, sizeof(*srv_socket));
+       srv_socket->fd = -1;
++      srv_socket->fde_ndx = -1;
  
-+int mod_alias_plugin_init(plugin *p);
- int mod_alias_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("alias");
-Index: src/network.c
-===================================================================
---- src/network.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/network.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -26,7 +26,7 @@
- # include <openssl/rand.h>
- #endif
+       srv_socket->srv_token = buffer_init();
+       buffer_copy_string_buffer(srv_socket->srv_token, host_token);
+@@ -103,7 +104,7 @@
+       if (NULL == (sp = strrchr(b->ptr, ':'))) {
+               log_error_write(srv, __FILE__, __LINE__, "sb", "value of $SERVER[\"socket\"] has to be \"ip:port\".", b);
  
--handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
-+static handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
-       server     *srv = (server *)s;
-       server_socket *srv_socket = (server_socket *)context;
-       connection *con;
-@@ -62,7 +62,7 @@
-       return HANDLER_GO_ON;
- }
+-              return -1;
++              goto error_free_socket;
+       }
  
--int network_server_init(server *srv, buffer *host_token, specific_config *s) {
-+static int network_server_init(server *srv, buffer *host_token, specific_config *s) {
-       int val;
-       socklen_t addr_len;
-       server_socket *srv_socket;
-Index: src/mod_trigger_b4_dl.c
-===================================================================
---- src/mod_trigger_b4_dl.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_trigger_b4_dl.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -576,6 +576,7 @@
+       host = b->ptr;
+@@ -126,7 +127,7 @@
+       } else if (port == 0 || port > 65535) {
+               log_error_write(srv, __FILE__, __LINE__, "sd", "port out of range:", port);
  
- /* this function is called at dlopen() time and inits the callbacks */
+-              return -1;
++              goto error_free_socket;
+       }
  
-+int mod_trigger_b4_dl_plugin_init(plugin *p);
- int mod_trigger_b4_dl_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("trigger_b4_dl");
-Index: src/mod_evhost.c
-===================================================================
---- src/mod_evhost.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_evhost.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -318,6 +318,7 @@
-       return HANDLER_GO_ON;
- }
+       if (*host == '\0') host = NULL;
+@@ -138,12 +139,12 @@
  
-+int mod_evhost_plugin_init(plugin *p);
- int mod_evhost_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name                    = buffer_init_string("evhost");
-Index: src/splaytree.c
-===================================================================
---- src/splaytree.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/splaytree.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -187,7 +187,8 @@
-     }
- }
+               if (-1 == (srv_socket->fd = socket(srv_socket->addr.plain.sa_family, SOCK_STREAM, 0))) {
+                       log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed:", strerror(errno));
+-                      return -1;
++                      goto error_free_socket;
+               }
+ #else
+               log_error_write(srv, __FILE__, __LINE__, "s",
+                               "ERROR: Unix Domain sockets are not supported.");
+-              return -1;
++              goto error_free_socket;
+ #endif
+       }
+@@ -153,7 +154,7 @@
  
--splay_tree *find_rank(int r, splay_tree *t) {
-+#if 0
-+static splay_tree *find_rank(int r, splay_tree *t) {
- /* Returns a pointer to the node in the tree with the given rank.  */
- /* Returns NULL if there is no such node.                          */
- /* Does not change the tree.  To guarantee logarithmic behavior,   */
-@@ -206,5 +207,4 @@
+               if (-1 == (srv_socket->fd = socket(srv_socket->addr.plain.sa_family, SOCK_STREAM, IPPROTO_TCP))) {
+                       log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed:", strerror(errno));
+-                      return -1;
++                      goto error_free_socket;
+               }
+               srv_socket->use_ipv6 = 1;
        }
-     }
- }
--
--
+@@ -163,17 +164,22 @@
+               srv_socket->addr.plain.sa_family = AF_INET;
+               if (-1 == (srv_socket->fd = socket(srv_socket->addr.plain.sa_family, SOCK_STREAM, IPPROTO_TCP))) {
+                       log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed:", strerror(errno));
+-                      return -1;
++                      goto error_free_socket;
+               }
+       }
++#ifdef FD_CLOEXEC
++      /* set FD_CLOEXEC now, fdevent_fcntl_set is called later; needed for pipe-logger forks */
++      fcntl(srv_socket->fd, F_SETFD, FD_CLOEXEC);
 +#endif
-Index: src/chunk.h
-===================================================================
---- src/chunk.h        (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/chunk.h        (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -3,6 +3,7 @@
++
+       /* */
+       srv->cur_fds = srv_socket->fd;
  
- #include "buffer.h"
- #include "array.h"
-+#include "sys-mmap.h"
+       val = 1;
+       if (setsockopt(srv_socket->fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
+               log_error_write(srv, __FILE__, __LINE__, "ss", "socketsockopt failed:", strerror(errno));
+-              return -1;
++              goto error_free_socket;
+       }
  
- typedef struct chunk {
-       enum { UNUSED_CHUNK, MEM_CHUNK, FILE_CHUNK } type;
-Index: src/etag.c
-===================================================================
---- src/etag.c (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/etag.c (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -44,7 +44,7 @@
-       size_t i;
-       uint32_t h;
+       switch(srv_socket->addr.plain.sa_family) {
+@@ -198,7 +204,7 @@
+                                               "sssss", "getaddrinfo failed: ",
+                                               gai_strerror(r), "'", host, "'");
  
--      for (h=0, i=0; i < etag->used; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
-+      for (h=0, i=0; i < etag->used-1; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
+-                              return -1;
++                              goto error_free_socket;
+                       }
  
-       buffer_reset(mut);
-       buffer_copy_string_len(mut, CONST_STR_LEN("\""));
-Index: src/mod_scgi.c
-===================================================================
---- src/mod_scgi.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_scgi.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -38,6 +38,8 @@
- #include <sys/wait.h>
- #endif
+                       memcpy(&(srv_socket->addr), res->ai_addr, res->ai_addrlen);
+@@ -220,17 +226,17 @@
+                               log_error_write(srv, __FILE__, __LINE__,
+                                               "sds", "gethostbyname failed: ",
+                                               h_errno, host);
+-                              return -1;
++                              goto error_free_socket;
+                       }
  
-+#include "version.h"
-+
- enum {EOL_UNSET, EOL_N, EOL_RN};
+                       if (he->h_addrtype != AF_INET) {
+                               log_error_write(srv, __FILE__, __LINE__, "sd", "addr-type != AF_INET: ", he->h_addrtype);
+-                              return -1;
++                              goto error_free_socket;
+                       }
+                       if (he->h_length != sizeof(struct in_addr)) {
+                               log_error_write(srv, __FILE__, __LINE__, "sd", "addr-length != sizeof(in_addr): ", he->h_length);
+-                              return -1;
++                              goto error_free_socket;
+                       }
  
- /*
-@@ -372,7 +374,7 @@
-       free(hctx);
- }
+                       memcpy(&(srv_socket->addr.ipv4.sin_addr.s_addr), he->h_addr_list[0], he->h_length);
+@@ -260,7 +266,7 @@
+                               host);
  
--scgi_proc *scgi_process_init() {
-+static scgi_proc *scgi_process_init() {
-       scgi_proc *f;
  
-       f = calloc(1, sizeof(*f));
-@@ -384,7 +386,7 @@
-       return f;
- }
+-                      return -1;
++                      goto error_free_socket;
+               }
  
--void scgi_process_free(scgi_proc *f) {
-+static void scgi_process_free(scgi_proc *f) {
-       if (!f) return;
+               /* connect failed */
+@@ -275,14 +281,12 @@
+                               "testing socket failed:",
+                               host, strerror(errno));
  
-       scgi_process_free(f->next);
-@@ -394,7 +396,7 @@
-       free(f);
- }
+-                      return -1;
++                      goto error_free_socket;
+               }
  
--scgi_extension_host *scgi_host_init() {
-+static scgi_extension_host *scgi_host_init() {
-       scgi_extension_host *f;
+               break;
+       default:
+-              addr_len = 0;
+-
+-              return -1;
++              goto error_free_socket;
+       }
  
-       f = calloc(1, sizeof(*f));
-@@ -409,7 +411,7 @@
-       return f;
- }
+       if (0 != bind(srv_socket->fd, (struct sockaddr *) &(srv_socket->addr), addr_len)) {
+@@ -298,12 +302,12 @@
+                                       host, port, strerror(errno));
+                       break;
+               }
+-              return -1;
++              goto error_free_socket;
+       }
  
--void scgi_host_free(scgi_extension_host *h) {
-+static void scgi_host_free(scgi_extension_host *h) {
-       if (!h) return;
+       if (-1 == listen(srv_socket->fd, 128 * 8)) {
+               log_error_write(srv, __FILE__, __LINE__, "ss", "listen failed: ", strerror(errno));
+-              return -1;
++              goto error_free_socket;
+       }
  
-       buffer_free(h->host);
-@@ -426,7 +428,7 @@
+       if (s->is_ssl) {
+@@ -316,14 +320,14 @@
+                       if (0 == RAND_status()) {
+                               log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+                                               "not enough entropy in the pool");
+-                              return -1;
++                              goto error_free_socket;
+                       }
+               }
  
- }
+               if (NULL == (s->ssl_ctx = SSL_CTX_new(SSLv23_server_method()))) {
+                       log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+                                       ERR_error_string(ERR_get_error(), NULL));
+-                      return -1;
++                      goto error_free_socket;
+               }
  
--scgi_exts *scgi_extensions_init() {
-+static scgi_exts *scgi_extensions_init() {
-       scgi_exts *f;
+               if (!s->ssl_use_sslv2) {
+@@ -331,7 +335,7 @@
+                       if (SSL_OP_NO_SSLv2 != SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv2)) {
+                               log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+                                               ERR_error_string(ERR_get_error(), NULL));
+-                              return -1;
++                              goto error_free_socket;
+                       }
+               }
  
-       f = calloc(1, sizeof(*f));
-@@ -434,7 +436,7 @@
-       return f;
- }
+@@ -340,33 +344,33 @@
+                       if (SSL_CTX_set_cipher_list(s->ssl_ctx, s->ssl_cipher_list->ptr) != 1) {
+                               log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+                                               ERR_error_string(ERR_get_error(), NULL));
+-                              return -1;
++                              goto error_free_socket;
+                       }
+               }
  
--void scgi_extensions_free(scgi_exts *f) {
-+static void scgi_extensions_free(scgi_exts *f) {
-       size_t i;
+               if (buffer_is_empty(s->ssl_pemfile)) {
+                       log_error_write(srv, __FILE__, __LINE__, "s", "ssl.pemfile has to be set");
+-                      return -1;
++                      goto error_free_socket;
+               }
  
-       if (!f) return;
-@@ -464,7 +466,7 @@
-       free(f);
- }
+               if (!buffer_is_empty(s->ssl_ca_file)) {
+                       if (1 != SSL_CTX_load_verify_locations(s->ssl_ctx, s->ssl_ca_file->ptr, NULL)) {
+                               log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+                                               ERR_error_string(ERR_get_error(), NULL), s->ssl_ca_file);
+-                              return -1;
++                              goto error_free_socket;
+                       }
+               }
  
--int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
-+static int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
-       scgi_extension *fe;
-       size_t i;
+               if (SSL_CTX_use_certificate_file(s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
+                       log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+                                       ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
+-                      return -1;
++                      goto error_free_socket;
+               }
  
-@@ -1178,7 +1180,7 @@
- }
+               if (SSL_CTX_use_PrivateKey_file (s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
+                       log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+                                       ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
+-                      return -1;
++                      goto error_free_socket;
+               }
  
+               if (SSL_CTX_check_private_key(s->ssl_ctx) != 1) {
+@@ -374,7 +378,7 @@
+                                       "Private key does not match the certificate public key, reason:",
+                                       ERR_error_string(ERR_get_error(), NULL),
+                                       s->ssl_pemfile);
+-                      return -1;
++                      goto error_free_socket;
+               }
+               SSL_CTX_set_default_read_ahead(s->ssl_ctx, 1);
+               SSL_CTX_set_mode(s->ssl_ctx, SSL_CTX_get_mode(s->ssl_ctx) | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+@@ -390,7 +394,7 @@
+               log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+                               "ssl requested but openssl support is not compiled in");
  
--void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
-+static void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
-       plugin_data *p;
-       connection  *con;
+-              return -1;
++              goto error_free_socket;
+ #endif
+ #ifdef TCP_DEFER_ACCEPT
+       } else if (s->defer_accept) {
+@@ -414,7 +418,6 @@
+       }
  
-@@ -1461,10 +1463,18 @@
-       scgi_env_add(p->scgi_env, CONST_STR_LEN("SCGI"), CONST_STR_LEN("1"));
+       srv_socket->is_ssl = s->is_ssl;
+-      srv_socket->fde_ndx = -1;
  
+       if (srv->srv_sockets.size == 0) {
+               srv->srv_sockets.size = 4;
+@@ -430,6 +433,21 @@
+       buffer_free(b);
  
--      scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
-+      if (buffer_is_empty(con->conf.server_tag)) {
-+              scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
-+      } else {
-+              scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
+       return 0;
++
++error_free_socket:
++      if (srv_socket->fd != -1) {
++              /* check if server fd are already registered */
++              if (srv_socket->fde_ndx != -1) {
++                      fdevent_event_del(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd);
++                      fdevent_unregister(srv->ev, srv_socket->fd);
++              }
++
++              close(srv_socket->fd);
 +      }
-       if (con->server_name->used) {
--              scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
-+              size_t len = con->server_name->used - 1;
-+              char *colon = strchr(con->server_name->ptr, ':');
-+              if (colon) len = colon - con->server_name->ptr;
++      buffer_free(srv_socket->srv_token);
++      free(srv_socket);
 +
-+              scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
-       } else {
- #ifdef HAVE_IPV6
-               s = inet_ntop(srv_sock->addr.plain.sa_family,
-@@ -1915,7 +1925,7 @@
++      return -1;
  }
  
+ int network_close(server *srv) {
+@@ -567,12 +585,8 @@
+               /* not our stage */
+               if (COMP_SERVER_SOCKET != dc->comp) continue;
  
--int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
-+static int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
-       scgi_proc *p;
+-              if (dc->cond != CONFIG_COND_EQ) {
+-                      log_error_write(srv, __FILE__, __LINE__, "s", "only == is allowed for $SERVER[\"socket\"].");
++              if (dc->cond != CONFIG_COND_EQ) continue;
  
-       UNUSED(srv);
-@@ -3105,6 +3115,7 @@
- }
-+int mod_scgi_plugin_init(plugin *p);
- int mod_scgi_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name         = buffer_init_string("scgi");
-Index: src/mod_mysql_vhost.c
+-                      return -1;
+-              }
+-
+               /* check if we already know this socket,
+                * if yes, don't init it */
+               for (j = 0; j < srv->srv_sockets.used; j++) {
+Index: src/configfile.c
+===================================================================
+--- src/configfile.c   (.../tags/lighttpd-1.4.23)
++++ src/configfile.c   (.../branches/lighttpd-1.4.x)
+@@ -42,12 +42,12 @@
+               { "server.event-handler",        NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER },      /* 10 */
+               { "server.pid-file",             NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER },      /* 11 */
+-              { "server.max-request-size",     NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },   /* 12 */
++              { "server.max-request-size",     NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION },     /* 12 */
+               { "server.max-worker",           NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER },       /* 13 */
+               { "server.document-root",        NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },  /* 14 */
+-              { "server.force-lowercase-filenames", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },   /* 15 */
++              { "server.force-lowercase-filenames", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },/* 15 */
+               { "debug.log-condition-handling", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },    /* 16 */
+-              { "server.max-keep-alive-requests", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 17 */
++              { "server.max-keep-alive-requests", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },/* 17 */
+               { "server.name",                 NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },  /* 18 */
+               { "server.max-keep-alive-idle",  NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },   /* 19 */
+@@ -91,12 +91,13 @@
+               { "server.core-files",           NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 46 */
+               { "ssl.cipher-list",             NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER },      /* 47 */
+               { "ssl.use-sslv2",               NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 48 */
+-              { "etag.use-inode",              NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
+-              { "etag.use-mtime",              NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
+-              { "etag.use-size",               NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
++              { "etag.use-inode",              NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },     /* 49 */
++              { "etag.use-mtime",              NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },     /* 50 */
++              { "etag.use-size",               NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },     /* 51 */
+               { "server.reject-expect-100-with-417",  NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 52 */
+               { "debug.log-timeouts",          NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 53 */
+-              { "server.defer-accept",         NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },     /* 54 */
++              { "server.defer-accept",         NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },   /* 54 */
++              { "server.breakagelog",          NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER },      /* 55 */
+               { "server.host",                 "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
+               { "server.docroot",              "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
+               { "server.virtual-root",         "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
+@@ -139,6 +140,8 @@
+       cv[43].destination = &(srv->srvconf.max_conns);
+       cv[12].destination = &(srv->srvconf.max_request_size);
+       cv[52].destination = &(srv->srvconf.reject_expect_100_with_417);
++      cv[55].destination = srv->srvconf.breakagelog_file;
++
+       srv->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
+       assert(srv->config_storage);
+@@ -290,6 +293,7 @@
+       PATCH(log_condition_handling);
+       PATCH(log_file_not_found);
+       PATCH(log_ssl_noise);
++      PATCH(log_timeouts);
+       PATCH(range_requests);
+       PATCH(force_lowercase_filenames);
+@@ -1135,15 +1139,15 @@
+                * - select works everywhere
+                * - linux-* are experimental
+                */
++#ifdef USE_LINUX_EPOLL
++              { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
++#endif
+ #ifdef USE_POLL
+               { FDEVENT_HANDLER_POLL,           "poll" },
+ #endif
+ #ifdef USE_SELECT
+               { FDEVENT_HANDLER_SELECT,         "select" },
+ #endif
+-#ifdef USE_LINUX_EPOLL
+-              { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
+-#endif
+ #ifdef USE_LINUX_SIGIO
+               { FDEVENT_HANDLER_LINUX_RTSIG,    "linux-rtsig" },
+ #endif
+Index: src/mod_evhost.c
 ===================================================================
---- src/mod_mysql_vhost.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_mysql_vhost.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -422,6 +422,7 @@
- }
- /* this function is called at dlopen() time and inits the callbacks */
-+int mod_mysql_vhost_plugin_init(plugin *p);
- int mod_mysql_vhost_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name                         = buffer_init_string("mysql_vhost");
-@@ -437,6 +438,7 @@
- }
- #else
- /* we don't have mysql support, this plugin does nothing */
-+int mod_mysql_vhost_plugin_init(plugin *p);
- int mod_mysql_vhost_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name                         = buffer_init_string("mysql_vhost");
-Index: src/request.c
+--- src/mod_evhost.c   (.../tags/lighttpd-1.4.23)
++++ src/mod_evhost.c   (.../branches/lighttpd-1.4.x)
+@@ -213,7 +213,7 @@
+               if (colon != ptr) {
+                       ds = data_string_init();
+                       buffer_copy_string_len(ds->key,CONST_STR_LEN("%"));
+-                      buffer_append_long(ds->key, i++);
++                      buffer_append_long(ds->key, i /* ++ */);
+                       buffer_copy_string_len(ds->value,ptr,colon-ptr);
+                       array_insert_unique(host,(data_unset *)ds);
+@@ -294,10 +294,10 @@
+                               char *colon = strchr(con->uri.authority->ptr, ':');
+                               if(colon == NULL) {
+-                                      buffer_append_string_buffer(p->tmp_buf, con->uri.authority); // adds fqdn
++                                      buffer_append_string_buffer(p->tmp_buf, con->uri.authority); /* adds fqdn */
+                               } else {
+                                       /* strip the port out of the authority-part of the URI scheme */
+-                                      buffer_append_string_len(p->tmp_buf, con->uri.authority->ptr, colon - con->uri.authority->ptr); // adds fqdn
++                                      buffer_append_string_len(p->tmp_buf, con->uri.authority->ptr, colon - con->uri.authority->ptr); /* adds fqdn */
+                               }
+                       } else if (NULL != (ds = (data_string *)array_get_element(parsed_host,p->conf.path_pieces[i]->ptr))) {
+                               if (ds->value->used) {
+Index: src/splaytree.c
 ===================================================================
---- src/request.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/request.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -86,10 +86,18 @@
-       if (host_len == 0) return -1;
-       /* if the hostname ends in a "." strip it */
--      if (host->ptr[host_len-1] == '.') host_len -= 1;
-+      if (host->ptr[host_len-1] == '.') {
-+              /* shift port info one left */
-+              if (NULL != colon) memmove(colon-1, colon, host->used - host_len);
-+              else host->ptr[host_len-1] = '\0';
-+              host_len -= 1;
-+              host->used -= 1;
-+      }
+--- src/splaytree.c    (.../tags/lighttpd-1.4.23)
++++ src/splaytree.c    (.../branches/lighttpd-1.4.x)
+@@ -61,12 +61,11 @@
+  * size fields are maintained */
+ splay_tree * splaytree_splay (splay_tree *t, int i) {
+     splay_tree N, *l, *r, *y;
+-    int comp, root_size, l_size, r_size;
++    int comp, l_size, r_size;
+     if (t == NULL) return t;
+     N.left = N.right = NULL;
+     l = r = &N;
+-    root_size = node_size(t);
+     l_size = r_size = 0;
+     for (;;) {
+Index: src/lemon.c
+===================================================================
+--- src/lemon.c        (.../tags/lighttpd-1.4.23)
++++ src/lemon.c        (.../branches/lighttpd-1.4.x)
+@@ -39,6 +39,12 @@
+ #   endif
+ #endif
  
-+      if (host_len == 0) return -1;
++#if __GNUC__ > 2
++#define NORETURN __attribute__ ((__noreturn__))
++#else
++#define NORETURN
++#endif
 +
-       /* scan from the right and skip the \0 */
--      for (i = host_len - 1; i + 1 > 0; i--) {
-+      for (i = host_len; i-- > 0; ) {
-               const char c = host->ptr[i];
-               switch (stage) {
-@@ -200,7 +208,7 @@
- #define DUMP_HEADER
- #endif
+ /* #define PRIVATE static */
+ #define PRIVATE static
  
--int http_request_split_value(array *vals, buffer *b) {
-+static int http_request_split_value(array *vals, buffer *b) {
-       char *s;
-       size_t i;
-       int state = 0;
-@@ -262,7 +270,7 @@
-       return 0;
- }
+@@ -51,7 +57,7 @@
+ char *msort();
+ extern void *malloc();
  
--int request_uri_is_valid_char(unsigned char c) {
-+static int request_uri_is_valid_char(unsigned char c) {
-       if (c <= 32) return 0;
-       if (c == 127) return 0;
-       if (c == 255) return 0;
-Index: src/mod_magnet_cache.c
-===================================================================
---- src/mod_magnet_cache.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_magnet_cache.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -9,7 +9,7 @@
- #include <lualib.h>
- #include <lauxlib.h>
--script *script_init() {
-+static script *script_init() {
-       script *sc;
-       sc = calloc(1, sizeof(*sc));
-@@ -19,7 +19,7 @@
-       return sc;
- }
+-extern void memory_error();
++extern void memory_error() NORETURN;
  
--void script_free(script *sc) {
-+static void script_free(script *sc) {
-       if (!sc) return;
+ /******** From the file "action.h" *************************************/
+ struct action *Action_new();
+@@ -59,7 +65,7 @@
+ void Action_add();
  
-       lua_pop(sc->L, 1); /* the function copy */
-Index: src/mod_flv_streaming.c
+ /********* From the file "assert.h" ************************************/
+-void myassert();
++void myassert() NORETURN;
+ #ifndef NDEBUG
+ #  define assert(X) if(!(X))myassert(__FILE__,__LINE__)
+ #else
+@@ -1333,7 +1339,7 @@
+ /* Report an out-of-memory condition and abort.  This function
+ ** is used mostly by the "MemoryCheck" macro in struct.h
+ */
+-void memory_error(){
++void memory_error() {
+   fprintf(stderr,"Out of memory.  Aborting...\n");
+   exit(1);
+ }
+@@ -1608,7 +1614,6 @@
+ FILE *err;
+ {
+   int spcnt, i;
+-  spcnt = 0;
+   if( argv[0] ) fprintf(err,"%s",argv[0]);
+   spcnt = strlen(argv[0]) + 1;
+   for(i=1; i<n && argv[i]; i++){
+@@ -2336,6 +2341,7 @@
+   if( filebuf==0 ){
+     ErrorMsg(ps.filename,0,"Can't allocate %d of memory to hold this file.",
+       filesize+1);
++    fclose(fp);
+     gp->errorcnt++;
+     return;
+   }
+@@ -2343,6 +2349,7 @@
+     ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.",
+       filesize);
+     free(filebuf);
++    fclose(fp);
+     gp->errorcnt++;
+     return;
+   }
+@@ -2913,7 +2920,7 @@
+  }else if( sp->destructor ){
+    cp = sp->destructor;
+    fprintf(out,"#line %d \"%s\"\n{",sp->destructorln,lemp->filename);
+- }else if( lemp->vardest ){
++ }else{
+    cp = lemp->vardest;
+    if( cp==0 ) return;
+    fprintf(out,"#line %d \"%s\"\n{",lemp->vardestln,lemp->filename);
+@@ -3042,7 +3049,7 @@
+ int *plineno;               /* Pointer to the line number */
+ int mhflag;                 /* True if generating makeheaders output */
+ {
+-  int lineno = *plineno;    /* The line number of the output */
++  int lineno;               /* The line number of the output */
+   char **types;             /* A hash table of datatypes */
+   int arraysize;            /* Size of the "types" array */
+   int maxdtlength;          /* Maximum length of any ".datatype" field. */
+Index: src/mod_scgi.c
 ===================================================================
---- src/mod_flv_streaming.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_flv_streaming.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -265,6 +265,7 @@
+--- src/mod_scgi.c     (.../tags/lighttpd-1.4.23)
++++ src/mod_scgi.c     (.../branches/lighttpd-1.4.x)
+@@ -331,8 +331,21 @@
  
- /* this function is called at dlopen() time and inits the callbacks */
+ int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *proc);
  
-+int mod_flv_streaming_plugin_init(plugin *p);
- int mod_flv_streaming_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("flv_streaming");
-Index: src/mod_rrdtool.c
-===================================================================
---- src/mod_rrdtool.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_rrdtool.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -91,7 +91,7 @@
-       return HANDLER_GO_ON;
- }
++static void reset_signals(void) {
++#ifdef SIGTTOU
++      signal(SIGTTOU, SIG_DFL);
++#endif
++#ifdef SIGTTIN
++      signal(SIGTTIN, SIG_DFL);
++#endif
++#ifdef SIGTSTP
++      signal(SIGTSTP, SIG_DFL);
++#endif
++      signal(SIGHUP, SIG_DFL);
++      signal(SIGPIPE, SIG_DFL);
++      signal(SIGUSR1, SIG_DFL);
++}
  
--int mod_rrd_create_pipe(server *srv, plugin_data *p) {
-+static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
- #ifdef HAVE_FORK
-       pid_t pid;
+-
+ static handler_ctx * handler_ctx_init() {
+       handler_ctx * hctx;
  
-@@ -230,6 +230,7 @@
+@@ -772,10 +785,8 @@
+                       env.used = 0;
  
- static int mod_rrdtool_create_rrd(server *srv, plugin_data *p, plugin_config *s) {
-       struct stat st;
-+      int r;
+                       if (scgi_fd != 0) {
+-                              close(0);
+                               dup2(scgi_fd, 0);
+                               close(scgi_fd);
+-                              scgi_fd = 0;
+                       }
  
-       /* check if DB already exists */
-       if (0 == stat(s->path_rrd->ptr, &st)) {
-@@ -239,54 +240,57 @@
-                                       "not a regular file:", s->path_rrd);
-                       return HANDLER_ERROR;
-               }
--      } else {
--              int r ;
--              /* create a new one */
-+      }
+                       /* we don't need the client socket */
+@@ -783,8 +794,6 @@
+                               close(fd);
+                       }
  
--              buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
--              buffer_append_string_buffer(p->cmd, s->path_rrd);
--              buffer_append_string_len(p->cmd, CONST_STR_LEN(
--                      " --step 60 "
--                      "DS:InOctets:ABSOLUTE:600:U:U "
--                      "DS:OutOctets:ABSOLUTE:600:U:U "
--                      "DS:Requests:ABSOLUTE:600:U:U "
--                      "RRA:AVERAGE:0.5:1:600 "
--                      "RRA:AVERAGE:0.5:6:700 "
--                      "RRA:AVERAGE:0.5:24:775 "
--                      "RRA:AVERAGE:0.5:288:797 "
--                      "RRA:MAX:0.5:1:600 "
--                      "RRA:MAX:0.5:6:700 "
--                      "RRA:MAX:0.5:24:775 "
--                      "RRA:MAX:0.5:288:797 "
--                      "RRA:MIN:0.5:1:600 "
--                      "RRA:MIN:0.5:6:700 "
--                      "RRA:MIN:0.5:24:775 "
--                      "RRA:MIN:0.5:288:797\n"));
-+      /* still create DB if it's empty file */
-+      if (st.st_size > 0) {
-+              return HANDLER_GO_ON;
-+      }
+-                      openDevNull(STDERR_FILENO);
+-
+                       /* build clean environment */
+                       if (host->bin_env_copy->used) {
+                               for (i = 0; i < host->bin_env_copy->used; i++) {
+@@ -828,6 +837,8 @@
+                       buffer_copy_string_len(b, CONST_STR_LEN("exec "));
+                       buffer_append_string_buffer(b, host->bin_path);
  
--              if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
--                      log_error_write(srv, __FILE__, __LINE__, "ss",
--                              "rrdtool-write: failed", strerror(errno));
-+      /* create a new one */
-+      buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
-+      buffer_append_string_buffer(p->cmd, s->path_rrd);
-+      buffer_append_string_len(p->cmd, CONST_STR_LEN(
-+              " --step 60 "
-+              "DS:InOctets:ABSOLUTE:600:U:U "
-+              "DS:OutOctets:ABSOLUTE:600:U:U "
-+              "DS:Requests:ABSOLUTE:600:U:U "
-+              "RRA:AVERAGE:0.5:1:600 "
-+              "RRA:AVERAGE:0.5:6:700 "
-+              "RRA:AVERAGE:0.5:24:775 "
-+              "RRA:AVERAGE:0.5:288:797 "
-+              "RRA:MAX:0.5:1:600 "
-+              "RRA:MAX:0.5:6:700 "
-+              "RRA:MAX:0.5:24:775 "
-+              "RRA:MAX:0.5:288:797 "
-+              "RRA:MIN:0.5:1:600 "
-+              "RRA:MIN:0.5:6:700 "
-+              "RRA:MIN:0.5:24:775 "
-+              "RRA:MIN:0.5:288:797\n"));
--                      return HANDLER_ERROR;
--              }
-+      if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
-+              log_error_write(srv, __FILE__, __LINE__, "ss",
-+                      "rrdtool-write: failed", strerror(errno));
--              buffer_prepare_copy(p->resp, 4096);
--              if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
--                      log_error_write(srv, __FILE__, __LINE__, "ss",
--                              "rrdtool-read: failed", strerror(errno));
-+              return HANDLER_ERROR;
-+      }
++                      reset_signals();
++
+                       /* exec the cgi */
+                       execle("/bin/sh", "sh", "-c", b->ptr, (char *)NULL, env.ptr);
  
--                      return HANDLER_ERROR;
--              }
-+      buffer_prepare_copy(p->resp, 4096);
-+      if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
-+              log_error_write(srv, __FILE__, __LINE__, "ss",
-+                      "rrdtool-read: failed", strerror(errno));
+@@ -2163,8 +2174,11 @@
+       int ret;
  
--              p->resp->used = r;
+       /* sanity check */
+-      if (!host ||
+-          ((!host->host->used || !host->port) && !host->unixsocket->used)) {
++      if (!host) {
++              log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: host = NULL");
 +              return HANDLER_ERROR;
 +      }
++      if (((!host->host->used || !host->port) && !host->unixsocket->used)) {
+               log_error_write(srv, __FILE__, __LINE__, "sxddd",
+                               "write-req: error",
+                               host,
+@@ -2299,8 +2313,8 @@
+               chunkqueue_remove_finished_chunks(hctx->wb);
+-              if (-1 == ret) {
+-                      if (errno == ENOTCONN) {
++              if (ret < 0) {
++                      if (errno == ENOTCONN || ret == -2) {
+                               /* the connection got dropped after accept()
+                                *
+                                * this is most of the time a PHP which dies
+@@ -2325,24 +2339,17 @@
+                                */
+                               log_error_write(srv, __FILE__, __LINE__, "ssosd",
+-                                              "[REPORT ME] connection was dropped after accept(). reconnect() denied:",
++                                              "connection was dropped after accept(). reconnect() denied:",
+                                               "write-offset:", hctx->wb->bytes_out,
+                                               "reconnect attempts:", hctx->reconnects);
+                               return HANDLER_ERROR;
+-                      }
+-
+-                      if ((errno != EAGAIN) &&
+-                          (errno != EINTR)) {
+-
++                      } else {
++                              /* -1 == ret => error on our side */
+                               log_error_write(srv, __FILE__, __LINE__, "ssd",
+-                                              "write failed:", strerror(errno), errno);
++                                      "write failed:", strerror(errno), errno);
  
--              if (p->resp->ptr[0] != 'O' ||
--                  p->resp->ptr[1] != 'K') {
--                      log_error_write(srv, __FILE__, __LINE__, "sbb",
--                              "rrdtool-response:", p->cmd, p->resp);
-+      p->resp->used = r;
--                      return HANDLER_ERROR;
--              }
-+      if (p->resp->ptr[0] != 'O' ||
-+              p->resp->ptr[1] != 'K') {
-+              log_error_write(srv, __FILE__, __LINE__, "sbb",
-+                      "rrdtool-response:", p->cmd, p->resp);
-+
-+              return HANDLER_ERROR;
-       }
-       return HANDLER_GO_ON;
-@@ -477,6 +481,7 @@
-       return HANDLER_GO_ON;
- }
-+int mod_rrdtool_plugin_init(plugin *p);
- int mod_rrdtool_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("rrd");
-Index: src/stat_cache.c
-===================================================================
---- src/stat_cache.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/stat_cache.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -595,29 +595,31 @@
-       if (S_ISREG(st.st_mode)) {
-               /* determine mimetype */
-               buffer_reset(sce->content_type);
-+#ifdef HAVE_XATTR
-+              if (con->conf.use_xattr) {
-+                      stat_cache_attr_get(sce->content_type, name->ptr);
-+              }
-+#endif
-+              /* xattr did not set a content-type. ask the config */
-+              if (buffer_is_empty(sce->content_type)) {
-+                      for (k = 0; k < con->conf.mimetypes->used; k++) {
-+                              data_string *ds = (data_string *)con->conf.mimetypes->data[k];
-+                              buffer *type = ds->key;
--              for (k = 0; k < con->conf.mimetypes->used; k++) {
--                      data_string *ds = (data_string *)con->conf.mimetypes->data[k];
--                      buffer *type = ds->key;
-+                              if (type->used == 0) continue;
--                      if (type->used == 0) continue;
-+                              /* check if the right side is the same */
-+                              if (type->used > name->used) continue;
--                      /* check if the right side is the same */
--                      if (type->used > name->used) continue;
+                               return HANDLER_ERROR;
+-                      } else {
+-                              fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
 -
--                      if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
--                              buffer_copy_string_buffer(sce->content_type, ds->value);
--                              break;
-+                              if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
-+                                      buffer_copy_string_buffer(sce->content_type, ds->value);
-+                                      break;
-+                              }
+-                              return HANDLER_WAIT_FOR_EVENT;
                        }
                }
--              etag_create(sce->etag, &(sce->st), con->etag_flags);
--#ifdef HAVE_XATTR
--              if (con->conf.use_xattr && buffer_is_empty(sce->content_type)) {
--                      stat_cache_attr_get(sce->content_type, name->ptr);
--              }
--#endif
-+              etag_create(sce->etag, &(sce->st), con->etag_flags);
-       } else if (S_ISDIR(st.st_mode)) {
--              etag_create(sce->etag, &(sce->st), con->etag_flags);
-+              etag_create(sce->etag, &(sce->st), con->etag_flags);
-       }
  
- #ifdef HAVE_FAM_H
-Index: src/response.c
-===================================================================
---- src/response.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/response.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -25,6 +25,7 @@
- #include "plugin.h"
- #include "sys-socket.h"
-+#include "version.h"
- int http_response_write_header(server *srv, connection *con) {
-       buffer *b;
-@@ -104,7 +105,7 @@
-       if (!have_server) {
-               if (buffer_is_empty(con->conf.server_tag)) {
--                      buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_NAME "/" PACKAGE_VERSION));
-+                      buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_DESC));
-               } else if (con->conf.server_tag->used > 1) {
-                       buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: "));
-                       buffer_append_string_encoded(b, CONST_BUF_LEN(con->conf.server_tag), ENCODING_HTTP_HEADER);
-Index: src/SConscript
-===================================================================
---- src/SConscript     (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/SConscript     (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -70,7 +70,7 @@
-       'mod_cml' : {
-               'src' : [ 'mod_cml_lua.c', 'mod_cml.c', 'mod_cml_funcs.c' ],
-               'lib' : [ env['LIBPCRE'], env['LIBMEMCACHE'], env['LIBLUA'], env['LIBLUALIB'] ] },
--      'mod_uploadprogress' : { 'src' : [ 'mod_uploadprogress.c' ] },
-+#     'mod_uploadprogress' : { 'src' : [ 'mod_uploadprogress.c' ] },
-       'mod_evasive' : { 'src' : [ 'mod_evasive.c' ] },
-       'mod_ssi' : { 'src' : [ 'mod_ssi_exprparser.c', 'mod_ssi_expr.c', 'mod_ssi.c' ], 'lib' : [ env['LIBPCRE'] ] },
-       'mod_flv_streaming' : { 'src' : [ 'mod_flv_streaming.c' ] },
-@@ -153,8 +153,6 @@
- instbin = env.Program(bin_targets, src, LINKFLAGS = bin_linkflags, LIBS= [ env['LIBS'], common_lib, env['LIBDL'] ])
- env.Depends(instbin, configparser)
--spawn_fcgi = env.Program("spawn-fcgi", "spawn-fcgi.c")
--
- if env['COMMON_LIB'] == 'bin':
-       common_lib = instbin[1]
+@@ -2469,12 +2476,10 @@
+ }
  
-@@ -168,9 +166,6 @@
+ static handler_t scgi_connection_close(server *srv, handler_ctx *hctx) {
+-      plugin_data *p;
+       connection  *con;
  
- inst = []
+       if (NULL == hctx) return HANDLER_GO_ON;
  
--Default(spawn_fcgi)
--inst += env.Install('${bindir}', spawn_fcgi)
--
- if env['build_dynamic']:
-       Default(instbin[0], instlib)
-       inst += env.Install('${sbindir}', instbin[0])
-Index: src/mod_cml_funcs.c
-===================================================================
---- src/mod_cml_funcs.c        (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_cml_funcs.c        (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -93,7 +93,7 @@
-       return 1;
- }
+-      p    = hctx->plugin_data;
+       con  = hctx->remote_conn;
  
--int f_dir_files_iter(lua_State *L) {
-+static int f_dir_files_iter(lua_State *L) {
-       DIR *d;
-       struct dirent *de;
+       log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+@@ -2724,27 +2729,29 @@
+       /* check if extension matches */
+       for (k = 0; k < p->conf.exts->used; k++) {
+               size_t ct_len;
++              scgi_extension *ext = p->conf.exts->exts[k];
  
-@@ -211,7 +211,7 @@
-       }
+-              extension = p->conf.exts->exts[k];
++              if (ext->key->used == 0) continue;
  
-       if (NULL == (r = mc_aget(mc,
--                               lua_tostring(L, 1), lua_strlen(L, 1)))) {
-+                               (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
+-              if (extension->key->used == 0) continue;
++              ct_len = ext->key->used - 1;
  
-               lua_pushboolean(L, 0);
-               return 1;
-@@ -248,7 +248,7 @@
-       }
+-              ct_len = extension->key->used - 1;
+-
+               if (s_len < ct_len) continue;
  
-       if (NULL == (r = mc_aget(mc,
--                               lua_tostring(L, 1), lua_strlen(L, 1)))) {
-+                               (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
-               lua_pushnil(L);
-               return 1;
-       }
-@@ -285,7 +285,7 @@
+               /* check extension in the form "/scgi_pattern" */
+-              if (*(extension->key->ptr) == '/') {
+-                      if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0)
++              if (*(ext->key->ptr) == '/') {
++                      if (strncmp(fn->ptr, ext->key->ptr, ct_len) == 0) {
++                              extension = ext;
+                               break;
+-              } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
++                      }
++              } else if (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len)) {
+                       /* check extension in the form ".fcg" */
++                      extension = ext;
+                       break;
+               }
        }
  
-       if (NULL == (r = mc_aget(mc,
--                               lua_tostring(L, 1), lua_strlen(L, 1)))) {
-+                               (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
-               lua_pushnil(L);
-               return 1;
+       /* extension doesn't match */
+-      if (k == p->conf.exts->used) {
++      if (NULL == extension) {
+               return HANDLER_GO_ON;
        }
-Index: src/mod_simple_vhost.c
+Index: src/mod_mysql_vhost.c
 ===================================================================
---- src/mod_simple_vhost.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_simple_vhost.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -270,6 +270,7 @@
- }
+--- src/mod_mysql_vhost.c      (.../tags/lighttpd-1.4.23)
++++ src/mod_mysql_vhost.c      (.../branches/lighttpd-1.4.x)
+@@ -259,8 +259,14 @@
  
+ #define FOO(x) (s->x->used ? s->x->ptr : NULL)
  
-+int mod_simple_vhost_plugin_init(plugin *p);
- int mod_simple_vhost_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("simple_vhost");
-Index: src/mod_userdir.c
-===================================================================
---- src/mod_userdir.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_userdir.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -314,6 +314,7 @@
++#if MYSQL_VERSION_ID >= 40100
++                        /* CLIENT_MULTI_STATEMENTS first appeared in 4.1 */ 
+                       if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
++                                              FOO(mydb), s->port, FOO(mysock), CLIENT_MULTI_STATEMENTS)) {
++#else
++                      if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
+                                               FOO(mydb), s->port, FOO(mysock), 0)) {
++#endif
+                               log_error_write(srv, __FILE__, __LINE__, "s", mysql_error(s->mysql));
+                               return HANDLER_ERROR;
+@@ -369,6 +375,9 @@
+       if (!row || cols < 1) {
+               /* no such virtual host */
+               mysql_free_result(result);
++#if MYSQL_VERSION_ID >= 40100
++              while (mysql_next_result(p->conf.mysql) == 0);
++#endif
+               return HANDLER_GO_ON;
+       }
  
- /* this function is called at dlopen() time and inits the callbacks */
+@@ -402,6 +411,9 @@
+               c->fcgi_offset = c->fcgi_arg->used = 0;
+       }
+       mysql_free_result(result);
++#if MYSQL_VERSION_ID >= 40100
++      while (mysql_next_result(p->conf.mysql) == 0);
++#endif
  
-+int mod_userdir_plugin_init(plugin *p);
- int mod_userdir_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("userdir");
-Index: src/mod_proxy.c
-===================================================================
---- src/mod_proxy.c    (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_proxy.c    (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -332,7 +332,7 @@
+       /* fix virtual server and docroot */
+ GO_ON:        buffer_copy_string_buffer(con->server_name, c->server_name);
+@@ -416,6 +428,9 @@
        return HANDLER_GO_ON;
- }
  
--void proxy_connection_close(server *srv, handler_ctx *hctx) {
-+static void proxy_connection_close(server *srv, handler_ctx *hctx) {
-       plugin_data *p;
-       connection *con;
+ ERR500:       if (result) mysql_free_result(result);
++#if MYSQL_VERSION_ID >= 40100
++      while (mysql_next_result(p->conf.mysql) == 0);
++#endif
+       con->http_status = 500; /* Internal Error */
+       con->mode = DIRECT;
+       return HANDLER_FINISHED;
+@@ -424,15 +439,15 @@
+ /* this function is called at dlopen() time and inits the callbacks */
+ int mod_mysql_vhost_plugin_init(plugin *p);
+ int mod_mysql_vhost_plugin_init(plugin *p) {
+-      p->version     = LIGHTTPD_VERSION_ID;
+-      p->name                         = buffer_init_string("mysql_vhost");
++      p->version        = LIGHTTPD_VERSION_ID;
++      p->name           = buffer_init_string("mysql_vhost");
+-      p->init                         = mod_mysql_vhost_init;
+-      p->cleanup                      = mod_mysql_vhost_cleanup;
+-      p->handle_request_done          = mod_mysql_vhost_handle_connection_close;
++      p->init           = mod_mysql_vhost_init;
++      p->cleanup        = mod_mysql_vhost_cleanup;
++      p->connection_reset = mod_mysql_vhost_handle_connection_close;
+-      p->set_defaults                 = mod_mysql_vhost_set_defaults;
+-      p->handle_docroot               = mod_mysql_vhost_handle_docroot;
++      p->set_defaults   = mod_mysql_vhost_set_defaults;
++      p->handle_docroot = mod_mysql_vhost_handle_docroot;
  
-@@ -395,7 +395,7 @@
        return 0;
  }
+@@ -441,7 +456,7 @@
+ int mod_mysql_vhost_plugin_init(plugin *p);
+ int mod_mysql_vhost_plugin_init(plugin *p) {
+       p->version     = LIGHTTPD_VERSION_ID;
+-      p->name                         = buffer_init_string("mysql_vhost");
++      p->name        = buffer_init_string("mysql_vhost");
  
--void proxy_set_header(connection *con, const char *key, const char *value) {
-+static void proxy_set_header(connection *con, const char *key, const char *value) {
-     data_string *ds_dst;
-     if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
-@@ -407,7 +407,7 @@
-     array_insert_unique(con->request.headers, (data_unset *)ds_dst);
- }
--void proxy_append_header(connection *con, const char *key, const char *value) {
-+static void proxy_append_header(connection *con, const char *key, const char *value) {
-     data_string *ds_dst;
-     if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
-@@ -1209,7 +1209,7 @@
-               if (ndx >= (int) extension->value->used) {
-                       /* didn't found a higher id, wrap to the start */
--                      for (ndx = 0; ndx < (int) k; ndx++) {
-+                      for (ndx = 0; ndx <= (int) k; ndx++) {
-                               host = (data_proxy *)extension->value->data[ndx];
-                               if (!host->is_disabled) break;
-                       }
-@@ -1321,6 +1321,7 @@
+       return 0;
  }
-+int mod_proxy_plugin_init(plugin *p);
- int mod_proxy_plugin_init(plugin *p) {
-       p->version      = LIGHTTPD_VERSION_ID;
-       p->name         = buffer_init_string("proxy");
-Index: src/mod_extforward.c
+Index: src/request.c
 ===================================================================
---- src/mod_extforward.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_extforward.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -294,7 +294,7 @@
-       return NULL;
- }
--struct addrinfo *ipstr_to_sockaddr(const char *host)
-+static struct addrinfo *ipstr_to_sockaddr(const char *host)
- {
-    struct addrinfo hints, *res0;
-    int result;
-@@ -479,6 +479,7 @@
- /* this function is called at dlopen() time and inits the callbacks */
+--- src/request.c      (.../tags/lighttpd-1.4.23)
++++ src/request.c      (.../branches/lighttpd-1.4.x)
+@@ -111,7 +111,7 @@
  
-+int mod_extforward_plugin_init(plugin *p);
- int mod_extforward_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("extforward");
-Index: src/Makefile.am
+                                       /* check the first character at right of the dot */
+                                       if (is_ip == 0) {
+-                                              if (!light_isalpha(host->ptr[i+1])) {
++                                              if (!light_isalnum(host->ptr[i+1])) {
+                                                       return -1;
+                                               }
+                                       } else if (!light_isdigit(host->ptr[i+1])) {
+@@ -133,7 +133,7 @@
+                               }
+                       } else if (i == 0) {
+                               /* the first character of the hostname */
+-                              if (!light_isalpha(c)) {
++                              if (!light_isalnum(c)) {
+                                       return -1;
+                               }
+                               label_len++;
+@@ -540,8 +540,8 @@
+               con->response.keep_alive = 0;
+               con->keep_alive = 0;
+-              log_error_write(srv, __FILE__, __LINE__, "s", "no uri specified -> 400");
+               if (srv->srvconf.log_request_header_on_error) {
++                      log_error_write(srv, __FILE__, __LINE__, "s", "no uri specified -> 400");
+                       log_error_write(srv, __FILE__, __LINE__, "Sb",
+                                                       "request-header:\n",
+                                                       con->request.request);
+Index: src/network_backends.h
+===================================================================
+--- src/network_backends.h     (.../tags/lighttpd-1.4.23)
++++ src/network_backends.h     (.../branches/lighttpd-1.4.x)
+@@ -45,6 +45,11 @@
+ #include "base.h"
++/* return values:
++ * >= 0 : chunks completed
++ *   -1 : error (on our side)
++ *   -2 : remote close
++ */
+ int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq);
+ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq);
+Index: src/mod_rrdtool.c
 ===================================================================
---- src/Makefile.am    (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/Makefile.am    (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -2,21 +2,37 @@
- noinst_PROGRAMS=proc_open lemon # simple-fcgi #graphic evalo bench ajp ssl error_test adserver gen-license
- sbin_PROGRAMS=lighttpd lighttpd-angel
--bin_PROGRAMS=spawn-fcgi
- LEMON=$(top_builddir)/src/lemon$(EXEEXT)
- lemon_SOURCES=lemon.c
- lighttpd_angel_SOURCES=lighttpd-angel.c
+--- src/mod_rrdtool.c  (.../tags/lighttpd-1.4.23)
++++ src/mod_rrdtool.c  (.../branches/lighttpd-1.4.x)
+@@ -139,10 +139,8 @@
  
--#simple_fcgi_SOURCES=simple-fcgi.c
--#simple_fcgi_LDADD=-lfcgi
-+.PHONY: versionstamp parsers
+               args[i++] = p->conf.path_rrdtool_bin->ptr;
+               args[i++] = dash;
+-              args[i++] = NULL;
++              args[i  ] = NULL;
  
-+all: versionstamp
-+
-+versionstamp:
-+      @test -f versionstamp.h || touch versionstamp.h; \
-+      REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
-+      if test $$REVISION = "exported"; then \
-+              REVISION="$$(LANG=C cd "$(top_srcdir)"; git describe --always 2>/dev/null)"; \
-+      fi; \
-+      if test -n "$$REVISION"; then \
-+              echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
-+      else \
-+              echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
-+      fi; \
-+      if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
-+              mv versionstamp.h.tmp versionstamp.h; \
-+      else \
-+              rm versionstamp.h.tmp; \
-+      fi
-+
- if CROSS_COMPILING
- configparser.c configparser.h:
- mod_ssi_exprparser.c mod_ssi_exprparser.h:
--.PHONY: parsers
- parsers:
- else
- configparser.h: configparser.c
-@@ -29,12 +45,12 @@
-       rm -f mod_ssi_exprparser.h
-       $(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
--.PHONY: parsers
- parsers: configparser.c mod_ssi_exprparser.c
- endif
- BUILT_SOURCES = parsers
- MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
-+CLEANFILES = versionstamp.h versionstamp.h.tmp
- common_src=buffer.c log.c \
-       keyvalue.c chunk.c  \
-@@ -58,8 +74,6 @@
- src = server.c response.c connections.c network.c \
-       configfile.c configparser.c request.c proc_open.c
--spawn_fcgi_SOURCES=spawn-fcgi.c
+-              openDevNull(STDERR_FILENO);
 -
- lib_LTLIBRARIES =
- if NO_RDYNAMIC
-@@ -259,9 +273,10 @@
-       configparser.h mod_ssi_exprparser.h \
-       sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
-       splaytree.h proc_open.h status_counter.h \
--      mod_magnet_cache.h
-+      mod_magnet_cache.h \
-+      version.h
--DEFS= @DEFS@ -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
-+DEFS= @DEFS@ -DHAVE_VERSION_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
- lighttpd_SOURCES = $(src)
- lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS)
-@@ -287,3 +302,4 @@
- noinst_HEADERS   = $(hdr)
- EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c SConscript
-+
-Index: src/config.h.cmake
-===================================================================
---- src/config.h.cmake (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/config.h.cmake (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -30,6 +30,7 @@
- #cmakedefine HAVE_PTHREAD_H
- #cmakedefine HAVE_INET_ATON
- #cmakedefine HAVE_IPV6
-+#cmakedefine HAVE_ISSETUGID
- /* XATTR */
- #cmakedefine HAVE_ATTR_ATTRIBUTES_H
-Index: src/mod_expire.c
-===================================================================
---- src/mod_expire.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_expire.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -354,6 +354,7 @@
- /* this function is called at dlopen() time and inits the callbacks */
-+int mod_expire_plugin_init(plugin *p);
- int mod_expire_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("expire");
-Index: src/mod_redirect.c
-===================================================================
---- src/mod_redirect.c (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_redirect.c (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -271,6 +271,7 @@
- }
-+int mod_redirect_plugin_init(plugin *p);
- int mod_redirect_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("redirect");
-Index: src/mod_usertrack.c
-===================================================================
---- src/mod_usertrack.c        (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_usertrack.c        (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -255,6 +255,7 @@
+               /* we don't need the client socket */
+               for (i = 3; i < 256; i++) {
+                       close(i);
+@@ -268,7 +266,7 @@
+               "RRA:MIN:0.5:24:775 "
+               "RRA:MIN:0.5:288:797\n"));
  
- /* this function is called at dlopen() time and inits the callbacks */
+-      if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
++      if (-1 == (safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
+               log_error_write(srv, __FILE__, __LINE__, "ss",
+                       "rrdtool-write: failed", strerror(errno));
  
-+int mod_usertrack_plugin_init(plugin *p);
- int mod_usertrack_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("usertrack");
-Index: src/mod_webdav.c
+Index: src/stat_cache.c
 ===================================================================
---- src/mod_webdav.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_webdav.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -1096,7 +1096,7 @@
- }
- #endif
--int webdav_lockdiscovery(server *srv, connection *con,
-+static int webdav_lockdiscovery(server *srv, connection *con,
-               buffer *locktoken, const char *lockscope, const char *locktype, int depth) {
-       buffer *b;
-@@ -1156,7 +1156,7 @@
-  *
-  *
-  */
--int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
-+static int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
-       int has_lock = 1;
+--- src/stat_cache.c   (.../tags/lighttpd-1.4.23)
++++ src/stat_cache.c   (.../branches/lighttpd-1.4.x)
+@@ -503,12 +503,10 @@
+       }
  
- #ifdef USE_LOCKS
-@@ -2474,6 +2474,7 @@
+       if (NULL == sce) {
+-              int osize = 0;
++#ifdef DEBUG_STAT_CACHE
++              int osize = splaytree_size(sc->files);
++#endif
  
- /* this function is called at dlopen() time and inits the callbacks */
+-              if (sc->files) {
+-                      osize = sc->files->size;
+-              }
+-
+               sce = stat_cache_entry_init();
+               buffer_copy_string_buffer(sce->name, name);
  
-+int mod_webdav_plugin_init(plugin *p);
- int mod_webdav_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("webdav");
-Index: src/mod_status.c
+Index: src/response.h
 ===================================================================
---- src/mod_status.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_status.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -18,6 +18,7 @@
- #include "plugin.h"
- #include "inet_ntop_cache.h"
-+#include "version.h"
+--- src/response.h     (.../tags/lighttpd-1.4.23)
++++ src/response.h     (.../branches/lighttpd-1.4.x)
+@@ -10,6 +10,7 @@
  
- typedef struct {
-       buffer *config_url;
-@@ -701,7 +702,7 @@
-                          "  <title>Status</title>\n"
-                          " </head>\n"
-                          " <body>\n"
--                         "  <h1>" PACKAGE_NAME " " PACKAGE_VERSION "</h1>\n"
-+                         "  <h1>" PACKAGE_DESC "</h1>\n"
-                          "  <table summary=\"status\" border=\"1\">\n"));
-       mod_status_header_append(b, "Server-Features");
-@@ -853,6 +854,7 @@
-       return HANDLER_GO_ON;
- }
+ int response_header_insert(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen);
+ int response_header_overwrite(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen);
++int response_header_append(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen);
  
-+int mod_status_plugin_init(plugin *p);
- int mod_status_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("status");
-Index: src/mod_compress.c
+ handler_t http_response_prepare(server *srv, connection *con);
+ int http_response_redirect_to_directory(server *srv, connection *con);
+Index: src/mod_proxy.c
 ===================================================================
---- src/mod_compress.c (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_compress.c (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -104,7 +104,7 @@
- }
- /* 0 on success, -1 for error */
--int mkdir_recursive(char *dir) {
-+static int mkdir_recursive(char *dir) {
-       char *p = dir;
-       if (!dir || !dir[0])
-@@ -126,7 +126,7 @@
- }
- /* 0 on success, -1 for error */
--int mkdir_for_file(char *filename) {
-+static int mkdir_for_file(char *filename) {
-       char *p = filename;
-       if (!filename || !filename[0])
-@@ -815,6 +815,7 @@
-       return HANDLER_GO_ON;
- }
+--- src/mod_proxy.c    (.../tags/lighttpd-1.4.23)
++++ src/mod_proxy.c    (.../branches/lighttpd-1.4.x)
+@@ -756,12 +756,15 @@
  
-+int mod_compress_plugin_init(plugin *p);
- int mod_compress_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("compress");
-Index: src/mod_ssi.c
-===================================================================
---- src/mod_ssi.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_ssi.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -37,6 +37,7 @@
- #endif
+       switch(hctx->state) {
+       case PROXY_STATE_INIT:
++#if defined(HAVE_IPV6) && defined(HAVE_INET_PTON)
+               if (strstr(host->host->ptr,":")) {
+                   if (-1 == (hctx->fd = socket(AF_INET6, SOCK_STREAM, 0))) {
+                       log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
+                       return HANDLER_ERROR;
+                   }
+-              } else {
++              } else
++#endif
++              {
+                   if (-1 == (hctx->fd = socket(AF_INET, SOCK_STREAM, 0))) {
+                       log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
+                       return HANDLER_ERROR;
+@@ -842,17 +845,14 @@
  
- #include "etag.h"
-+#include "version.h"
+               chunkqueue_remove_finished_chunks(hctx->wb);
  
- /* The newest modified time of included files for include statement */
- static volatile time_t include_file_last_mtime = 0;
-@@ -139,7 +140,7 @@
-       return HANDLER_GO_ON;
- }
+-              if (-1 == ret) {
+-                      if (errno != EAGAIN &&
+-                          errno != EINTR) {
+-                              log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno);
++              if (-1 == ret) { /* error on our side */
++                      log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno);
  
--int ssi_env_add(array *env, const char *key, const char *val) {
-+static int ssi_env_add(array *env, const char *key, const char *val) {
-       data_string *ds;
+-                              return HANDLER_ERROR;
+-                      } else {
+-                              fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
++                      return HANDLER_WAIT_FOR_EVENT;
++              } else if (-2 == ret) { /* remote close */
++                      log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed, remote connection close:", strerror(errno), errno);
  
-       if (NULL == (ds = (data_string *)array_get_unused_element(env, TYPE_STRING))) {
-@@ -216,7 +217,7 @@
+-                              return HANDLER_WAIT_FOR_EVENT;
+-                      }
++                      return HANDLER_WAIT_FOR_EVENT;
+               }
  
-       array_reset(p->ssi_cgi_env);
+               if (hctx->wb->bytes_out == hctx->wb->bytes_in) {
+@@ -1107,19 +1107,20 @@
  
--      ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_NAME"/"PACKAGE_VERSION);
-+      ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_DESC);
-       ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_NAME"),
- #ifdef HAVE_IPV6
-                    inet_ntop(srv_sock->addr.plain.sa_family,
-@@ -1125,6 +1126,7 @@
+       /* check if extension matches */
+       for (k = 0; k < p->conf.extensions->used; k++) {
++              data_array *ext = NULL;
+               size_t ct_len;
  
- /* this function is called at dlopen() time and inits the callbacks */
+-              extension = (data_array *)p->conf.extensions->data[k];
++              ext = (data_array *)p->conf.extensions->data[k];
  
-+int mod_ssi_plugin_init(plugin *p);
- int mod_ssi_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("ssi");
-Index: src/mod_auth.c
-===================================================================
---- src/mod_auth.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_auth.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -313,20 +313,20 @@
+-              if (extension->key->used == 0) continue;
++              if (ext->key->used == 0) continue;
  
-       config_values_t cv[] = {
-               { "auth.backend",                   NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
--              { "auth.backend.plain.groupfile",   NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.backend.plain.userfile",    NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.require",                   NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.backend.ldap.hostname",     NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.backend.ldap.base-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.backend.ldap.filter",       NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.backend.ldap.ca-file",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.backend.ldap.starttls",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.backend.ldap.bind-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
-+              { "auth.backend.plain.groupfile",   NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
-+              { "auth.backend.plain.userfile",    NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
-+              { "auth.require",                   NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION },  /* 3 */
-+              { "auth.backend.ldap.hostname",     NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
-+              { "auth.backend.ldap.base-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
-+              { "auth.backend.ldap.filter",       NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
-+              { "auth.backend.ldap.ca-file",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
-+              { "auth.backend.ldap.starttls",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
-+              { "auth.backend.ldap.bind-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
-               { "auth.backend.ldap.bind-pw",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
--              { "auth.backend.ldap.allow-empty-pw",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
--              { "auth.debug",                     NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },  /* 13 */
-+              { "auth.backend.ldap.allow-empty-pw",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
-+              { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
-+              { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
-+              { "auth.debug",                     NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },  /* 14 */
-               { NULL,                             NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
-       };
+-              ct_len = extension->key->used - 1;
++              ct_len = ext->key->used - 1;
  
-@@ -614,6 +614,7 @@
- #endif
- }
+               if (s_len < ct_len) continue;
  
-+int mod_auth_plugin_init(plugin *p);
- int mod_auth_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("auth");
-Index: src/mod_cml_lua.c
-===================================================================
---- src/mod_cml_lua.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_cml_lua.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -105,7 +105,7 @@
- }
+               /* check extension in the form "/proxy_pattern" */
+-              if (*(extension->key->ptr) == '/') {
+-                      if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
++              if (*(ext->key->ptr) == '/') {
++                      if (strncmp(fn->ptr, ext->key->ptr, ct_len) == 0) {
+                               if (s_len > ct_len + 1) {
+                                       char *pi_offset;
  
+@@ -1127,15 +1128,17 @@
+                                               path_info_offset = pi_offset - fn->ptr;
+                                       }
+                               }
++                              extension = ext;
+                               break;
+                       }
+-              } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
++              } else if (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len)) {
+                       /* check extension in the form ".fcg" */
++                      extension = ext;
+                       break;
+               }
+       }
  
--int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
-+static int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
-       size_t is_key = 1;
-       size_t i;
-       char *key = NULL, *val = NULL;
-Index: src/version.h
-===================================================================
---- src/version.h      (.../tags/lighttpd-1.4.22)      (revision 0)
-+++ src/version.h      (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -0,0 +1,12 @@
-+#ifndef _VERSION_H_
-+#define _VERSION_H_
-+
-+#ifdef HAVE_VERSION_H
-+#include "versionstamp.h"
-+#else
-+#define REPO_VERSION ""
-+#endif
-+
-+#define PACKAGE_DESC PACKAGE_NAME "/" PACKAGE_VERSION REPO_VERSION
-+
-+#endif
-Index: src/mod_evasive.c
+-      if (k == p->conf.extensions->used) {
++      if (NULL == extension) {
+               return HANDLER_GO_ON;
+       }
+Index: src/Makefile.am
 ===================================================================
---- src/mod_evasive.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_evasive.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -186,6 +186,7 @@
- }
+--- src/Makefile.am    (.../tags/lighttpd-1.4.23)
++++ src/Makefile.am    (.../branches/lighttpd-1.4.x)
+@@ -13,14 +13,14 @@
+ versionstamp:
+       @test -f versionstamp.h || touch versionstamp.h; \
+       REVISION=""; \
+-      if test -x "`which svnversion`"; then \
+-              REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
++      if test -d "$(top_srcdir)/.svn" -a -x "`which svnversion`"; then \
++              REVISION="$$(LANG= LC_ALL=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
+               if test "$$REVISION" = "exported"; then \
+                       REVISION=""; \
+               fi; \
+       fi; \
+       if test -z "$$REVISION" -a -x "`which git`"; then \
+-              REVISION="$$(cd "$(top_srcdir)"; LANG=C git describe --always 2>/dev/null || echo)"; \
++              REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
+       fi; \
+       if test -n "$$REVISION"; then \
+               echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
+Index: src/mod_expire.c
+===================================================================
+--- src/mod_expire.c   (.../tags/lighttpd-1.4.23)
++++ src/mod_expire.c   (.../branches/lighttpd-1.4.x)
+@@ -342,7 +342,7 @@
+                       buffer_copy_string_len(p->expire_tstmp, CONST_STR_LEN("max-age="));
+                       buffer_append_long(p->expire_tstmp, expires - srv->cur_ts); /* as expires >= srv->cur_ts the difference is >= 0 */
  
+-                      response_header_overwrite(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
++                      response_header_append(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
  
-+int mod_evasive_plugin_init(plugin *p);
- int mod_evasive_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("evasive");
-Index: src/mod_setenv.c
+                       return HANDLER_GO_ON;
+               }
+Index: src/http_auth.c
+===================================================================
+--- src/http_auth.c    (.../tags/lighttpd-1.4.23)
++++ src/http_auth.c    (.../branches/lighttpd-1.4.x)
+@@ -918,15 +918,15 @@
+       char a1[256];
+       char a2[256];
+-      char *username;
+-      char *realm;
+-      char *nonce;
+-      char *uri;
+-      char *algorithm;
+-      char *qop;
+-      char *cnonce;
+-      char *nc;
+-      char *respons;
++      char *username = NULL;
++      char *realm = NULL;
++      char *nonce = NULL;
++      char *uri = NULL;
++      char *algorithm = NULL;
++      char *qop = NULL;
++      char *cnonce = NULL;
++      char *nc = NULL;
++      char *respons = NULL;
+       char *e, *c;
+       const char *m = NULL;
+@@ -967,15 +967,9 @@
+       dkv[6].ptr = &cnonce;
+       dkv[7].ptr = &nc;
+       dkv[8].ptr = &respons;
+-      dkv[9].ptr = NULL;
+       UNUSED(req);
+-      for (i = 0; dkv[i].key; i++) {
+-              *(dkv[i].ptr) = NULL;
+-      }
+-
+-
+       if (p->conf.auth_backend != AUTH_BACKEND_HTDIGEST &&
+           p->conf.auth_backend != AUTH_BACKEND_PLAIN) {
+               log_error_write(srv, __FILE__, __LINE__, "s",
+Index: src/mod_redirect.c
 ===================================================================
---- src/mod_setenv.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_setenv.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -230,6 +230,7 @@
+--- src/mod_redirect.c (.../tags/lighttpd-1.4.23)
++++ src/mod_redirect.c (.../branches/lighttpd-1.4.x)
+@@ -203,7 +203,7 @@
+                       }
+               } else {
+                       const char **list;
+-                      size_t start, end;
++                      size_t start;
+                       size_t k;
  
- /* this function is called at dlopen() time and inits the callbacks */
+                       /* it matched */
+@@ -213,17 +213,15 @@
  
-+int mod_setenv_plugin_init(plugin *p);
- int mod_setenv_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("setenv");
-Index: src/mod_indexfile.c
-===================================================================
---- src/mod_indexfile.c        (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_indexfile.c        (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -206,6 +206,7 @@
+                       buffer_reset(p->location);
  
- /* this function is called at dlopen() time and inits the callbacks */
+-                      start = 0; end = pattern_len;
++                      start = 0;
+                       for (k = 0; k < pattern_len; k++) {
+                               if (pattern[k] == '$' || pattern[k] == '%') {
+                                       /* got one */
  
-+int mod_indexfile_plugin_init(plugin *p);
- int mod_indexfile_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("indexfile");
-Index: src/mod_uploadprogress.c
-===================================================================
---- src/mod_uploadprogress.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_uploadprogress.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -51,7 +51,7 @@
-  */
+                                       size_t num = pattern[k + 1] - '0';
  
- /* init the plugin data */
--connection_map *connection_map_init() {
-+static connection_map *connection_map_init() {
-       connection_map *cm;
+-                                      end = k;
++                                      buffer_append_string_len(p->location, pattern + start, k - start);
  
-       cm = calloc(1, sizeof(*cm));
-@@ -59,7 +59,7 @@
-       return cm;
+-                                      buffer_append_string_len(p->location, pattern + start, end - start);
+-
+                                       if (!isdigit((unsigned char)pattern[k + 1])) {
+                                               /* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
+                                               buffer_append_string_len(p->location, pattern+k, pattern[k] == pattern[k+1] ? 1 : 2);
+Index: src/mod_webdav.c
+===================================================================
+--- src/mod_webdav.c   (.../tags/lighttpd-1.4.23)
++++ src/mod_webdav.c   (.../branches/lighttpd-1.4.x)
+@@ -1096,6 +1096,7 @@
  }
+ #endif
  
--void connection_map_free(connection_map *cm) {
-+static void connection_map_free(connection_map *cm) {
-       size_t i;
-       for (i = 0; i < cm->size; i++) {
-               connection_map_entry *cme = cm->ptr[i];
-@@ -75,7 +75,7 @@
-       free(cm);
- }
++#ifdef USE_LOCKS
+ static int webdav_lockdiscovery(server *srv, connection *con,
+               buffer *locktoken, const char *lockscope, const char *locktype, int depth) {
  
--int connection_map_insert(connection_map *cm, connection *con, buffer *con_id) {
-+static int connection_map_insert(connection_map *cm, connection *con, buffer *con_id) {
-       connection_map_entry *cme;
-       size_t i;
+@@ -1150,6 +1151,8 @@
  
-@@ -108,7 +108,7 @@
        return 0;
  }
++#endif
++
+ /**
+  * check if resource is having the right locks to access to resource
+  *
+Index: src/configparser.y
+===================================================================
+--- src/configparser.y (.../tags/lighttpd-1.4.23)
++++ src/configparser.y (.../branches/lighttpd-1.4.x)
+@@ -72,7 +72,7 @@
+       op1->free(op1);
+       return (data_unset *)ds;
+     } else {
+-      fprintf(stderr, "data type mismatch, cannot be merge\n");
++      fprintf(stderr, "data type mismatch, cannot merge\n");
+       return NULL;
+     }
+   }
+@@ -193,7 +193,6 @@
+     du = configparser_merge_data(du, B);
+     if (NULL == du) {
+       ctx->ok = 0;
+-      du->free(du);
+     }
+     else {
+       buffer_copy_string_buffer(du->key, A);
+@@ -470,7 +469,7 @@
+     case CONFIG_COND_MATCH: {
+ #ifdef HAVE_PCRE_H
+       const char *errptr;
+-      int erroff;
++      int erroff, captures;
+       if (NULL == (dc->regex =
+           pcre_compile(rvalue->ptr, 0, &errptr, &erroff, NULL))) {
+@@ -487,6 +486,14 @@
+         fprintf(stderr, "studying regex failed: %s -> %s\n",
+             rvalue->ptr, errptr);
+         ctx->ok = 0;
++      } else if (0 != (pcre_fullinfo(dc->regex, dc->regex_study, PCRE_INFO_CAPTURECOUNT, &captures))) {
++        fprintf(stderr, "getting capture count for regex failed: %s\n",
++            rvalue->ptr);
++        ctx->ok = 0;
++      } else if (captures > 9) {
++        fprintf(stderr, "Too many captures in regex, use (?:...) instead of (...): %s\n",
++            rvalue->ptr);
++        ctx->ok = 0;
+       } else {
+         dc->string = buffer_init_buffer(rvalue);
+       }
+Index: src/mod_status.c
+===================================================================
+--- src/mod_status.c   (.../tags/lighttpd-1.4.23)
++++ src/mod_status.c   (.../branches/lighttpd-1.4.x)
+@@ -438,7 +438,7 @@
+       buffer_append_string_len(b, CONST_STR_LEN(
+               "<hr />\n<pre><b>legend</b>\n"
+-              ". = connect, C = close, E = hard error\n"
++              ". = connect, C = close, E = hard error, k = keep-alive\n"
+               "r = read, R = read-POST, W = write, h = handle-request\n"
+               "q = request-start,  Q = request-end\n"
+               "s = response-start, S = response-end\n"));
+@@ -449,8 +449,14 @@
+       for (j = 0; j < srv->conns->used; j++) {
+               connection *c = srv->conns->ptr[j];
+-              const char *state = connection_get_short_state(c->state);
++              const char *state;
++              if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
++                      state = "k";
++              } else {
++                      state = connection_get_short_state(c->state);
++              }
++
+               buffer_append_string_len(b, state, 1);
  
--connection *connection_map_get_connection(connection_map *cm, buffer *con_id) {
-+static connection *connection_map_get_connection(connection_map *cm, buffer *con_id) {
-       size_t i;
+               if (((j + 1) % 50) == 0) {
+@@ -497,7 +503,11 @@
+               buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"string\">"));
+-              buffer_append_string(b, connection_get_state(c->state));
++              if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
++                      buffer_append_string_len(b, CONST_STR_LEN("keep-alive"));
++              } else {
++                      buffer_append_string(b, connection_get_state(c->state));
++              }
+               buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"int\">"));
  
-       for (i = 0; i < cm->used; i++) {
-@@ -123,7 +123,7 @@
-       return NULL;
+@@ -611,10 +621,10 @@
  }
  
--int connection_map_remove_connection(connection_map *cm, connection *con) {
-+static int connection_map_remove_connection(connection_map *cm, connection *con) {
+ static handler_t mod_status_handle_server_statistics(server *srv, connection *con, void *p_d) {
+-      plugin_data *p = p_d;
+-      buffer *b = p->module_list;
++      buffer *b;
        size_t i;
+       array *st = srv->status;
++      UNUSED(p_d);
  
-       for (i = 0; i < cm->used; i++) {
-@@ -418,6 +418,7 @@
- /* this function is called at dlopen() time and inits the callbacks */
+       if (0 == st->used) {
+               /* we have nothing to send */
+Index: src/mod_ssi.c
+===================================================================
+--- src/mod_ssi.c      (.../tags/lighttpd-1.4.23)
++++ src/mod_ssi.c      (.../branches/lighttpd-1.4.x)
+@@ -362,7 +362,8 @@
+       switch(ssicmd) {
+       case SSI_ECHO: {
+               /* echo */
+-              int var = 0, enc = 0;
++              int var = 0;
++              /* int enc = 0; */
+               const char *var_val = NULL;
+               stat_cache_entry *sce = NULL;
+@@ -381,6 +382,7 @@
+                       { NULL, SSI_ECHO_UNSET }
+               };
++/*
+               struct {
+                       const char *var;
+                       enum { SSI_ENC_UNSET, SSI_ENC_URL, SSI_ENC_NONE, SSI_ENC_ENTITY } type;
+@@ -391,6 +393,7 @@
+                       { NULL, SSI_ENC_UNSET }
+               };
++*/
+               for (i = 2; i < n; i += 2) {
+                       if (0 == strcmp(l[i], "var")) {
+@@ -405,6 +408,7 @@
+                                       }
+                               }
+                       } else if (0 == strcmp(l[i], "encoding")) {
++/*
+                               int j;
+                               for (j = 0; encvars[j].var; j++) {
+@@ -413,6 +417,7 @@
+                                               break;
+                                       }
+                               }
++*/
+                       } else {
+                               log_error_write(srv, __FILE__, __LINE__, "sss",
+                                               "ssi: unknow attribute for ",
+Index: src/mod_auth.c
+===================================================================
+--- src/mod_auth.c     (.../tags/lighttpd-1.4.23)
++++ src/mod_auth.c     (.../branches/lighttpd-1.4.x)
+@@ -468,7 +468,7 @@
+                       if (method == NULL) {
+                               log_error_write(srv, __FILE__, __LINE__, "ss",
+-                                              "the require field is missing in:",
++                                              "the method field is missing in:",
+                                               "auth.require = ( \"...\" => ( ..., \"method\" => \"...\" ) )");
+                               return HANDLER_ERROR;
+                       } else {
+@@ -483,7 +483,7 @@
+                       if (realm == NULL) {
+                               log_error_write(srv, __FILE__, __LINE__, "ss",
+-                                              "the require field is missing in:",
++                                              "the realm field is missing in:",
+                                               "auth.require = ( \"...\" => ( ..., \"realm\" => \"...\" ) )");
+                               return HANDLER_ERROR;
+                       }
+Index: src/mod_cml_lua.c
+===================================================================
+--- src/mod_cml_lua.c  (.../tags/lighttpd-1.4.23)
++++ src/mod_cml_lua.c  (.../branches/lighttpd-1.4.x)
+@@ -2,6 +2,7 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <time.h>
++#include <string.h>
  
-+int mod_uploadprogress_plugin_init(plugin *p);
- int mod_uploadprogress_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("uploadprogress");
-Index: src/mod_fastcgi.c
+ #include "mod_cml.h"
+ #include "mod_cml_funcs.h"
+Index: src/http-header-glue.c
 ===================================================================
---- src/mod_fastcgi.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_fastcgi.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -49,6 +49,8 @@
- #include <sys/wait.h>
- #endif
+--- src/http-header-glue.c     (.../tags/lighttpd-1.4.23)
++++ src/http-header-glue.c     (.../branches/lighttpd-1.4.x)
+@@ -104,6 +104,21 @@
+       return response_header_insert(srv, con, key, keylen, value, vallen);
+ }
  
-+#include "version.h"
++int response_header_append(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen) {
++      data_string *ds;
 +
- #define FCGI_ENV_ADD_CHECK(ret, con) \
-       if (ret == -1) { \
-               con->http_status = 400; \
-@@ -389,7 +391,7 @@
- /* ok, we need a prototype */
- static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
++      UNUSED(srv);
++
++      /* if there already is a key by this name append the value */
++      if (NULL != (ds = (data_string *)array_get_element(con->response.headers, key))) {
++              buffer_append_string_len(ds->value, CONST_STR_LEN(", "));
++              buffer_append_string_len(ds->value, value, vallen);
++              return 0;
++      }
++
++      return response_header_insert(srv, con, key, keylen, value, vallen);
++}
++
+ int http_response_redirect_to_directory(server *srv, connection *con) {
+       buffer *o;
+@@ -259,7 +274,7 @@
+                                       }
+                                       if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
+-                                              con->http_status = 304;
++                                              if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
+                                               return HANDLER_FINISHED;
+                                       } else {
+                                               char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
+@@ -281,15 +296,16 @@
+                                               strncpy(buf, con->request.http_if_modified_since, used_len);
+                                               buf[used_len] = '\0';
+-                                              tm.tm_isdst = 0;
+                                               if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
+                                                       con->http_status = 412;
+                                                       con->mode = DIRECT;
+                                                       return HANDLER_FINISHED;
+                                               }
++                                              tm.tm_isdst = 0;
+                                               t_header = mktime(&tm);
  
--int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
-+static int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
-       buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
-       buffer_append_string_buffer(b, host->id);
-       if (proc) {
-@@ -400,7 +402,7 @@
-       return 0;
- }
+                                               strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
++                                              tm.tm_isdst = 0;
+                                               t_file = mktime(&tm);
  
--int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
-+static int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
- #define CLEAN(x) \
-       fastcgi_status_copy_procname(b, host, proc); \
-       buffer_append_string_len(b, CONST_STR_LEN(x)); \
-@@ -465,7 +467,7 @@
-       free(hctx);
- }
+                                               if (t_file > t_header) return HANDLER_GO_ON;
+@@ -318,7 +334,7 @@
+               }
+               if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
+-                      con->http_status = 304;
++                      if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
+                       return HANDLER_FINISHED;
+               } else {
+                       char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
+@@ -331,18 +347,17 @@
+                       strncpy(buf, con->request.http_if_modified_since, used_len);
+                       buf[used_len] = '\0';
+-                      tm.tm_isdst = 0;
+                       if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
+                               /**
+                                * parsing failed, let's get out of here 
+                                */
+-                              log_error_write(srv, __FILE__, __LINE__, "ss",
+-                                              "strptime() failed on", buf);
+                               return HANDLER_GO_ON;
+                       }
++                      tm.tm_isdst = 0;
+                       t_header = mktime(&tm);
  
--fcgi_proc *fastcgi_process_init() {
-+static fcgi_proc *fastcgi_process_init() {
-       fcgi_proc *f;
+                       strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
++                      tm.tm_isdst = 0;
+                       t_file = mktime(&tm);
  
-       f = calloc(1, sizeof(*f));
-@@ -478,7 +480,7 @@
-       return f;
+                       if (t_file > t_header) return HANDLER_GO_ON;
+Index: src/mod_setenv.c
+===================================================================
+--- src/mod_setenv.c   (.../tags/lighttpd-1.4.23)
++++ src/mod_setenv.c   (.../branches/lighttpd-1.4.x)
+@@ -215,7 +215,7 @@
+       return HANDLER_GO_ON;
  }
  
--void fastcgi_process_free(fcgi_proc *f) {
-+static void fastcgi_process_free(fcgi_proc *f) {
-       if (!f) return;
+-REQUESTDONE_FUNC(mod_setenv_reset) {
++CONNECTION_FUNC(mod_setenv_reset) {
+       plugin_data *p = p_d;
  
-       fastcgi_process_free(f->next);
-@@ -489,7 +491,7 @@
-       free(f);
- }
+       UNUSED(srv);
+@@ -240,7 +240,7 @@
+       p->set_defaults  = mod_setenv_set_defaults;
+       p->cleanup     = mod_setenv_free;
  
--fcgi_extension_host *fastcgi_host_init() {
-+static fcgi_extension_host *fastcgi_host_init() {
-       fcgi_extension_host *f;
+-      p->handle_request_done  = mod_setenv_reset;
++      p->connection_reset  = mod_setenv_reset;
  
-       f = calloc(1, sizeof(*f));
-@@ -506,7 +508,7 @@
-       return f;
- }
+       p->data        = NULL;
  
--void fastcgi_host_free(fcgi_extension_host *h) {
-+static void fastcgi_host_free(fcgi_extension_host *h) {
-       if (!h) return;
+Index: src/mod_fastcgi.c
+===================================================================
+--- src/mod_fastcgi.c  (.../tags/lighttpd-1.4.23)
++++ src/mod_fastcgi.c  (.../branches/lighttpd-1.4.x)
+@@ -122,24 +122,11 @@
+        *
+        */
+-      unsigned short min_procs;
+       unsigned short max_procs;
+       size_t num_procs;    /* how many procs are started */
+       size_t active_procs; /* how many of them are really running */
+-      unsigned short max_load_per_proc;
+-
+       /*
+-       * kick the process from the list if it was not
+-       * used for idle_timeout until min_procs is
+-       * reached. this helps to get the processlist
+-       * small again we had a small peak load.
+-       *
+-       */
+-
+-      unsigned short idle_timeout;
+-
+-      /*
+        * time after a disabled remote connection is tried to be re-enabled
+        *
+        *
+@@ -384,6 +371,21 @@
+ /* ok, we need a prototype */
+ static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
  
-       buffer_free(h->id);
-@@ -525,7 +527,7 @@
++static void reset_signals(void) {
++#ifdef SIGTTOU
++      signal(SIGTTOU, SIG_DFL);
++#endif
++#ifdef SIGTTIN
++      signal(SIGTTIN, SIG_DFL);
++#endif
++#ifdef SIGTSTP
++      signal(SIGTSTP, SIG_DFL);
++#endif
++      signal(SIGHUP, SIG_DFL);
++      signal(SIGPIPE, SIG_DFL);
++      signal(SIGUSR1, SIG_DFL);
++}
++
+ static void fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
+       buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
+       buffer_append_string_buffer(b, host->id);
+@@ -993,8 +995,6 @@
+                               close(fcgi_fd);
+                       }
  
- }
+-                      openDevNull(STDERR_FILENO);
+-
+                       /* we don't need the client socket */
+                       for (i = 3; i < 256; i++) {
+                               close(i);
+@@ -1054,6 +1054,7 @@
+                               *c = '/';
+                       }
  
--fcgi_exts *fastcgi_extensions_init() {
-+static fcgi_exts *fastcgi_extensions_init() {
-       fcgi_exts *f;
++                      reset_signals();
+                       /* exec the cgi */
+                       execve(arg.ptr[0], arg.ptr, env.ptr);
+@@ -1235,20 +1236,17 @@
+                                               { "check-local",       NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },      /* 5 */
+                                               { "port",              NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },        /* 6 */
+-                                              { "min-procs-not-working",         NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },        /* 7 this is broken for now */
+-                                              { "max-procs",         NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },        /* 8 */
+-                                              { "max-load-per-proc", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },        /* 9 */
+-                                              { "idle-timeout",      NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },        /* 10 */
+-                                              { "disable-time",      NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },        /* 11 */
++                                              { "max-procs",         NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },        /* 7 */
++                                              { "disable-time",      NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },        /* 8 */
+-                                              { "bin-environment",   NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },        /* 12 */
+-                                              { "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },     /* 13 */
++                                              { "bin-environment",   NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },        /* 9 */
++                                              { "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },     /* 10 */
+-                                              { "broken-scriptfilename", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },  /* 14 */
+-                                              { "allow-x-send-file",  NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },      /* 15 */
+-                                              { "strip-request-uri",  NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },      /* 16 */
+-                                              { "kill-signal",        NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },      /* 17 */
+-                                              { "fix-root-scriptname",   NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },  /* 18 */
++                                              { "broken-scriptfilename", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },  /* 11 */
++                                              { "allow-x-send-file",  NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },     /* 12 */
++                                              { "strip-request-uri",  NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },      /* 13 */
++                                              { "kill-signal",        NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },       /* 14 */
++                                              { "fix-root-scriptname",   NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },  /* 15 */
+                                               { NULL,                NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
+                                       };
+@@ -1267,12 +1265,9 @@
+                                       buffer_copy_string_buffer(host->id, da_host->key);
+                                       host->check_local  = 1;
+-                                      host->min_procs    = 4;
+                                       host->max_procs    = 4;
+-                                      host->max_load_per_proc = 1;
+-                                      host->idle_timeout = 60;
+                                       host->mode = FCGI_RESPONDER;
+-                                      host->disable_time = 60;
++                                      host->disable_time = 1;
+                                       host->break_scriptfilename_for_php = 0;
+                                       host->allow_xsendfile = 0; /* handle X-LIGHTTPD-send-file */
+                                       host->kill_signal = SIGTERM;
+@@ -1286,19 +1281,16 @@
+                                       fcv[5].destination = &(host->check_local);
+                                       fcv[6].destination = &(host->port);
+-                                      fcv[7].destination = &(host->min_procs);
+-                                      fcv[8].destination = &(host->max_procs);
+-                                      fcv[9].destination = &(host->max_load_per_proc);
+-                                      fcv[10].destination = &(host->idle_timeout);
+-                                      fcv[11].destination = &(host->disable_time);
++                                      fcv[7].destination = &(host->max_procs);
++                                      fcv[8].destination = &(host->disable_time);
+-                                      fcv[12].destination = host->bin_env;
+-                                      fcv[13].destination = host->bin_env_copy;
+-                                      fcv[14].destination = &(host->break_scriptfilename_for_php);
+-                                      fcv[15].destination = &(host->allow_xsendfile);
+-                                      fcv[16].destination = host->strip_request_uri;
+-                                      fcv[17].destination = &(host->kill_signal);
+-                                      fcv[18].destination = &(host->fix_root_path_name);
++                                      fcv[9].destination = host->bin_env;
++                                      fcv[10].destination = host->bin_env_copy;
++                                      fcv[11].destination = &(host->break_scriptfilename_for_php);
++                                      fcv[12].destination = &(host->allow_xsendfile);
++                                      fcv[13].destination = host->strip_request_uri;
++                                      fcv[14].destination = &(host->kill_signal);
++                                      fcv[15].destination = &(host->fix_root_path_name);
+                                       if (0 != config_insert_values_internal(srv, da_host->value, fcv)) {
+                                               return HANDLER_ERROR;
+@@ -1355,23 +1347,16 @@
+                                               /* a local socket + self spawning */
+                                               size_t pno;
+-                                              /* HACK:  just to make sure the adaptive spawing is disabled */
+-                                              host->min_procs = host->max_procs;
+-
+-                                              if (host->min_procs > host->max_procs) host->max_procs = host->min_procs;
+-                                              if (host->max_load_per_proc < 1) host->max_load_per_proc = 0;
+-
+                                               if (s->debug) {
+-                                                      log_error_write(srv, __FILE__, __LINE__, "ssbsdsbsdsd",
++                                                      log_error_write(srv, __FILE__, __LINE__, "ssbsdsbsd",
+                                                                       "--- fastcgi spawning local",
+                                                                       "\n\tproc:", host->bin_path,
+                                                                       "\n\tport:", host->port,
+                                                                       "\n\tsocket", host->unixsocket,
+-                                                                      "\n\tmin-procs:", host->min_procs,
+                                                                       "\n\tmax-procs:", host->max_procs);
+                                               }
  
-       f = calloc(1, sizeof(*f));
-@@ -533,7 +535,7 @@
-       return f;
- }
+-                                              for (pno = 0; pno < host->min_procs; pno++) {
++                                              for (pno = 0; pno < host->max_procs; pno++) {
+                                                       fcgi_proc *proc;
+                                                       proc = fastcgi_process_init();
+@@ -1391,7 +1376,7 @@
+                                                                               "--- fastcgi spawning",
+                                                                               "\n\tport:", host->port,
+                                                                               "\n\tsocket", host->unixsocket,
+-                                                                              "\n\tcurrent:", pno, "/", host->min_procs);
++                                                                              "\n\tcurrent:", pno, "/", host->max_procs);
+                                                       }
+                                                       if (fcgi_spawn_connection(srv, p, host, proc)) {
+@@ -1426,7 +1411,6 @@
+                                               host->first = proc;
+-                                              host->min_procs = 1;
+                                               host->max_procs = 1;
+                                       }
+@@ -2739,7 +2723,7 @@
+                                       log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
+                                                       "--- fastcgi spawning",
+                                                       "\n\tsocket", proc->connection_name,
+-                                                      "\n\tcurrent:", 1, "/", host->min_procs);
++                                                      "\n\tcurrent:", 1, "/", host->max_procs);
+                               }
  
--void fastcgi_extensions_free(fcgi_exts *f) {
-+static void fastcgi_extensions_free(fcgi_exts *f) {
-       size_t i;
+                               if (fcgi_spawn_connection(srv, p, host, proc)) {
+@@ -2778,8 +2762,11 @@
+        *     - tcp socket (do not check host->host->uses, as it may be not set which means INADDR_LOOPBACK)
+        *     - unix socket
+        */
+-      if (!host ||
+-          (!host->port && !host->unixsocket->used)) {
++      if (!host) {
++              log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: host = NULL");
++              return HANDLER_ERROR;
++      }
++      if ((!host->port && !host->unixsocket->used)) {
+               log_error_write(srv, __FILE__, __LINE__, "sxddd",
+                               "write-req: error",
+                               host,
+@@ -2787,7 +2774,7 @@
+                               host->port,
+                               host->unixsocket->used);
+-              hctx->proc->disabled_until = srv->cur_ts + 10;
++              hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
+               hctx->proc->state = PROC_STATE_DIED;
+               return HANDLER_ERROR;
+@@ -2803,7 +2790,7 @@
+                       log_error_write(srv, __FILE__, __LINE__, "ss",
+                                       "getsockopt failed:", strerror(errno));
+-                      hctx->proc->disabled_until = srv->cur_ts + 10;
++                      hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
+                       hctx->proc->state = PROC_STATE_DIED;
  
-       if (!f) return;
-@@ -563,7 +565,7 @@
-       free(f);
- }
+                       return HANDLER_ERROR;
+@@ -2817,7 +2804,7 @@
+                                               "socket:", hctx->proc->connection_name);
                      }
  
--int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
-+static int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
-       fcgi_extension *fe;
-       size_t i;
+-                      hctx->proc->disabled_until = srv->cur_ts + 5;
++                      hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
+                       if (hctx->proc->is_local) {
+                               hctx->proc->state = PROC_STATE_DIED_WAIT_FOR_PID;
+@@ -2910,13 +2897,13 @@
+                       /* cool down the backend, it is overloaded
+                        * -> EAGAIN */
+-                      log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+-                              "backend is overloaded; we'll disable it for 2 seconds and send the request to another backend instead:",
++                      log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
++                              "backend is overloaded; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
+                               "reconnects:", hctx->reconnects,
+                               "load:", host->load);
+-                      hctx->proc->disabled_until = srv->cur_ts + 2;
++                      hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
+                       hctx->proc->state = PROC_STATE_OVERLOADED;
+                       fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
+@@ -2930,18 +2917,18 @@
+                        * - ECONNREFUSED for tcp-ip sockets
+                        * - ENOENT for unix-domain-sockets
+                        *
+-                       * for check if the host is back in 5 seconds
++                       * for check if the host is back in hctx->host->disable_time seconds
+                        *  */
+-                      hctx->proc->disabled_until = srv->cur_ts + 5;
++                      hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
+                       if (hctx->proc->is_local) {
+                               hctx->proc->state = PROC_STATE_DIED_WAIT_FOR_PID;
+                       } else {
+                               hctx->proc->state = PROC_STATE_DIED;
+                       }
  
-@@ -1056,10 +1058,7 @@
-                                                       "child exited with status",
-                                                       WEXITSTATUS(status), host->bin_path);
-                                       log_error_write(srv, __FILE__, __LINE__, "s",
--                                                      "If you're trying to run PHP as a FastCGI backend, make sure you're using the FastCGI-enabled version.\n"
--                                                      "You can find out if it is the right one by executing 'php -v' and it should display '(cgi-fcgi)' "
--                                                      "in the output, NOT '(cgi)' NOR '(cli)'.\n"
--                                                      "For more information, check http://trac.lighttpd.net/trac/wiki/Docs%3AModFastCGI#preparing-php-as-a-fastcgi-program"
-+                                                      "If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.\n"
-                                                       "If this is PHP on Gentoo, add 'fastcgi' to the USE flags.");
-                               } else if (WIFSIGNALED(status)) {
-                                       log_error_write(srv, __FILE__, __LINE__, "sd",
-@@ -1479,7 +1478,7 @@
+-                      log_error_write(srv, __FILE__, __LINE__, "ssdsd",
+-                              "backend died; we'll disable it for 5 seconds and send the request to another backend instead:",
++                      log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
++                              "backend died; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
+                               "reconnects:", hctx->reconnects,
+                               "load:", host->load);
+@@ -3032,11 +3019,6 @@
+                                               "reconnect attempts:", hctx->reconnects);
+                               return HANDLER_ERROR;
+-                      case EAGAIN:
+-                      case EINTR:
+-                              fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+-
+-                              return HANDLER_WAIT_FOR_EVENT;
+                       default:
+                               log_error_write(srv, __FILE__, __LINE__, "ssd",
+                                               "write failed:", strerror(errno), errno);
+@@ -3266,7 +3248,7 @@
+                                               log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
+                                                               "--- fastcgi spawning",
+                                                               "\n\tsocket", proc->connection_name,
+-                                                              "\n\tcurrent:", 1, "/", host->min_procs);
++                                                              "\n\tcurrent:", 1, "/", host->max_procs);
+                                       }
+                                       if (fcgi_spawn_connection(srv, p, host, proc)) {
+@@ -3288,18 +3270,18 @@
+                                   hctx->reconnects < 5) {
+                                       fcgi_reconnect(srv, hctx);
+-                                      log_error_write(srv, __FILE__, __LINE__, "ssbsbs",
++                                      log_error_write(srv, __FILE__, __LINE__, "ssbsBSBs",
+                                               "response not received, request not sent",
+                                               "on socket:", proc->connection_name,
+-                                              "for", con->uri.path, ", reconnecting");
++                                              "for", con->uri.path, "?", con->uri.query, ", reconnecting");
+                                       return HANDLER_WAIT_FOR_FD;
+                               }
  
-       return 0;
- }
--void fcgi_connection_close(server *srv, handler_ctx *hctx) {
-+static void fcgi_connection_close(server *srv, handler_ctx *hctx) {
-       plugin_data *p;
-       connection  *con;
+-                              log_error_write(srv, __FILE__, __LINE__, "sosbsbs",
++                              log_error_write(srv, __FILE__, __LINE__, "sosbsBSBs",
+                                               "response not received, request sent:", hctx->wb->bytes_out,
+                                               "on socket:", proc->connection_name,
+-                                              "for", con->uri.path, ", closing connection");
++                                              "for", con->uri.path, "?", con->uri.query, ", closing connection");
  
-@@ -1885,10 +1884,18 @@
-       buffer_prepare_copy(p->fcgi_env, 1024);
+                               fcgi_connection_close(srv, hctx);
  
+@@ -3311,10 +3293,10 @@
+                               /* response might have been already started, kill the connection */
+                               fcgi_connection_close(srv, hctx);
  
--      FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION)),con)
-+      if (buffer_is_empty(con->conf.server_tag)) {
-+              FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC)),con)
-+      } else {
-+              FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag)),con)
-+      }
+-                              log_error_write(srv, __FILE__, __LINE__, "ssbsbs",
++                              log_error_write(srv, __FILE__, __LINE__, "ssbsBSBs",
+                                               "response already sent out, but backend returned error",
+                                               "on socket:", proc->connection_name,
+-                                              "for", con->uri.path, ", terminating connection");
++                                              "for", con->uri.path, "?", con->uri.query, ", terminating connection");
  
-       if (con->server_name->used) {
--              FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name)),con)
-+              size_t len = con->server_name->used - 1;
-+              char *colon = strchr(con->server_name->ptr, ':');
-+              if (colon) len = colon - con->server_name->ptr;
-+
-+              FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len),con)
-       } else {
- #ifdef HAVE_IPV6
-               s = inet_ntop(srv_sock->addr.plain.sa_family,
-@@ -2060,7 +2067,7 @@
-                       fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"),
-                                       con->request.orig_uri->ptr + (host->strip_request_uri->used - 2),
--                                      con->request.orig_uri->used - (host->strip_request_uri->used - 2));
-+                                      con->request.orig_uri->used - (host->strip_request_uri->used - 2) - 1);
+                               connection_set_state(srv, con, CON_STATE_ERROR);
+                       }
+@@ -3364,9 +3346,9 @@
+                        * even if the FCGI_FIN packet is not received yet
+                        */
                } else {
-                       FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri)),con)
-               }
-@@ -3639,7 +3646,11 @@
-                               */
-                               /* the rewrite is only done for /prefix/? matches */
--                              if (extension->key->ptr[0] == '/' &&
-+                              if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
-+                                      buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
-+                                      con->uri.path->used = 1;
-+                                      con->uri.path->ptr[con->uri.path->used - 1] = '\0';
-+                              } else if (extension->key->ptr[0] == '/' &&
-                                       con->uri.path->used > extension->key->used &&
-                                       NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
-                                       /* rewrite uri.path and pathinfo */
-@@ -3648,10 +3659,6 @@
-                                       con->uri.path->used -= con->request.pathinfo->used - 1;
-                                       con->uri.path->ptr[con->uri.path->used - 1] = '\0';
--                              } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
--                                      buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
--                                      con->uri.path->used = 1;
--                                      con->uri.path->ptr[con->uri.path->used - 1] = '\0';
-                               }
+-                      log_error_write(srv, __FILE__, __LINE__, "sbsbsd",
++                      log_error_write(srv, __FILE__, __LINE__, "sBSbsbsd",
+                                       "error: unexpected close of fastcgi connection for",
+-                                      con->uri.path,
++                                      con->uri.path, "?", con->uri.query,
+                                       "(no fastcgi process on socket:", proc->connection_name, "?)",
+                                       hctx->state);
+@@ -3489,25 +3471,27 @@
+               /* check if extension matches */
+               for (k = 0; k < p->conf.exts->used; k++) {
+                       size_t ct_len; /* length of the config entry */
++                      fcgi_extension *ext = p->conf.exts->exts[k];
+-                      extension = p->conf.exts->exts[k];
++                      if (ext->key->used == 0) continue;
+-                      if (extension->key->used == 0) continue;
++                      ct_len = ext->key->used - 1;
+-                      ct_len = extension->key->used - 1;
+-
+                       /* check _url_ in the form "/fcgi_pattern" */
+-                      if (extension->key->ptr[0] == '/') {
++                      if (ext->key->ptr[0] == '/') {
+                               if ((ct_len <= con->uri.path->used -1) &&
+-                                  (strncmp(con->uri.path->ptr, extension->key->ptr, ct_len) == 0))
++                                  (strncmp(con->uri.path->ptr, ext->key->ptr, ct_len) == 0)) {
++                                      extension = ext;
+                                       break;
+-                      } else if ((ct_len <= s_len) && (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len))) {
++                              }
++                      } else if ((ct_len <= s_len) && (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len))) {
+                               /* check extension in the form ".fcg" */
++                              extension = ext;
+                               break;
                        }
                }
-@@ -3916,6 +3923,7 @@
- }
-+int mod_fastcgi_plugin_init(plugin *p);
- int mod_fastcgi_plugin_init(plugin *p) {
-       p->version      = LIGHTTPD_VERSION_ID;
-       p->name         = buffer_init_string("fastcgi");
-Index: src/CMakeLists.txt
-===================================================================
---- src/CMakeLists.txt (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/CMakeLists.txt (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -29,6 +29,18 @@
- OPTION(WITH_GDBM "gdbm storage for mod_trigger_b4_dl [default: off]")
- OPTION(WITH_MEMCACHE "memcached storage for mod_trigger_b4_dl [default: off]")
-+IF(CMAKE_COMPILER_IS_GNUCC)
-+      OPTION(BUILD_EXTRA_WARNINGS "extra warnings")
-+
-+      IF(BUILD_EXTRA_WARNINGS)
-+              SET(WARN_FLAGS "-g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wno-pointer-sign -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wformat-security")
-+              # -Wl,--as-needed
-+              # -Werror -Wbad-function-cast -Wmissing-prototypes
-+      ELSE(BUILD_EXTRA_WARNINGS)
-+              SET(WARN_FLAGS "")
-+      ENDIF(BUILD_EXTRA_WARNINGS)
-+ENDIF(CMAKE_COMPILER_IS_GNUCC)
-+
- OPTION(BUILD_STATIC "build a static lighttpd with all modules added")
- IF(BUILD_STATIC)
-@@ -133,6 +145,7 @@
-               struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;
-               return 0;
-       }" HAVE_IPV6)
-+CHECK_FUNCTION_EXISTS(issetugid HAVE_ISSETUGID)
- ## refactor me
- MACRO(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
-@@ -161,7 +174,9 @@
- IF(WITH_XATTR)
-   CHECK_INCLUDE_FILES(attr/attributes.h HAVE_ATTR_ATTRIBUTES_H)
--  CHECK_LIBRARY_EXISTS(attr attr_get "" HAVE_XATTR)
-+  IF(HAVE_ATTR_ATTRIBUTES_H)
-+    CHECK_LIBRARY_EXISTS(attr attr_get "" HAVE_XATTR)
-+  ENDIF(HAVE_ATTR_ATTRIBUTES_H)
- ENDIF(WITH_XATTR)
- IF(WITH_MYSQL)
-@@ -421,8 +436,9 @@
- SET(L_INSTALL_TARGETS)
--ADD_EXECUTABLE(spawn-fcgi spawn-fcgi.c)
--SET(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} spawn-fcgi)
-+ADD_EXECUTABLE(lighttpd-angel lighttpd-angel.c)
-+SET(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} lighttpd-angel)
-+ADD_TARGET_PROPERTIES(lighttpd-angel COMPILE_FLAGS "-DSBIN_DIR=\\\\\"${CMAKE_INSTALL_PREFIX}/${SBINDIR}\\\\\"")
- ADD_EXECUTABLE(lighttpd
-       server.c
-@@ -468,7 +484,7 @@
- ADD_AND_INSTALL_LIBRARY(mod_staticfile mod_staticfile.c)
- ADD_AND_INSTALL_LIBRARY(mod_status mod_status.c)
- ADD_AND_INSTALL_LIBRARY(mod_trigger_b4_dl mod_trigger_b4_dl.c)
--ADD_AND_INSTALL_LIBRARY(mod_uploadprogress mod_uploadprogress.c)
-+# ADD_AND_INSTALL_LIBRARY(mod_uploadprogress mod_uploadprogress.c)
- ADD_AND_INSTALL_LIBRARY(mod_userdir mod_userdir.c)
- ADD_AND_INSTALL_LIBRARY(mod_usertrack mod_usertrack.c)
- ADD_AND_INSTALL_LIBRARY(mod_webdav mod_webdav.c)
-@@ -494,10 +510,10 @@
- ADD_TARGET_PROPERTIES(mod_cml LINK_FLAGS ${LUA_LDFLAGS})
- ADD_TARGET_PROPERTIES(mod_cml COMPILE_FLAGS ${LUA_CFLAGS})
--IF(HAVE_MYSQL_H AND HAVE_LIBMYSQL)
-+IF(HAVE_MYSQL_H AND HAVE_MYSQL)
-   TARGET_LINK_LIBRARIES(mod_mysql_vhost mysqlclient)
-   INCLUDE_DIRECTORIES(/usr/include/mysql)
--ENDIF(HAVE_MYSQL_H AND HAVE_LIBMYSQL)
-+ENDIF(HAVE_MYSQL_H AND HAVE_MYSQL)
- SET(L_MOD_WEBDAV)
- IF(HAVE_SQLITE3_H)
-@@ -545,7 +561,7 @@
- ENDIF(HAVE_MEMCACHE_H)
- IF(CMAKE_COMPILER_IS_GNUCC)
--  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -g -Wshadow -W -pedantic")
-+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -g -Wshadow -W -pedantic ${WARN_FLAGS}")
-   SET(CMAKE_C_FLAGS_RELEASE        "${CMAKE_C_FLAGS_RELEASE}     -O2")
-   SET(CMAKE_C_FLAGS_DEBUG          "${CMAKE_C_FLAGS_DEBUG}       -O0")
-   SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2")
-Index: src/mod_access.c
-===================================================================
---- src/mod_access.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_access.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -175,6 +175,7 @@
- }
-+int mod_access_plugin_init(plugin *p);
- int mod_access_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("access");
-Index: src/mod_accesslog.c
-===================================================================
---- src/mod_accesslog.c        (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_accesslog.c        (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -156,7 +156,7 @@
-       return p;
- }
+               /* extension doesn't match */
+-              if (k == p->conf.exts->used) {
++              if (NULL == extension) {
+                       return HANDLER_GO_ON;
+               }
+       }
+@@ -3535,8 +3519,8 @@
+               if (!extension->note_is_sent) {
+                       extension->note_is_sent = 1;
+-                      log_error_write(srv, __FILE__, __LINE__, "sbsbs",
+-                                      "all handlers for ", con->uri.path,
++                      log_error_write(srv, __FILE__, __LINE__, "sBSbsbs",
++                                      "all handlers for", con->uri.path, "?", con->uri.query,
+                                       "on", extension->key,
+                                       "are down.");
+               }
+@@ -3727,107 +3711,12 @@
+                       for (n = 0; n < ex->used; n++) {
  
--int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
-+static int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
-       size_t i, j, k = 0, start = 0;
+                               fcgi_proc *proc;
+-                              unsigned long sum_load = 0;
+                               fcgi_extension_host *host;
  
-       if (format->used == 0) return -1;
-@@ -475,74 +475,9 @@
+                               host = ex->hosts[n];
  
-               if (s->access_logfile->used < 2) continue;
+                               fcgi_restart_dead_procs(srv, p, host);
  
--              if (s->access_logfile->ptr[0] == '|') {
--#ifdef HAVE_FORK
--                      /* create write pipe and spawn process */
+-                              for (proc = host->first; proc; proc = proc->next) {
+-                                      sum_load += proc->load;
+-                              }
 -
--                      int to_log_fds[2];
--                      pid_t pid;
+-                              if (host->num_procs &&
+-                                  host->num_procs < host->max_procs &&
+-                                  (sum_load / host->num_procs) > host->max_load_per_proc) {
+-                                      /* overload, spawn new child */
+-                                      if (p->conf.debug) {
+-                                              log_error_write(srv, __FILE__, __LINE__, "s",
+-                                                              "overload detected, spawning a new child");
+-                                      }
 -
--                      if (pipe(to_log_fds)) {
--                              log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
--                              return HANDLER_ERROR;
--                      }
+-                                      for (proc = host->unused_procs; proc && proc->pid != 0; proc = proc->next);
+-
+-                                      if (proc) {
+-                                              if (proc == host->unused_procs) host->unused_procs = proc->next;
+-
+-                                              if (proc->next) proc->next->prev = NULL;
+-
+-                                              host->max_id++;
+-                                      } else {
+-                                              proc = fastcgi_process_init();
+-                                              proc->id = host->max_id++;
+-                                      }
 -
--                      /* fork, execve */
--                      switch (pid = fork()) {
--                      case 0:
--                              /* child */
+-                                      host->num_procs++;
 -
--                              close(STDIN_FILENO);
--                              dup2(to_log_fds[0], STDIN_FILENO);
--                              close(to_log_fds[0]);
--                              /* not needed */
--                              close(to_log_fds[1]);
+-                                      if (buffer_is_empty(host->unixsocket)) {
+-                                              proc->port = host->port + proc->id;
+-                                      } else {
+-                                              buffer_copy_string_buffer(proc->unixsocket, host->unixsocket);
+-                                              buffer_append_string_len(proc->unixsocket, CONST_STR_LEN("-"));
+-                                              buffer_append_long(proc->unixsocket, proc->id);
+-                                      }
 -
--                              openDevNull(STDERR_FILENO);
+-                                      if (fcgi_spawn_connection(srv, p, host, proc)) {
+-                                              log_error_write(srv, __FILE__, __LINE__, "s",
+-                                                              "ERROR: spawning fcgi failed.");
+-                                              return HANDLER_ERROR;
+-                                      }
 -
--                              /* we don't need the client socket */
--                              for (i = 3; i < 256; i++) {
--                                      close(i);
+-                                      proc->prev = NULL;
+-                                      proc->next = host->first;
+-                                      if (host->first) {
+-                                              host->first->prev = proc;
+-                                      }
+-                                      host->first = proc;
 -                              }
 -
--                              /* exec the log-process (skip the | )
--                               *
--                               */
+-                              for (proc = host->first; proc; proc = proc->next) {
+-                                      if (proc->load != 0) break;
+-                                      if (host->num_procs <= host->min_procs) break;
+-                                      if (proc->pid == 0) continue;
 -
--                              execl("/bin/sh", "sh", "-c", s->access_logfile->ptr + 1, (char *)NULL);
+-                                      if (srv->cur_ts - proc->last_used > host->idle_timeout) {
+-                                              /* a proc is idling for a long time now,
+-                                               * terminate it */
 -
--                              log_error_write(srv, __FILE__, __LINE__, "sss",
--                                              "spawning log-process failed: ", strerror(errno),
--                                              s->access_logfile->ptr + 1);
+-                                              if (p->conf.debug) {
+-                                                      log_error_write(srv, __FILE__, __LINE__, "ssbsd",
+-                                                                      "idle-timeout reached; terminating child:",
+-                                                                      "socket:", proc->connection_name,
+-                                                                      "pid", proc->pid);
+-                                              }
 -
--                              exit(-1);
--                              break;
--                      case -1:
--                              /* error */
--                              log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
--                              break;
--                      default:
--                              close(to_log_fds[0]);
 -
--                              s->log_access_fd = to_log_fds[1];
+-                                              if (proc->next) proc->next->prev = proc->prev;
+-                                              if (proc->prev) proc->prev->next = proc->next;
 -
--                              break;
--                      }
--#else
--                      return -1;
--#endif
--              } else if (-1 == (s->log_access_fd =
--                                open(s->access_logfile->ptr, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
+-                                              if (proc->prev == NULL) host->first = proc->next;
 -
--                      log_error_write(srv, __FILE__, __LINE__, "ssb",
--                                      "opening access-log failed:",
--                                      strerror(errno), s->access_logfile);
+-                                              proc->prev = NULL;
+-                                              proc->next = host->unused_procs;
 -
-+              if (-1 == (s->log_access_fd = open_logfile_or_pipe(srv, s->access_logfile->ptr)))
-                       return HANDLER_ERROR;
--              }
--#ifdef FD_CLOEXEC
--              fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
--#endif
-+
-       }
+-                                              if (host->unused_procs) host->unused_procs->prev = proc;
+-                                              host->unused_procs = proc;
+-
+-                                              kill(proc->pid, SIGTERM);
+-
+-                                              proc->state = PROC_STATE_KILLED;
+-
+-                                              log_error_write(srv, __FILE__, __LINE__, "ssbsd",
+-                                                                      "killed:",
+-                                                                      "socket:", proc->connection_name,
+-                                                                      "pid", proc->pid);
+-
+-                                              host->num_procs--;
+-
+-                                              /* proc is now in unused, let the next second handle the next process */
+-                                              break;
+-                                      }
+-                              }
+-
+                               for (proc = host->unused_procs; proc; proc = proc->next) {
+                                       int status;
  
-       return HANDLER_GO_ON;
-@@ -876,6 +811,7 @@
+Index: src/fdevent_poll.c
+===================================================================
+--- src/fdevent_poll.c (.../tags/lighttpd-1.4.23)
++++ src/fdevent_poll.c (.../branches/lighttpd-1.4.x)
+@@ -132,7 +132,7 @@
+       if (poll_r & POLLNVAL) r |= FDEVENT_NVAL;
+       if (poll_r & POLLPRI) r |= FDEVENT_PRI;
+-      return ev->pollfds[ndx].revents;
++      return r;
  }
  
+ static int fdevent_poll_event_get_fd(fdevents *ev, size_t ndx) {
+Index: src/fdevent_select.c
+===================================================================
+--- src/fdevent_select.c       (.../tags/lighttpd-1.4.23)
++++ src/fdevent_select.c       (.../branches/lighttpd-1.4.x)
+@@ -38,7 +38,7 @@
+       UNUSED(fde_ndx);
+       /* we should be protected by max-fds, but you never know */
+-      assert(fd < FD_SETSIZE);
++      assert(fd < ((int)FD_SETSIZE));
  
-+int mod_accesslog_plugin_init(plugin *p);
- int mod_accesslog_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("accesslog");
+       if (events & FDEVENT_IN) {
+               FD_SET(fd, &(ev->select_set_read));
+Index: src/CMakeLists.txt
+===================================================================
 Index: src/server.c
 ===================================================================
---- src/server.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/server.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -29,6 +29,7 @@
- #include "plugin.h"
- #include "joblist.h"
- #include "network_backends.h"
-+#include "version.h"
- #ifdef HAVE_GETOPT_H
- #include <getopt.h>
-@@ -64,6 +65,17 @@
- /* #define USE_ALARM */
- #endif
+--- src/server.c       (.../tags/lighttpd-1.4.23)
++++ src/server.c       (.../branches/lighttpd-1.4.x)
+@@ -187,6 +187,7 @@
+       CLEAN(cond_check_buf);
+       CLEAN(srvconf.errorlog_file);
++      CLEAN(srvconf.breakagelog_file);
+       CLEAN(srvconf.groupname);
+       CLEAN(srvconf.username);
+       CLEAN(srvconf.changeroot);
+@@ -242,8 +243,8 @@
+       srv->srvconf.reject_expect_100_with_417 = 1;
+       /* use syslog */
+-      srv->errorlog_fd = -1;
+-      srv->errorlog_mode = ERRORLOG_STDERR;
++      srv->errorlog_fd = STDERR_FILENO;
++      srv->errorlog_mode = ERRORLOG_FD;
+       srv->split_vals = array_init();
+@@ -271,6 +272,7 @@
+       CLEAN(cond_check_buf);
+       CLEAN(srvconf.errorlog_file);
++      CLEAN(srvconf.breakagelog_file);
+       CLEAN(srvconf.groupname);
+       CLEAN(srvconf.username);
+       CLEAN(srvconf.changeroot);
+@@ -717,7 +719,7 @@
+               }
  
-+#ifdef HAVE_GETUID
-+# ifndef HAVE_ISSETUGID
-+
-+static int l_issetugid() {
-+      return (geteuid() != getuid() || getegid() != getgid());
-+}
-+
-+#  define issetugid l_issetugid
-+# endif
-+#endif
-+
- static volatile sig_atomic_t srv_shutdown = 0;
- static volatile sig_atomic_t graceful_shutdown = 0;
- static volatile sig_atomic_t handle_sig_alarm = 1;
-@@ -325,7 +337,7 @@
- #else
- # define TEXT_SSL
+               if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
+-                      srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
++                      srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
+               } else {
+                       srv->max_fds = rlim.rlim_cur;
+               }
+@@ -730,7 +732,7 @@
  #endif
--      char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL \
-+      char *b = PACKAGE_DESC TEXT_SSL \
- " - a light and fast webserver\n" \
- "Build-Date: " __DATE__ " " __TIME__ "\n";
- ;
-@@ -462,7 +474,7 @@
- #else
- # define TEXT_SSL
+               if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
+                       /* don't raise the limit above FD_SET_SIZE */
+-                      if (srv->max_fds > FD_SETSIZE - 200) {
++                      if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
+                               log_error_write(srv, __FILE__, __LINE__, "sd",
+                                               "can't raise max filedescriptors above",  FD_SETSIZE - 200,
+                                               "if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");
+@@ -780,7 +782,7 @@
+                * Change group before chroot, when we have access
+                * to /etc/group
+                * */
+-              if (srv->srvconf.groupname->used) {
++              if (NULL != grp) {
+                       setgid(grp->gr_gid);
+                       setgroups(0, NULL);
+                       if (srv->srvconf.username->used) {
+@@ -804,7 +806,7 @@
  #endif
--      char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
-+      char *b = PACKAGE_DESC TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
- " - a light and fast webserver\n" \
- "usage:\n" \
- " -f <name>  filename of the config-file\n" \
-@@ -589,7 +601,7 @@
-       /* UID handling */
- #ifdef HAVE_GETUID
--      if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
-+      if (!i_am_root && issetugid()) {
-               /* we are setuid-root */
-               log_error_write(srv, __FILE__, __LINE__, "s",
-Index: src/mod_dirlisting.c
-===================================================================
---- src/mod_dirlisting.c       (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_dirlisting.c       (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -31,6 +31,8 @@
- #include <attr/attributes.h>
+ #ifdef HAVE_PWD_H
+               /* drop root privs */
+-              if (srv->srvconf.username->used) {
++              if (NULL != pwd) {
+                       setuid(pwd->pw_uid);
+               }
  #endif
+@@ -843,7 +845,7 @@
+               }
  
-+#include "version.h"
-+
- /* plugin config for all request/connections */
- typedef struct {
-@@ -73,7 +75,7 @@
-       plugin_config conf;
- } plugin_data;
--excludes_buffer *excludes_buffer_init(void) {
-+static excludes_buffer *excludes_buffer_init(void) {
-       excludes_buffer *exb;
-       exb = calloc(1, sizeof(*exb));
-@@ -81,7 +83,7 @@
-       return exb;
- }
--int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
-+static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
- #ifdef HAVE_PCRE_H
-       size_t i;
-       const char *errptr;
-@@ -128,7 +130,7 @@
+               if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
+-                      srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
++                      srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
+               } else {
+                       srv->max_fds = rlim.rlim_cur;
+               }
+@@ -857,7 +859,7 @@
  #endif
- }
--void excludes_buffer_free(excludes_buffer *exb) {
-+static void excludes_buffer_free(excludes_buffer *exb) {
- #ifdef HAVE_PCRE_H
-       size_t i;
-@@ -578,7 +580,7 @@
-       if (p->conf.set_footer->used > 1) {
-               buffer_append_string_buffer(out, p->conf.set_footer);
-       } else if (buffer_is_empty(con->conf.server_tag)) {
--              buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_NAME "/" PACKAGE_VERSION));
-+              buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_DESC));
-       } else {
-               buffer_append_string_buffer(out, con->conf.server_tag);
-       }
-@@ -904,6 +906,7 @@
+               if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
+                       /* don't raise the limit above FD_SET_SIZE */
+-                      if (srv->max_fds > FD_SETSIZE - 200) {
++                      if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
+                               log_error_write(srv, __FILE__, __LINE__, "sd",
+                                               "can't raise max filedescriptors above",  FD_SETSIZE - 200,
+                                               "if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");
+Index: src/mod_dirlisting.c
+===================================================================
+--- src/mod_dirlisting.c       (.../tags/lighttpd-1.4.23)
++++ src/mod_dirlisting.c       (.../branches/lighttpd-1.4.x)
+@@ -198,7 +198,7 @@
+       data_unset *du;
  
- /* this function is called at dlopen() time and inits the callbacks */
+       if (NULL != (du = array_get_element(ca, option))) {
+-              data_array *da = (data_array *)du;
++              data_array *da;
+               size_t j;
  
-+int mod_dirlisting_plugin_init(plugin *p);
- int mod_dirlisting_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("dirlisting");
+               if (du->type != TYPE_ARRAY) {
 Index: src/mod_magnet.c
 ===================================================================
---- src/mod_magnet.c   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/mod_magnet.c   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -365,6 +365,8 @@
-               MAGNET_ENV_REQUEST_METHOD,
-               MAGNET_ENV_REQUEST_URI,
-               MAGNET_ENV_REQUEST_ORIG_URI,
-+              MAGNET_ENV_REQUEST_PATH_INFO,
-+              MAGNET_ENV_REQUEST_REMOTE_IP,
-               MAGNET_ENV_REQUEST_PROTOCOL
-               } type;
- } magnet_env_t;
-@@ -387,6 +389,8 @@
-               { "request.method", MAGNET_ENV_REQUEST_METHOD },
-               { "request.uri", MAGNET_ENV_REQUEST_URI },
-               { "request.orig-uri", MAGNET_ENV_REQUEST_ORIG_URI },
-+              { "request.path-info", MAGNET_ENV_REQUEST_PATH_INFO },
-+              { "request.remote-ip", MAGNET_ENV_REQUEST_REMOTE_IP },
-               { "request.protocol", MAGNET_ENV_REQUEST_PROTOCOL },
-               { NULL, MAGNET_ENV_UNSET }
-@@ -420,6 +424,8 @@
-               break;
-       case MAGNET_ENV_REQUEST_URI:      dest = con->request.uri; break;
-       case MAGNET_ENV_REQUEST_ORIG_URI: dest = con->request.orig_uri; break;
-+      case MAGNET_ENV_REQUEST_PATH_INFO: dest = con->request.pathinfo; break;
-+      case MAGNET_ENV_REQUEST_REMOTE_IP: dest = con->dst_addr_buf; break;
-       case MAGNET_ENV_REQUEST_PROTOCOL:
-               buffer_copy_string(srv->tmp_buf, get_http_version_name(con->request.http_version));
-               dest = srv->tmp_buf;
-@@ -840,6 +846,7 @@
- /* this function is called at dlopen() time and inits the callbacks */
-+int mod_magnet_plugin_init(plugin *p);
- int mod_magnet_plugin_init(plugin *p) {
-       p->version     = LIGHTTPD_VERSION_ID;
-       p->name        = buffer_init_string("magnet");
-@@ -856,6 +863,7 @@
+--- src/mod_magnet.c   (.../tags/lighttpd-1.4.23)
++++ src/mod_magnet.c   (.../branches/lighttpd-1.4.x)
+@@ -283,17 +283,11 @@
  }
  
- #else
-+int mod_magnet_plugin_init(plugin *p);
- int mod_magnet_plugin_init(plugin *p) {
-       UNUSED(p);
-       return -1;
+ static int magnet_reqhdr_get(lua_State *L) {
+-      server *srv;
+       connection *con;
+       data_string *ds;
+       const char *key = luaL_checkstring(L, 2);
+-      lua_pushstring(L, "lighty.srv");
+-      lua_gettable(L, LUA_REGISTRYINDEX);
+-      srv = lua_touserdata(L, -1);
+-      lua_pop(L, 1);
+-
+       lua_pushstring(L, "lighty.con");
+       lua_gettable(L, LUA_REGISTRYINDEX);
+       con = lua_touserdata(L, -1);
 Index: src/log.c
 ===================================================================
---- src/log.c  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/log.c  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -54,13 +54,94 @@
-       return (tmpfd != -1) ? 0 : -1;
- }
+--- src/log.c  (.../tags/lighttpd-1.4.23)
++++ src/log.c  (.../branches/lighttpd-1.4.x)
+@@ -62,7 +62,6 @@
+               /* create write pipe and spawn process */
  
-+int open_logfile_or_pipe(server *srv, const char* logfile) {
-+      int fd;
-+
-+      if (logfile[0] == '|') {
-+#ifdef HAVE_FORK
-+              /* create write pipe and spawn process */
-+
-+              int to_log_fds[2];
-+              pid_t pid;
-+              int i;
-+
-+              if (pipe(to_log_fds)) {
-+                      log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
-+                      return -1;
-+              }
-+
-+              /* fork, execve */
-+              switch (pid = fork()) {
-+              case 0:
-+                      /* child */
-+                      close(STDIN_FILENO);
-+
-+                      /* dup the filehandle to STDIN */
-+                      if (to_log_fds[0] != STDIN_FILENO) {
-+                              if (STDIN_FILENO != dup2(to_log_fds[0], STDIN_FILENO)) {
-+                                      log_error_write(srv, __FILE__, __LINE__, "ss",
-+                                              "dup2 failed: ", strerror(errno));
-+                                      exit(-1);
-+                              }
-+                              close(to_log_fds[0]);
-+                      }
-+                      close(to_log_fds[1]);
-+
-+#ifndef FD_CLOEXEC
-+                      /* we don't need the client socket */
-+                      for (i = 3; i < 256; i++) {
-+                              close(i);
-+                      }
-+#endif
-+
-+                      /* close old stderr */
-+                      openDevNull(STDERR_FILENO);
-+
-+                      /* exec the log-process (skip the | ) */
-+                      execl("/bin/sh", "sh", "-c", logfile + 1, NULL);
-+                      log_error_write(srv, __FILE__, __LINE__, "sss",
-+                                      "spawning log process failed: ", strerror(errno),
-+                                      logfile + 1);
-+
-+                      exit(-1);
-+                      break;
-+              case -1:
-+                      /* error */
-+                      log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
-+                      return -1;
-+              default:
-+                      close(to_log_fds[0]);
-+                      fd = to_log_fds[1];
-+                      break;
-+              }
-+
-+#else
-+              return -1;
-+#endif
-+      } else if (-1 == (fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
-+              log_error_write(srv, __FILE__, __LINE__, "SSSS",
-+                              "opening errorlog '", logfile,
-+                              "' failed: ", strerror(errno));
-+
-+              return -1;
-+      }
-+
-+#ifdef FD_CLOEXEC
-+      fcntl(fd, F_SETFD, FD_CLOEXEC);
-+#endif
-+
-+      return fd;
-+}
-+
-+
- /**
-  * open the errorlog
-  *
-- * we have 3 possibilities:
-+ * we have 4 possibilities:
-  * - stderr (default)
-  * - syslog
-  * - logfile
-+ * - pipe
-  *
-  * if the open failed, report to the user and die
-  *
-@@ -80,18 +161,10 @@
-       } else if (!buffer_is_empty(srv->srvconf.errorlog_file)) {
-               const char *logfile = srv->srvconf.errorlog_file->ptr;
+               int to_log_fds[2];
+-              pid_t pid;
  
--              if (-1 == (srv->errorlog_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
--                      log_error_write(srv, __FILE__, __LINE__, "SSSS",
--                                      "opening errorlog '", logfile,
--                                      "' failed: ", strerror(errno));
--
-+              if (-1 == (srv->errorlog_fd = open_logfile_or_pipe(srv, logfile))) {
-                       return -1;
+               if (pipe(to_log_fds)) {
+                       log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
+@@ -70,7 +69,7 @@
                }
--#ifdef FD_CLOEXEC
--              /* close fd on exec (cgi) */
--              fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
--#endif
--              srv->errorlog_mode = ERRORLOG_FILE;
-+              srv->errorlog_mode = (logfile[0] == '|') ? ERRORLOG_PIPE : ERRORLOG_FILE;
-       }
  
-       log_error_write(srv, __FILE__, __LINE__, "s", "server started");
-@@ -122,7 +195,7 @@
+               /* fork, execve */
+-              switch (pid = fork()) {
++              switch (fork()) {
+               case 0:
+                       /* child */
+                       close(STDIN_FILENO);
+@@ -150,14 +149,14 @@
   */
  
- int log_error_cycle(server *srv) {
--      /* only cycle if we are not in syslog-mode */
-+      /* only cycle if the error log is a file */
+ int log_error_open(server *srv) {
+-      int close_stderr = 1;
+-
+ #ifdef HAVE_SYSLOG_H
+       /* perhaps someone wants to use syslog() */
+       openlog("lighttpd", LOG_CONS | LOG_PID, LOG_DAEMON);
+ #endif
+-      srv->errorlog_mode = ERRORLOG_STDERR;
++      srv->errorlog_mode = ERRORLOG_FD;
++      srv->errorlog_fd = STDERR_FILENO;
++
+       if (srv->srvconf.errorlog_use_syslog) {
+               srv->errorlog_mode = ERRORLOG_SYSLOG;
+       } else if (!buffer_is_empty(srv->srvconf.errorlog_file)) {
+@@ -171,20 +170,36 @@
  
-       if (srv->errorlog_mode == ERRORLOG_FILE) {
-               const char *logfile = srv->srvconf.errorlog_file->ptr;
-@@ -130,7 +203,7 @@
+       log_error_write(srv, __FILE__, __LINE__, "s", "server started");
  
-               int new_fd;
+-#ifdef HAVE_VALGRIND_VALGRIND_H
+-      /* don't close stderr for debugging purposes if run in valgrind */
+-      if (RUNNING_ON_VALGRIND) close_stderr = 0;
+-#endif
+-
+-      if (srv->errorlog_mode == ERRORLOG_STDERR && srv->srvconf.dont_daemonize) {
++      if (srv->errorlog_mode == ERRORLOG_FD && !srv->srvconf.dont_daemonize) {
+               /* We can only log to stderr in dont-daemonize mode;
+                * if we do daemonize and no errorlog file is specified, we log into /dev/null
+                */
+-              close_stderr = 0;
++              srv->errorlog_fd = -1;
+       }
  
--              if (-1 == (new_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
-+              if (-1 == (new_fd = open_logfile_or_pipe(srv, logfile))) {
-                       /* write to old log */
-                       log_error_write(srv, __FILE__, __LINE__, "SSSSS",
-                                       "cycling errorlog '", logfile,
-@@ -158,6 +231,7 @@
+-      /* move stderr to /dev/null */
+-      if (close_stderr) openDevNull(STDERR_FILENO);
++      if (!buffer_is_empty(srv->srvconf.breakagelog_file)) {
++              int breakage_fd;
++              const char *logfile = srv->srvconf.breakagelog_file->ptr;
++
++              if (srv->errorlog_mode == ERRORLOG_FD) {
++                      srv->errorlog_fd = dup(STDERR_FILENO);
++#ifdef FD_CLOEXEC
++                      fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
++#endif
++              }
++
++              if (-1 == (breakage_fd = open_logfile_or_pipe(srv, logfile))) {
++                      return -1;
++              }
++
++              if (STDERR_FILENO != breakage_fd) {
++                      dup2(breakage_fd, STDERR_FILENO);
++                      close(breakage_fd);
++              }
++      } else if (!srv->srvconf.dont_daemonize) {
++              /* move stderr to /dev/null */
++              openDevNull(STDERR_FILENO);
++      }
+       return 0;
+ }
  
- int log_error_close(server *srv) {
+@@ -235,15 +250,19 @@
        switch(srv->errorlog_mode) {
-+      case ERRORLOG_PIPE:
+       case ERRORLOG_PIPE:
        case ERRORLOG_FILE:
-               close(srv->errorlog_fd);
+-              close(srv->errorlog_fd);
++      case ERRORLOG_FD:
++              if (-1 != srv->errorlog_fd) {
++                      /* don't close STDERR */
++                      if (STDERR_FILENO != srv->errorlog_fd)
++                              close(srv->errorlog_fd);
++                      srv->errorlog_fd = -1;
++              }
+               break;
+       case ERRORLOG_SYSLOG:
+ #ifdef HAVE_SYSLOG_H
+               closelog();
+ #endif
                break;
-@@ -177,6 +251,7 @@
-       va_list ap;
+-      case ERRORLOG_STDERR:
+-              break;
+       }
  
+       return 0;
+@@ -255,7 +274,8 @@
        switch(srv->errorlog_mode) {
-+      case ERRORLOG_PIPE:
+       case ERRORLOG_PIPE:
        case ERRORLOG_FILE:
-       case ERRORLOG_STDERR:
+-      case ERRORLOG_STDERR:
++      case ERRORLOG_FD:
++              if (-1 == srv->errorlog_fd) return 0;
                /* cache the generated timestamp */
-@@ -270,6 +345,7 @@
-       va_end(ap);
+               if (srv->cur_ts != srv->last_generated_debug_ts) {
+                       buffer_prepare_copy(srv->ts_debug_str, 255);
+@@ -349,13 +369,10 @@
        switch(srv->errorlog_mode) {
-+      case ERRORLOG_PIPE:
+       case ERRORLOG_PIPE:
        case ERRORLOG_FILE:
++      case ERRORLOG_FD:
                buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
                write(srv->errorlog_fd, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
-Index: src/log.h
+               break;
+-      case ERRORLOG_STDERR:
+-              buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
+-              write(STDERR_FILENO, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
+-              break;
+       case ERRORLOG_SYSLOG:
+               syslog(LOG_ERR, "%s", srv->errorlog_buf->ptr);
+               break;
+Index: src/proc_open.c
 ===================================================================
---- src/log.h  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/log.h  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -10,6 +10,8 @@
- #define WP() log_error_write(srv, __FILE__, __LINE__, "");
+--- src/proc_open.c    (.../tags/lighttpd-1.4.23)
++++ src/proc_open.c    (.../branches/lighttpd-1.4.x)
+@@ -309,6 +309,14 @@
  
-+int open_logfile_or_pipe(server *srv, const char* logfile);
-+
- int log_error_open(server *srv);
- int log_error_close(server *srv);
- int log_error_write(server *srv, const char *filename, unsigned int line, const char *fmt, ...);
-Index: src/fdevent.c
-===================================================================
---- src/fdevent.c      (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ src/fdevent.c      (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -92,7 +92,7 @@
-       return 0;
- }
+       if (err) {
+               proc_read_fd_to_buffer(proc.err.fd, err);
++      } else {
++              buffer *tmp = buffer_init();
++              proc_read_fd_to_buffer(proc.err.fd, tmp);
++              if (tmp->used > 0 &&  write(2, (void*)tmp->ptr, tmp->used) < 0) {
++                      perror("error writing pipe");
++                      return -1;
++              }
++              buffer_free(tmp);
+       }
+       pipe_close(&proc.err);
+Index: tests/.cvsignore
+===================================================================
+Index: tests/bug-12.conf
+===================================================================
+--- tests/bug-12.conf  (.../tags/lighttpd-1.4.23)
++++ tests/bug-12.conf  (.../branches/lighttpd-1.4.x)
+@@ -8,6 +8,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
+Index: tests/fastcgi-10.conf
+===================================================================
+--- tests/fastcgi-10.conf      (.../tags/lighttpd-1.4.23)
++++ tests/fastcgi-10.conf      (.../branches/lighttpd-1.4.x)
+@@ -6,6 +6,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
+Index: tests/bug-06.conf
+===================================================================
+--- tests/bug-06.conf  (.../tags/lighttpd-1.4.23)
++++ tests/bug-06.conf  (.../branches/lighttpd-1.4.x)
+@@ -8,6 +8,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
+Index: tests/mod-extforward.conf
+===================================================================
+Index: tests/var-include.conf
+===================================================================
+--- tests/var-include.conf     (.../tags/lighttpd-1.4.23)
++++ tests/var-include.conf     (.../branches/lighttpd-1.4.x)
+@@ -10,6 +10,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
+Index: tests/404-handler.conf
+===================================================================
+--- tests/404-handler.conf     (.../tags/lighttpd-1.4.23)
++++ tests/404-handler.conf     (.../branches/lighttpd-1.4.x)
+@@ -10,6 +10,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
+Index: tests/lowercase.conf
+===================================================================
+--- tests/lowercase.conf       (.../tags/lighttpd-1.4.23)
++++ tests/lowercase.conf       (.../branches/lighttpd-1.4.x)
+@@ -6,6 +6,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.force-lowercase-filenames = "enable"
+Index: tests/condition.conf
+===================================================================
+--- tests/condition.conf       (.../tags/lighttpd-1.4.23)
++++ tests/condition.conf       (.../branches/lighttpd-1.4.x)
+@@ -10,6 +10,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
+Index: tests/fastcgi-13.conf
+===================================================================
+--- tests/fastcgi-13.conf      (.../tags/lighttpd-1.4.23)
++++ tests/fastcgi-13.conf      (.../branches/lighttpd-1.4.x)
+@@ -10,6 +10,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
+Index: tests/mod-compress.conf
+===================================================================
+--- tests/mod-compress.conf    (.../tags/lighttpd-1.4.23)
++++ tests/mod-compress.conf    (.../branches/lighttpd-1.4.x)
+@@ -11,6 +11,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.modules = (
+Index: tests/lighttpd.conf
+===================================================================
+--- tests/lighttpd.conf        (.../tags/lighttpd-1.4.23)
++++ tests/lighttpd.conf        (.../branches/lighttpd-1.4.x)
+@@ -13,6 +13,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
  
--fdnode *fdnode_init() {
-+static fdnode *fdnode_init() {
-       fdnode *fdn;
+Index: tests/fastcgi-responder.conf
+===================================================================
+--- tests/fastcgi-responder.conf       (.../tags/lighttpd-1.4.23)
++++ tests/fastcgi-responder.conf       (.../branches/lighttpd-1.4.x)
+@@ -15,6 +15,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
+Index: tests/fastcgi-auth.conf
+===================================================================
+--- tests/fastcgi-auth.conf    (.../tags/lighttpd-1.4.23)
++++ tests/fastcgi-auth.conf    (.../branches/lighttpd-1.4.x)
+@@ -12,6 +12,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Apache 1.3.29"
+Index: tests/proxy.conf
+===================================================================
+--- tests/proxy.conf   (.../tags/lighttpd-1.4.23)
++++ tests/proxy.conf   (.../branches/lighttpd-1.4.x)
+@@ -6,6 +6,7 @@
+ ## bind to localhost (default: all interfaces)
+ server.bind                = "localhost"
+ server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
+ server.name                = "www.example.org"
+ server.tag                 = "Proxy"
  
-       fdn = calloc(1, sizeof(*fdn));
-@@ -100,7 +100,7 @@
-       return fdn;
- }
+Index: tests/LightyTest.pm
+===================================================================
+--- tests/LightyTest.pm        (.../tags/lighttpd-1.4.23)
++++ tests/LightyTest.pm        (.../branches/lighttpd-1.4.x)
+@@ -87,14 +87,21 @@
+       my $self = shift;
+       my $port = shift;
+       my $child = shift;
++      my $timeout = 5*10; # 5 secs, select waits 0.1 s
  
--void fdnode_free(fdnode *fdn) {
-+static void fdnode_free(fdnode *fdn) {
-       free(fdn);
- }
+       while (0 == $self->listening_on($port)) {
+               select(undef, undef, undef, 0.1);
++              $timeout--;
  
-Index: tests/fcgi-responder.c
-===================================================================
---- tests/fcgi-responder.c     (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ tests/fcgi-responder.c     (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -40,7 +40,13 @@
-                       printf("Status: 500 Internal Foo\r\n\r\n");
+               # the process is gone, we failed
+               if (0 != waitpid($child, WNOHANG)) {
+                       return -1;
                }
--              printf("test123");
-+              if (0 == strcmp(p, "path_info")) {
-+                      printf("%s", getenv("PATH_INFO"));
-+              } else if (0 == strcmp(p, "script_name")) {
-+                      printf("%s", getenv("SCRIPT_NAME"));
-+              } else {
-+                      printf("test123");
++              if (0 >= $timeout) {
++                      diag("Timeout while trying to connect; killing child");
++                      kill('TERM', $child);
++                      return -1;
 +              }
        }
  
        return 0;
-Index: tests/mod-fastcgi.t
+Index: configure.ac
 ===================================================================
---- tests/mod-fastcgi.t        (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ tests/mod-fastcgi.t        (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -7,7 +7,7 @@
- }
+Index: doc/.cvsignore
+===================================================================
+Index: doc/fastcgi.txt
+===================================================================
+--- doc/fastcgi.txt    (.../tags/lighttpd-1.4.23)
++++ doc/fastcgi.txt    (.../branches/lighttpd-1.4.x)
+@@ -95,23 +95,22 @@
+       (
+         ( "host" => <string> ,
+           "port" => <integer> ,
+-        "socket" => <string>,       # either socket
+-                                    # or host+port
+-        "bin-path" => <string>,     # OPTIONAL
+-        "bin-environment" => <array>, # OPTIONAL
+-        "bin-copy-environment" => <array>, # OPTIONAL
++          "socket" => <string>,       # either socket
++                                      # or host+port
++          "bin-path" => <string>,     # OPTIONAL
++          "bin-environment" => <array>, # OPTIONAL
++          "bin-copy-environment" => <array>, # OPTIONAL
+           "mode" => <string>,         # OPTIONAL
+           "docroot" => <string> ,     # OPTIONAL if "mode"
+-                                    # is not "authorizer"
++                                      # is not "authorizer"
+           "check-local" => <string>,  # OPTIONAL
+-        "min-procs" => <integer>,   # OPTIONAL
+-        "max-procs" => <integer>,   # OPTIONAL
+-        "max-load-per-proc" => <integer>, # OPTIONAL
+-        "idle-timeout" => <integer>, # OPTIONAL
+-        "broken-scriptfilename" => <boolean>, # OPTIONAL
++          "max-procs" => <integer>,   # OPTIONAL
++          "broken-scriptfilename" => <boolean>, # OPTIONAL
+           "disable-time" => <integer>, # optional
+-          "allow-x-send-file" => <boolean> # optional
+-      ),
++          "allow-x-send-file" => <boolean>, # optional
++          "kill-signal" => <integer>, # OPTIONAL
++          "fix-root-scriptname" => <boolean>,
++                                      # OPTIONAL
+         ( "host" => ...
+         )
+       )
+@@ -127,42 +126,38 @@
+   :"socket":    path to the unix-domain socket
+   :"mode":      is the FastCGI protocol mode.
+                 Default is "responder", also "authorizer"
+-              mode is implemented.
++                mode is implemented.
+   :"docroot":   is optional and is the docroot on the remote
+                 host for default "responder" mode. For
+-              "authorizer" mode it is MANDATORY and it points
+-              to docroot for authorized requests. For security
+-              reasons it is recommended to keep this docroot
++                "authorizer" mode it is MANDATORY and it points
++                to docroot for authorized requests. For security
++                reasons it is recommended to keep this docroot
+                 outside of server.document-root tree.
+   :"check-local": is optional and may be "enable" (default) or
+                 "disable". If enabled the server first check
+-              for a file in local server.document-root tree
+-              and return 404 (Not Found) if no such file.
++                for a file in local server.document-root tree
++                and return 404 (Not Found) if no such file.
+                 If disabled, the server forward request to
+-              FastCGI interface without this check.
++                FastCGI interface without this check.
+   :"broken-scriptfilename": breaks SCRIPT_FILENAME in a wat that
+                 PHP can extract PATH_INFO from it (default: disabled)
+   :"disable-time": time to wait before a disabled backend is checked
+                 again
+   :"allow-x-send-file": controls if X-LIGHTTPD-send-file headers
+                 are allowed
++  :"fix-root-scriptname": fix broken path-info split for "/" extension ("prefix")
+   If bin-path is set:
+-  :"min-procs": sets the minium processes to start
+   :"max-procs": the upper limit of the processess to start
+-  :"max-load-per-proc": maximum number of waiting processes on
+-                average per process before a new process is
+-                spawned
+-  :"idle-timeout": number of seconds before a unused process
+-                gets terminated
+   :"bin-environment": put an entry into the environment of
+                 the started process
+   :"bin-copy-environement": clean up the environment and copy
+                 only the specified entries into the fresh
+                 environment of the spawn process
++  :"kill-signal": signal to terminate the FastCGI process with,
++                defauls to SIGTERM
+-
+ Examples
+ --------
+@@ -171,11 +166,11 @@
+     fastcgi.server = ( ".php" =>
+       (( "host" => "127.0.0.1",
+          "port" => 1026,
+-       "bin-path" => "/usr/local/bin/php"
++         "bin-path" => "/usr/local/bin/php"
+       )),
+       ".php4" =>
+       (( "host" => "127.0.0.1",
+-       "port" => 1026
++         "port" => 1026
+       ))
+     )
+@@ -183,10 +178,10 @@
+     fastcgi.server = ( "/remote_scripts/" =>
+       (( "host" => "192.168.0.3",
+-       "port" => 9000,
++         "port" => 9000,
+          "check-local" => "disable",
+          "docroot" => "/" # remote server may use
+-                        # it's own docroot
++                          # it's own docroot
+       ))
+     )
+@@ -206,7 +201,7 @@
+     fastcgi.server = ( "/remote_scripts/" =>
+       (( "host" => "10.0.0.2",
+-       "port" => 9000,
++         "port" => 9000,
+          "docroot" => "/path_to_private_docs",
+          "mode" => "authorizer"
+       ))
+@@ -318,10 +313,10 @@
+      $ PHP_FCGI_CHILDREN=384 ./lighttpd -f ./lighttpd.conf
+      fastcgi.server = ( ".php" =>
+-      (( "socket" => "/tmp/php.socket",
++        (( "socket" => "/tmp/php.socket",
+            "bin-path" => "/usr/local/bin/php",
+            "min-procs" => 1,
+-         "max-procs" => 1,
++           "max-procs" => 1,
+            "max-load-per-proc" => 4,
+            "idle-timeout" => 20
+         ))
+@@ -408,7 +403,7 @@
+            "PHP_FCGI_CHILDREN" => "16",
+            "PHP_FCGI_MAX_REQUESTS" => "10000" ),
+         "bin-copy-environment" => (
+-         "PATH", "SHELL", "USER" )
++           "PATH", "SHELL", "USER" )
+      ))
+    )
  
- use strict;
--use Test::More tests => 50;
-+use Test::More tests => 52;
- use LightyTest;
+Index: SConstruct
+===================================================================
+Index: Makefile.am
+===================================================================
+--- Makefile.am        (.../tags/lighttpd-1.4.23)
++++ Makefile.am        (.../branches/lighttpd-1.4.x)
+@@ -2,4 +2,6 @@
  
- my $tf = LightyTest->new();
-@@ -166,7 +166,7 @@
-       $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo/bar' } ];
-       ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off');
+ EXTRA_DIST=autogen.sh SConstruct
  
--      
++ACLOCAL_AMFLAGS = -I m4
 +
-       ok($tf->stop_proc == 0, "Stopping lighttpd");
+ distcleancheck_listfiles = find -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';'
+Index: autogen.sh
+===================================================================
+--- autogen.sh (.../tags/lighttpd-1.4.23)
++++ autogen.sh (.../branches/lighttpd-1.4.x)
+@@ -1,27 +1,92 @@
+ #!/bin/sh
+ # Run this to generate all the initial makefiles, etc.
  
-@@ -282,7 +282,7 @@
+-LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
+ LIBTOOLIZE_FLAGS="--copy --force"
+-ACLOCAL=${ACLOCAL:-aclocal}
+-AUTOHEADER=${AUTOHEADER:-autoheader}
+-AUTOMAKE=${AUTOMAKE:-automake}
+-AUTOMAKE_FLAGS="--add-missing --copy"
+-AUTOCONF=${AUTOCONF:-autoconf}
++AUTOMAKE_FLAGS="--add-missing --copy --foreign"
  
+ ARGV0=$0
++ARGS="$@"
  
- SKIP: {
--      skip "no fcgi-responder found", 9 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe"; 
-+      skip "no fcgi-responder found", 11 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe";
-       
-       $tf->{CONFIGFILE} = 'fastcgi-responder.conf';
-       ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
-@@ -319,6 +319,23 @@
-       ok($tf->handle_http($t) == 0, 'line-ending \r\n + \r\n');
+-set -e
  
-       $t->{REQUEST}  = ( <<EOF
-+GET /abc/def/ghi?path_info HTTP/1.0
-+Host: wsgi.example.org
-+EOF
-+ );
-+      $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/abc/def/ghi' } ];
-+      ok($tf->handle_http($t) == 0, 'PATH_INFO (wsgi)');
-+
-+      $t->{REQUEST}  = ( <<EOF
-+GET /abc/def/ghi?script_name HTTP/1.0
-+Host: wsgi.example.org
-+EOF
-+ );
-+      $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '' } ];
-+      ok($tf->handle_http($t) == 0, 'SCRIPT_NAME (wsgi)');
-+
-+
-+      $t->{REQUEST}  = ( <<EOF
- GET /index.fcgi?die-at-end HTTP/1.0
- Host: www.example.org
- EOF
-Index: tests/fastcgi-responder.conf
-===================================================================
---- tests/fastcgi-responder.conf       (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ tests/fastcgi-responder.conf       (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -159,3 +159,15 @@
-   server.name = "zzz.example.org"
+-
+ run() {
+-      echo "$ARGV0: running \`$@'"
+-      $@
++      echo "$ARGV0: running \`$@' $ARGS"
++      $@ $ARGS
  }
  
-+$HTTP["host"] == "wsgi.example.org" {
-+      fastcgi.server = (
-+              "/"  =>
-+                      ( (
-+                              "host" => "127.0.0.1", "port" => 10000,
-+                              "fix-root-scriptname" => "enable",
-+                              "check-local" => "disable",
-+                              "bin-path" => env.SRCDIR + "/fcgi-responder",
-+                              "max-procs" => 1,
-+                      ) ),
-+      )
-+}
-Index: tests/LightyTest.pm
-===================================================================
---- tests/LightyTest.pm        (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ tests/LightyTest.pm        (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -6,7 +6,8 @@
- use Test::More;
- use Socket;
- use Cwd 'abs_path';
--use POSIX ":sys_wait_h";
-+use POSIX qw(:sys_wait_h dup2);
-+use Errno qw(EADDRINUSE);
- sub mtime {
-       my $file = shift;
-@@ -344,8 +345,14 @@
-               return -1;
-       }
-       if ($child == 0) {
--              my $cmd = $self->{BINDIR}.'/spawn-fcgi -n -p '.$port.' -f "'.$binary.'"';
--              exec $cmd or die($?);
-+              my $iaddr   = inet_aton('localhost') || die "no host: localhost";
-+              my $proto   = getprotobyname('tcp');
-+              socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
-+              setsockopt(SOCK, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) || die "setsockopt: $!";
-+              bind(SOCK, sockaddr_in($port, $iaddr)) || die "bind: $!";
-+              listen(SOCK, 1024) || die "listen: $!";
-+              dup2(fileno(SOCK), 0) || die "dup2: $!";
-+              exec $binary or die($?);
-       } else {
-               if (0 != $self->wait_for_port_with_proc($port, $child)) {
-                       diag(sprintf('The process %i is not up (port %i, %s)', $child, $port, $binary));
-Index: configure.ac
-===================================================================
---- configure.ac       (.../tags/lighttpd-1.4.22)      (revision 0)
-+++ configure.ac       (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -0,0 +1,714 @@
-+#                                               -*- Autoconf -*-
-+# Process this file with autoconf to produce a configure script.
-+AC_PREREQ(2.57)
-+AC_INIT([lighttpd], [1.4.23], [jan@kneschke.de])
-+AC_CONFIG_SRCDIR([src/server.c])
-+AC_CONFIG_HEADER([config.h])
-+
-+AC_CANONICAL_TARGET
-+
-+AM_INIT_AUTOMAKE
-+
-+# Checks for programs.
-+AC_PROG_CC
-+AM_PROG_CC_C_O
-+AC_PROG_LD
-+AC_PROG_INSTALL
-+AC_PROG_AWK
-+AC_PROG_CPP
-+dnl AC_PROG_CXX
-+AC_PROG_LN_S
-+AC_PROG_MAKE_SET
-+
-+dnl check environment
-+AC_AIX
-+AC_ISC_POSIX
-+AC_MINIX
-+
-+dnl AC_CANONICAL_HOST
-+case $host_os in
-+      *darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;;
-+        * ) NO_RDYNAMIC=no;;
-+esac
-+AM_CONDITIONAL(NO_RDYNAMIC, test x$NO_RDYNAMIC = xyes)
-+
-+AC_EXEEXT
-+
-+dnl more automake stuff
-+AM_C_PROTOTYPES
-+
-+dnl libtool
-+AC_DISABLE_STATIC
-+AC_ENABLE_SHARED
-+
-+AC_LIBTOOL_DLOPEN
-+AC_PROG_LIBTOOL
-+
-+dnl for solaris
-+CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
-+
-+# Checks for header files.
-+AC_HEADER_STDC
-+AC_HEADER_SYS_WAIT
-+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
-+sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \
-+getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
-+sys/mman.h sys/event.h sys/port.h pwd.h sys/syslimits.h \
-+sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h])
-+
-+# Checks for typedefs, structures, and compiler characteristics.
-+AC_C_CONST
-+AC_C_INLINE
-+AC_C_CHAR_UNSIGNED
-+AC_TYPE_OFF_T
-+AC_TYPE_PID_T
-+AC_TYPE_SIZE_T
-+
-+AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
-+AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>])
-+AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
-+#include <sys/socket.h>])
++## jump out if one of the programs returns 'false'
++set -e
 +
-+# Checks for library functions.
-+AC_FUNC_FORK
-+dnl AC_FUNC_MALLOC
-+#AC_FUNC_MMAP
-+dnl AC_FUNC_REALLOC
-+AC_TYPE_SIGNAL
-+AC_FUNC_STAT
-+AC_FUNC_STRFTIME
-+AC_CHECK_FUNCS([issetugid])
-+
-+dnl Checks for database.
-+MYSQL_INCLUDE=""
-+MYSQL_LIBS=""
-+
-+AC_MSG_CHECKING(for MySQL support)
-+AC_ARG_WITH(mysql,
-+    AC_HELP_STRING([--with-mysql@<:@=PATH@:>@],[Include MySQL support. PATH is the path to 'mysql_config']),
-+    [WITH_MYSQL=$withval],[WITH_MYSQL=no])
-+
-+if test "$WITH_MYSQL" != "no"; then
-+  AC_MSG_RESULT(yes)
-+  if test "$WITH_MYSQL" = "yes"; then
-+    AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
-+  else
-+    MYSQL_CONFIG=$WITH_MYSQL
-+  fi
-+
-+  if test "$MYSQL_CONFIG" = ""; then
-+    AC_MSG_ERROR(mysql_config is not found)
-+  fi
-+  if test \! -x $MYSQL_CONFIG; then
-+    AC_MSG_ERROR(mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config)
-+  fi
-+
-+  if $MYSQL_CONFIG | grep -- '--include' > /dev/null ; then
-+    MYSQL_INCLUDE="`$MYSQL_CONFIG --include | sed s/\'//g`"
-+  else
-+    MYSQL_INCLUDE="`$MYSQL_CONFIG --cflags | sed s/\'//g`"
-+  fi
-+  MYSQL_LIBS="`$MYSQL_CONFIG --libs | sed s/\'//g`"
-+
-+  AC_MSG_CHECKING(for MySQL includes at)
-+  AC_MSG_RESULT($MYSQL_INCLUDE)
-+
-+  AC_MSG_CHECKING(for MySQL libraries at)
-+  AC_MSG_RESULT($MYSQL_LIBS)
-+dnl check for errmsg.h, which isn't installed by some versions of 3.21
-+  old_CPPFLAGS="$CPPFLAGS"
-+  CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
-+  AC_CHECK_HEADERS(errmsg.h mysql.h)
-+  CPPFLAGS="$old_CPPFLAGS"
-+
-+  AC_DEFINE([HAVE_MYSQL], [1], [mysql support])
-+else
-+  AC_MSG_RESULT(no)
-+fi
-+
-+AC_SUBST(MYSQL_LIBS)
-+AC_SUBST(MYSQL_INCLUDE)
-+
-+dnl Check for LDAP
-+AC_MSG_CHECKING(for LDAP support)
-+AC_ARG_WITH(ldap, AC_HELP_STRING([--with-ldap],[enable LDAP support]),
-+[WITH_LDAP=$withval], [WITH_LDAP=no])
-+AC_MSG_RESULT([$withval])
-+if test "$WITH_LDAP" != "no"; then
-+ AC_CHECK_LIB(ldap, ldap_bind, [
-+  AC_CHECK_HEADERS([ldap.h],[
-+    LDAP_LIB=-lldap
-+    AC_DEFINE([HAVE_LIBLDAP], [1], [libldap])
-+    AC_DEFINE([HAVE_LDAP_H], [1])
-+    AC_DEFINE([LDAP_DEPRECATED], [1], [Using deprecated ldap api])
-+  ])
-+ ])
-+ AC_SUBST(LDAP_LIB)
-+ AC_CHECK_LIB(lber, ber_printf, [
-+  AC_CHECK_HEADERS([lber.h],[
-+    LBER_LIB=-llber
-+    AC_DEFINE([HAVE_LIBLBER], [1], [liblber])
-+    AC_DEFINE([HAVE_LBER_H], [1])
-+  ])
-+ ])
-+ AC_SUBST(LBER_LIB)
-+fi
-+
-+dnl Check for xattr
-+AC_MSG_CHECKING(for extended attributes support)
-+AC_ARG_WITH(attr, AC_HELP_STRING([--with-attr],[enable extended attribute support]),
-+[WITH_ATTR=$withval],[WITH_ATTR=no])
-+AC_MSG_RESULT($withval)
-+if test "$WITH_ATTR" != "no"; then
-+ AC_CHECK_LIB(attr, attr_get, [
-+      AC_CHECK_HEADERS([attr/attributes.h],[
-+              ATTR_LIB=-lattr
-+              AC_DEFINE([HAVE_XATTR], [1], [libattr])
-+              AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1])
-+      ])
-+ ])
-+ AC_SUBST(ATTR_LIB)
-+fi
-+
-+## openssl on solaris needs -lsocket -lnsl
-+AC_SEARCH_LIBS(socket,socket)
-+AC_SEARCH_LIBS(gethostbyname,nsl socket)
-+AC_SEARCH_LIBS(hstrerror,resolv)
-+
-+save_LIBS=$LIBS
-+AC_SEARCH_LIBS(dlopen,dl,[
-+  AC_CHECK_HEADERS([dlfcn.h],[
-+    if test "$ac_cv_search_dlopen" != no; then
-+      test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen"
-+    fi
-+
-+    AC_DEFINE([HAVE_LIBDL], [1], [libdl])
-+    AC_DEFINE([HAVE_DLFCN_H], [1])
-+  ])
-+])
-+LIBS=$save_LIBS
-+AC_SUBST(DL_LIB)
-+
-+dnl Check for valgrind
-+AC_MSG_CHECKING(for valgrind)
-+AC_ARG_WITH(valgrind, AC_HELP_STRING([--with-valgrind],[enable internal support for valgrind]),
-+[WITH_VALGRIND=$withval],[WITH_VALGRIND=no])
-+AC_MSG_RESULT([$WITH_VALGRIND])
-+if test "$WITH_VALGRIND" != "no"; then
-+ AC_CHECK_HEADERS([valgrind/valgrind.h])
-+fi
-+
-+dnl Check for openssl
-+AC_MSG_CHECKING(for OpenSSL)
-+AC_ARG_WITH(openssl,
-+    AC_HELP_STRING([--with-openssl@<:@=DIR@:>@],[Include openssl support (default no)]),
-+    [WITH_OPENSSL=$withval],[WITH_OPENSSL=no])
-+
-+if test "$WITH_OPENSSL" != "no"; then
-+    use_openssl=yes
-+    if test "$WITH_OPENSSL" != "yes"; then
-+      CPPFLAGS="$CPPFLAGS -I$WITH_OPENSSL/include"
-+      LDFLAGS="$LDFLAGS -L$WITH_OPENSSL/lib"
-+    fi
-+else
-+    use_openssl=no
-+fi
-+AC_MSG_RESULT([$use_openssl])
-+
-+AC_ARG_WITH(openssl-includes,
-+    AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
-+    [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
-+)
-+
-+AC_ARG_WITH(openssl-libs,
-+    AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
-+    [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
-+)
-+
-+AC_ARG_WITH(kerberos5,
-+    AC_HELP_STRING([--with-kerberos5],[use Kerberos5 support with OpenSSL]),
-+    [ use_kerberos=yes ], [use_kerberos=no]
-+)
-+
-+if test "x$use_openssl" = "xyes"; then
-+    if test "x$use_kerberos" != "xyes"; then
-+        CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
-+    fi
-+
-+    AC_CHECK_HEADERS([openssl/ssl.h])
-+    OLDLIBS="$LIBS"
-+    AC_CHECK_LIB(crypto, BIO_f_base64, [
-+      AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto"
-+                               AC_DEFINE(HAVE_LIBSSL, [], [Have libssl]) ], [], [ -lcrypto "$DL_LIB" ])
-+    ], [], [])
-+    LIBS="$OLDLIBS"
-+    AC_SUBST(SSL_LIB)
-+fi
-+
-+AC_MSG_CHECKING(for perl regular expressions support)
-+AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes)]),
-+    [WITH_PCRE=$withval],[WITH_PCRE=yes])
-+AC_MSG_RESULT([$WITH_PCRE])
-+
-+if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then
-+  AC_PATH_PROG(PCRECONFIG, pcre-config)
-+
-+  if test x"$PCRECONFIG" != x; then
-+    PCRE_LIB=`$PCRECONFIG --libs`
-+    CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
-+    AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
-+    AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
-+  else
-+     AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
-+  fi
-+fi
-+
-+AC_SUBST(PCRE_LIB)
-+
-+AC_MSG_CHECKING(for zlib support)
-+AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib],[Enable zlib support for mod_compress]),
-+    [WITH_ZLIB=$withval],[WITH_ZLIB=yes])
-+AC_MSG_RESULT([$WITH_ZLIB])
-+
-+if test "$WITH_ZLIB" != "no"; then
-+  AC_CHECK_LIB(z, deflate, [
-+    AC_CHECK_HEADERS([zlib.h],[
-+      Z_LIB=-lz
-+      AC_DEFINE([HAVE_LIBZ], [1], [libz])
-+      AC_DEFINE([HAVE_ZLIB_H], [1])
-+    ])
-+  ])
-+  if test x$Z_LIB = x; then
-+     AC_MSG_ERROR([zlib-headers and/or libs where not found, install them or build with --without-zlib])
++## on macosx glibtoolize, others have libtool
++if test x$LIBTOOLIZE = x; then
++  if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
++    LIBTOOLIZE=glibtoolize
++  elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
++    LIBTOOLIZE=libtoolize-1.5
++  elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
++    LIBTOOLIZE=libtoolize
++  else 
++    echo "libtoolize 1.5.x wasn't found, exiting"; exit 0
 +  fi
 +fi
-+AC_SUBST(Z_LIB)
 +
-+AC_MSG_CHECKING(for bzip2 support)
-+AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2],[Enable bzip2 support for mod_compress]),
-+    [WITH_BZIP2=$withval],[WITH_BZIP2=yes])
-+AC_MSG_RESULT([$WITH_BZIP2])
-+
-+if test "$WITH_BZIP2" != "no"; then
-+  AC_CHECK_LIB(bz2, BZ2_bzCompress, [
-+    AC_CHECK_HEADERS([bzlib.h],[
-+      BZ_LIB=-lbz2
-+      AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2])
-+      AC_DEFINE([HAVE_BZLIB_H], [1])
-+    ])
-+  ])
-+  if test x$BZ_LIB = x; then
-+     AC_MSG_ERROR([bzip2-headers and/or libs where not found, install them or build with --without-bzip2])
++## suse has aclocal and aclocal-1.9
++if test x$ACLOCAL = x; then
++  if test \! "x`which aclocal-1.9 2> /dev/null | grep -v '^no'`" = x; then
++    ACLOCAL=aclocal-1.9
++  elif test \! "x`which aclocal19 2> /dev/null | grep -v '^no'`" = x; then
++    ACLOCAL=aclocal19
++  elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
++    ACLOCAL=aclocal
++  else 
++    echo "automake 1.9.x (aclocal) wasn't found, exiting"; exit 0
 +  fi
 +fi
-+AC_SUBST(BZ_LIB)
-+
-+if test -z "$PKG_CONFIG"; then
-+  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-+fi
-+
-+dnl Check for gamin
-+AC_MSG_CHECKING(for FAM)
-+AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]),
-+[WITH_FAM=$withval],[WITH_FAM=no])
-+AC_MSG_RESULT([$WITH_FAM])
 +
-+if test "$WITH_FAM" != "no"; then
-+  AC_CHECK_LIB(fam, FAMOpen2, [
-+    AC_CHECK_HEADERS([fam.h],[
-+      FAM_LIBS=-lfam
-+      AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
-+      AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
-+    ])
-+  ])
-+  if test "x$FAM_LIBS" = x; then
-+    PKG_CHECK_MODULES(FAM, gamin >= 0.1.0, [
-+      AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
-+      AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
-+    ])
++if test x$AUTOMAKE = x; then
++  if test \! "x`which automake-1.9 2> /dev/null | grep -v '^no'`" = x; then
++    AUTOMAKE=automake-1.9
++  elif test \! "x`which automake19 2> /dev/null | grep -v '^no'`" = x; then
++    AUTOMAKE=automake19
++  elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
++    AUTOMAKE=automake
++  else 
++    echo "automake 1.9.x wasn't found, exiting"; exit 0
 +  fi
-+  OLD_LIBS=$LIBS
-+  LIBS=$FAM_LIBS
-+  AC_CHECK_FUNCS([FAMNoExists])
-+  LIBS=$OLD_LIBS
-+  
-+  if test x$FAM_LIBS = x; then
-+     AC_MSG_ERROR([fam/gamin-headers and/or libs where not found, install them or build with --without-fam])
-+  fi
-+fi
-+
-+AC_MSG_CHECKING(for properties in mod_webdav)
-+AC_ARG_WITH(webdav-props, AC_HELP_STRING([--with-webdav-props],[properties in mod_webdav]),
-+[WITH_WEBDAV_PROPS=$withval],[WITH_WEBDAV_PROPS=no])
-+AC_MSG_RESULT([$WITH_WEBDAV_PROPS])
-+
-+if test "$WITH_WEBDAV_PROPS" != "no"; then
-+ PKG_CHECK_MODULES(XML, libxml-2.0, [
-+    AC_DEFINE([HAVE_LIBXML2], [1], [libxml2])
-+    AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h])
-+ ])
-+ PKG_CHECK_MODULES(SQLITE, sqlite3, [
-+    AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
-+    AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
-+ ])
-+
-+ AC_MSG_CHECKING(for locks in mod_webdav)
-+ AC_ARG_WITH(webdav-locks, AC_HELP_STRING([--with-webdav-locks],[locks in mod_webdav]),
-+ [WITH_WEBDAV_LOCKS=$withval],[WITH_WEBDAV_LOCKS=no])
-+ AC_MSG_RESULT([$WITH_WEBDAV_LOCKS])
-+
-+ if test "$WITH_WEBDAV_LOCKS" != "no"; then
-+   AC_CHECK_LIB(uuid, uuid_unparse, [
-+         AC_CHECK_HEADERS([uuid/uuid.h],[
-+                 UUID_LIBS=-luuid
-+                 AC_DEFINE([HAVE_UUID], [1], [libuuid])
-+               AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available])
-+         ])
-+ ])
-+
-+ fi
-+fi
-+AC_SUBST(UUID_LIBS)
-+
-+dnl Check for gdbm
-+AC_MSG_CHECKING(for gdbm)
-+AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm],[gdbm storage for mod_trigger_b4_dl]),
-+[WITH_GDBM=$withval],[WITH_GDBM=no])
-+AC_MSG_RESULT([$WITH_GDBM])
-+
-+if test "$WITH_GDBM" != "no"; then
-+ AC_CHECK_LIB(gdbm, gdbm_open, [
-+         AC_CHECK_HEADERS([gdbm.h],[
-+                 GDBM_LIB=-lgdbm
-+                 AC_DEFINE([HAVE_GDBM], [1], [libgdbm])
-+               AC_DEFINE([HAVE_GDBM_H], [1])
-+         ])
-+ ])
-+ AC_SUBST(GDBM_LIB)
-+fi
-+
-+dnl Check for memcache
-+AC_MSG_CHECKING(for memcache)
-+AC_ARG_WITH(memcache, AC_HELP_STRING([--with-memcache],[memcached storage for mod_trigger_b4_dl]),
-+[WITH_MEMCACHE=$withval],[WITH_MEMCACHE=no])
-+AC_MSG_RESULT([$WITH_MEMCACHE])
-+if test "$WITH_MEMCACHE" != "no"; then
-+ AC_CHECK_LIB(memcache, mc_new, [
-+         AC_CHECK_HEADERS([memcache.h],[
-+                 MEMCACHE_LIB=-lmemcache
-+                 AC_DEFINE([HAVE_MEMCACHE], [1], [libmemcache])
-+               AC_DEFINE([HAVE_MEMCACHE_H], [1], [memcache.h])
-+         ])
-+ ])
-+ AC_SUBST(MEMCACHE_LIB)
 +fi
 +
-+dnl Check for lua
-+AC_MSG_CHECKING(if lua-support is requested)
-+AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
-+[WITH_LUA=$withval],[WITH_LUA=no])
 +
-+AC_MSG_RESULT($WITH_LUA)
-+if test "$WITH_LUA" != "no"; then
-+ if test "$WITH_LUA" = "yes"; then
-+  WITH_LUA=lua
-+ fi
-+ PKG_CHECK_MODULES(LUA, $WITH_LUA >= 5.1, [
-+   AC_DEFINE([HAVE_LUA], [1], [liblua])
-+   AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
-+ ],[
-+   # for debian based systems
-+   PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
-+     AC_DEFINE([HAVE_LUA], [1], [liblua])
-+     AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
-+   ])
-+ ])
-+
-+ AC_SUBST(LUA_CFLAGS)
-+ AC_SUBST(LUA_LIBS)
-+fi
-+
-+save_LIBS=$LIBS
-+AC_SEARCH_LIBS(crypt,crypt,[
-+  AC_CHECK_HEADERS([crypt.h],[
-+    AC_DEFINE([HAVE_CRYPT_H], [1])
-+  ])
-+
-+  AC_DEFINE([HAVE_LIBCRYPT], [1], [libcrypt])
-+  if test "$ac_cv_search_crypt" != no; then
-+    test "$ac_cv_search_crypt" = "none required" || CRYPT_LIB="$ac_cv_search_crypt"
++## macosx has autoconf-2.59 and autoconf-2.60
++if test x$AUTOCONF = x; then
++  if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
++    AUTOCONF=autoconf-2.59
++  elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
++    AUTOCONF=autoconf259
++  elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
++    AUTOCONF=autoconf
++  else 
++    echo "autoconf 2.59+ wasn't found, exiting"; exit 0
 +  fi
-+])
-+LIBS=$save_LIBS
-+AC_SUBST(CRYPT_LIB)
-+
-+save_LIBS=$LIBS
-+AC_SEARCH_LIBS(sendfilev,sendfile,[
-+  if test "$ac_cv_search_sendfilev" != no; then
-+    test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev"
-+    AC_DEFINE([HAVE_SENDFILEV], [1], [solaris sendfilev])
-+  fi
-+])
-+LIBS=$save_LIBS
-+AC_SUBST(SENDFILE_LIB)
-+
-+case $host_os in
-+      *mingw* ) LIBS="$LIBS -lwsock32";;
-+        * ) ;;
-+esac
-+
-+AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
-+                strdup strerror strstr strtol sendfile  getopt socket lstat \
-+                gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
-+                getuid select signal pathconf madvise posix_fadvise posix_madvise \
-+                writev sigaction sendfile64 send_file kqueue port_create localtime_r gmtime_r])
-+
-+AC_MSG_CHECKING(for Large File System support)
-+AC_ARG_ENABLE(lfs,
-+ AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]),
-+ [case "${enableval}" in
-+   yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
-+    no) ;;
-+     *) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;;
-+  esac],[CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
-+       enable_lfs=yes])
-+AC_MSG_RESULT($enableval)
-+
-+AC_CHECK_SIZEOF(long)
-+AC_CHECK_SIZEOF(off_t)
-+
-+if test "x$ac_cv_func_sendfile" = xyes; then
-+      # check if sendfile works
-+        AC_MSG_CHECKING(if sendfile works)
-+      if test "x$cross_compiling" = xno; then
-+      AC_TRY_RUN([
-+                  #ifdef HAVE_SYS_SENDFILE_H
-+                  #include <sys/sendfile.h>
-+                  #endif /* HAVE_SYS_SENDFILE_H */
-+                  #include <errno.h>
-+                  int main() {
-+                    int o = 0;
-+                    if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1;
-+                    return 0;
-+                  } ],
-+                  AC_MSG_RESULT(yes),
-+                  [ AC_MSG_RESULT(no)
-+                  AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) ] )
-+      else
-+            AC_MSG_RESULT(no, cross-compiling)
-+            AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])
-+      fi
 +fi
 +
-+dnl Check for IPv6 support
-+
-+AC_ARG_ENABLE(ipv6,
-+ AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
-+ [case "${enableval}" in
-+   yes) ipv6=true ;;
-+    no) ipv6=false ;;
-+     *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
-+  esac],[ipv6=true])
-+
-+if test x$ipv6 = xtrue; then
-+  AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
-+  [AC_TRY_LINK([ #include <sys/types.h>
-+#include <sys/socket.h>
-+#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ],
-+  [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
-+
-+  if test "$ac_cv_ipv6_support" = yes; then
-+    AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
++if test x$AUTOHEADER = x; then
++  if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
++    AUTOHEADER=autoheader-2.59
++  elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
++    AUTOHEADER=autoheader259
++  elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
++    AUTOHEADER=autoheader
++  else 
++    echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 0
 +  fi
 +fi
 +
-+
-+AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
-+
-+dnl check for fastcgi lib, for the tests only
-+fastcgi_found=no
-+AC_CHECK_LIB(fcgi, FCGI_Accept, [
-+ AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h],[
-+   fastcgi_found=yes
-+ ])
-+])
-+
-+AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
-+
-+
-+# check for extra compiler options (warning options)
-+if test "${GCC}" = "yes"; then
-+    CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
-+fi
-+
-+AC_ARG_ENABLE(extra-warnings,
-+ AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
-+ [case "${enableval}" in
-+   yes) extrawarnings=true ;;
-+    no) extrawarnings=false ;;
-+     *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
-+  esac],[extrawarnings=false])
-+
-+if test x$extrawarnings = xtrue; then
-+    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"
-+fi
-+
-+dnl build version-id
-+LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'`
-+AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id])
-+
-+AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile \
-+               tests/docroot/Makefile \
-+               tests/docroot/123/Makefile \
-+               tests/docroot/www/Makefile \
-+               tests/docroot/www/go/Makefile \
-+               tests/docroot/www/indexfile/Makefile \
-+               tests/docroot/www/expire/Makefile \
-+               distribute.sh])
-+AC_OUTPUT
-+
-+
-+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"
-+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"
-+
-+plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl"
-+features="regex-conditionals"
-+if test ! "x$PCRE_LIB" = x; then
-+      do_build="$do_build $plugins"
-+      enable_feature="$features"
-+else
-+      no_build="$no_build $plugins"
-+      disable_feature="$features"
-+fi
-+
-+plugins="mod_mysql_vhost"
-+if test ! "x$MYSQL_LIBS" = x; then
-+      do_build="$do_build $plugins"
-+else
-+      no_build="$no_build $plugins"
-+fi
-+
-+plugins="mod_cml mod_magnet"
-+if test ! "x$LUA_LIBS" = x; then
-+      do_build="$do_build $plugins"
-+else
-+      no_build="$no_build $plugins"
-+fi
-+
-+features="storage-gdbm"
-+if test ! "x$GDBM_LIB" = x; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+features="storage-memcache"
-+if test ! "x$MEMCACHE_LIB" = x; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+features="compress-gzip compress-deflate"
-+if test ! "x$Z_LIB" = x; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+features="compress-bzip2"
-+if test ! "x$BZ_LIB" = x; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
++mkdir -p m4
+ run $LIBTOOLIZE $LIBTOOLIZE_FLAGS
+-run $ACLOCAL $ACLOCAL_FLAGS
++run $ACLOCAL $ACLOCAL_FLAGS -I m4
+ run $AUTOHEADER
+ run $AUTOMAKE $AUTOMAKE_FLAGS
+ run $AUTOCONF
+-echo "Now type './configure ...' and 'make' to compile."
++
++if test "$ARGS" = "" ; then
++  echo "Now type './configure ...' and 'make' to compile."
 +fi
-+
-+features="auth-ldap"
-+if test ! "x$LDAP_LIB" = x; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+features="network-openssl"
-+if test ! "x$SSL_LIB" = x; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+# no crypt call
-+features="auth-crypt"
-+if test "$ac_cv_search_crypt" = no; then
-+      disable_feature="$disable_feature $features"
-+else
-+      enable_feature="$enable_feature $features"
-+fi
-+
-+features="network-ipv6"
-+if test "$ac_cv_ipv6_support" = yes; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+features="large-files"
-+if test "$enable_lfs" = yes; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+features="stat-cache-fam"
-+if test ! "x$FAM_LIBS" = x; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+features="webdav-properties"
-+if test "x$XML_LIBS" \!= x -a "x$SQLITE_LIBS" \!= x; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+features="webdav-locks"
-+if test "x$UUID_LIBS" \!= x; then
-+      enable_feature="$enable_feature $features"
-+else
-+      disable_feature="$disable_feature $features"
-+fi
-+
-+
-+## output
-+
-+$ECHO
-+$ECHO "Plugins:"
-+$ECHO
-+
-+$ECHO "enabled: "
-+for p in $do_build; do
-+      $ECHO "  $p"
-+done | sort
-+
-+$ECHO "disabled: "
-+for p in $no_build; do
-+      $ECHO "  $p"
-+done | sort
-+
-+$ECHO
-+$ECHO "Features:"
-+$ECHO
-+
-+$ECHO "enabled: "
-+for p in $enable_feature; do
-+      $ECHO "  $p"
-+done | sort
-+
-+$ECHO "disabled: "
-+for p in $disable_feature; do
-+      $ECHO "  $p"
-+done | sort
-+
-+$ECHO
-Index: doc/lighttpd.1
-===================================================================
---- doc/lighttpd.1     (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ doc/lighttpd.1     (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -1,18 +0,0 @@
--.TH LIGHTTPD 1 2003-12-21
--.SH NAME
--lighttpd - a fast, secure and flexible webserver
--.SH SYNOPSIS
--lighttpd -D -f <configfile>
--.SH DESCRIPTION
--.SH FILES
--/etc/lighttpd/lighttpd.conf
--.SH CONFORMING TO
--HTTP/1.0
--HTTP/1.0
--HTTP-Authentification - Basic, Digest
--FastCGI
--CGI/1.1
--.SH SEE ALSO
--spawn-fcgi(1)
--.SH AUTHOR
--jan@kneschke.de
-Index: doc/spawn-fcgi.1
-===================================================================
---- doc/spawn-fcgi.1   (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ doc/spawn-fcgi.1   (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -1,13 +0,0 @@
--.TH SPAWNFCGI 1 2003-12-21
--.SH NAME
--spawn-fcgi \- spawning FastCGI processes
--.SH SYNOPSIS
--spawn-fcgi -f <fastcgi-binary> [-p <port> | -s <socket>] [-C <num-of-php-procs>] [-c <chroot-dir>] [-u <username>] [-g <groupname>]
--spawn-fcgi -v
--spawn-fcgi -h
--.SH DESCRIPTION
--spawn-fcgi is used to spawn remote FastCGI processes.
--.SH SEE ALSO
--lighttpd(1)
--.SH AUTHOR
--jan@kneschke.de
-Index: doc/lighttpd.8
-===================================================================
---- doc/lighttpd.8     (.../tags/lighttpd-1.4.22)      (revision 0)
-+++ doc/lighttpd.8     (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -0,0 +1,70 @@
-+.TH LIGHTTPD "8" "2009-03-07" "" ""
-+.
-+.SH NAME
-+lighttpd \- a fast, secure and flexible web server
-+.
-+.SH SYNOPSIS
-+\fBlighttpd\fP [\fB\-ptDvVh\fP] \fB\-f\fP \fIconfigfile\fP [\fB\-m\fP \fImoduledir\fP]
-+.
-+.SH DESCRIPTION
-+\fBlighttpd\fP (pronounced 'lighty') is an advanced HTTP daemon that aims
-+to be secure, fast, compliant and very flexible.  It has been optimized for
-+high performance.  Its feature set includes, but is not limited to, FastCGI,
-+CGI, basic and digest HTTP authentication, output compression, URL rewriting.
-+.PP
-+This manual page only lists the command line arguments.  For details
-+on how to configure \fBlighttpd\fP and its modules see the files in the
-+doc-directory.
-+.
-+.SH OPTIONS
-+The following options are supported:
-+.TP 8
-+\fB\-f\ \fP \fIconfigfile\fP
-+Load configuration file \fIconfigfile\fP.
-+.TP 8
-+\fB\-m\ \fP \fImoduledir\fP
-+Use
-+\fImoduledir\fP
-+as the directory that contains modules, instead of the default.
-+.TP 8
-+\fB\-p\fP
-+Print the parsed configuration file in its internal form and exit.
-+.TP 8
-+\fB\-t\fP
-+Test the configuration file for syntax errors and exit.
-+.TP 8
-+\fB\-D\fP
-+Do not daemonize (go into background). The default is to daemonize.
-+.TP 8
-+\fB\-v\fP
-+Show version and exit.
-+.TP 8
-+\fB\-V\fP
-+Show compile-time features and exit.
-+.TP 8
-+\fB\-h\fP
-+Show a brief help message and exit.
-+.
-+.SH FILES
-+.TP 8
-+/etc/lighttpd/lighttpd.conf
-+The standard location for the configuration file.
-+.TP 8
-+/var/run/lighttpd.pid
-+The standard location for the PID of the running \fBlighttpd\fP process.
-+.
-+.SH SEE ALSO
-+Online Documentation: http://wiki.lighttpd.net/
-+.PP
-+spawn-fcgi(1)
-+.PP
-+\fIHypertext Transfer Protocol -- HTTP/1.1\fP, RFC 2616.
-+.PP
-+\fIHTTP Authentication: Basic and Digest Access Authentication\fP, RFC 2617.
-+.PP
-+\fIThe Common Gateway Interface Version 1.1\fP, RFC 3875.
-+.PP
-+\fIThe FastCGI specification\fP.
-+.
-+.SH AUTHOR
-+Jan Kneschke <jan@kneschke.de>
-Index: doc/lighttpd.conf
-===================================================================
---- doc/lighttpd.conf  (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ doc/lighttpd.conf  (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -16,7 +16,6 @@
- #                               "mod_redirect",
- #                               "mod_alias",
-                                 "mod_access",
--#                               "mod_cml",
- #                               "mod_trigger_b4_dl",
- #                               "mod_auth",
- #                               "mod_status",
-@@ -35,8 +34,8 @@
- #                               "mod_rrdtool",
-                                 "mod_accesslog" )
--## a static document-root, for virtual-hosting take look at the
--## server.virtual-* options
-+## A static document-root. For virtual hosting take a look at the
-+## mod_simple_vhost module.
- server.document-root        = "/srv/www/htdocs/"
- ## where to send error-messages to
-@@ -299,11 +298,6 @@
- # trigger-before-download.deny-url = "http://127.0.0.1/index.html"
- # trigger-before-download.trigger-timeout = 10
--## for mod_cml
--## don't forget to add index.cml to server.indexfiles
--# cml.extension               = ".cml"
--# cml.memcache-hosts          = ( "127.0.0.1:11211" )
--
- #### variable usage:
- ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
- #bar = 1
-Index: doc/Makefile.am
-===================================================================
---- doc/Makefile.am    (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ doc/Makefile.am    (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -1,6 +1,5 @@
--dist_man1_MANS=lighttpd.1 spawn-fcgi.1
-+dist_man8_MANS=lighttpd.8
--
- DOCS=accesslog.txt \
- authentication.txt \
- cgi.txt \
-Index: SConstruct
-===================================================================
 Index: NEWS
 ===================================================================
---- NEWS       (.../tags/lighttpd-1.4.22)      (revision 2475)
-+++ NEWS       (.../branches/lighttpd-1.4.x)   (revision 2475)
-@@ -3,7 +3,30 @@
+--- NEWS       (.../tags/lighttpd-1.4.23)
++++ NEWS       (.../branches/lighttpd-1.4.x)
+@@ -3,7 +3,42 @@
  NEWS
  ====
  
--- 1.4.22 -
-+- 1.4.23 -
-+  * Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
-+  * New lighttpd man page (moved it to section 8) (fixes #1875)
-+  * Create rrd file for empty rrdfile in mod_rrdtool (#1788)
-+  * Fix workaround for incorrect path info/scriptname if fastcgi prefix is "/" (fixes #729)
-+  * Finally removed spawn-fcgi
-+  * Allow xattr to overwrite mime type (fixes #1929)
-+  * Remove link from errormsg about fastcgi apps (fixes #1942)
-+  * Strip trailing dot from "Host:" header
-+  * Remove the optional port info from SERVER_NAME (thx Mr_Bond)
-+  * Fix mod_proxy RoundRobin (off by one problem if only one backend is up)
-+  * Rename configure.in to configure.ac, with small cleanups (fixes #1932)
-+  * Add proper SUID bit detection (fixes #416)
-+  * Check for regular file in mod_cgi, so we don't try to start directories
-+  * Include mmap.h from chunk.h to fix some problems with #define mmap mmap64 (fixes #1923)
-+  * Add support for pipe logging for server.errorlog (fixes #296)
-+  * Add revision number to package version for svn/git checkouts
-+  * Use server.tag for SERVER_SOFTWARE if configured (fixes #357)
-+  * Fix trailing zero char in REQUEST_URI after "strip-request-uri" in mod_fastcgi
-+  * mod_magnet: Add env["request.remote-ip"] (fixes #1740)
-+  * mod_magnet: Add env["request.path-info"]
-+  * Change name/version separator back to "/" (affects every place where the version is printed)
-+
-+- 1.4.22 - 2009-03-07
-   * Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)
-   * Fix default vhost in mod_simple_vhost (fixes #1905)
-   * Handle EINTR in mod_rrdtool (fixes #604)
+-- 1.4.23 -
++- 1.4.24 -
++  * Add T_CONFIG_INT for bigger integers from the config (needed for #1966)
++  * Use unsigned int (and T_CONFIG_INT) for max_request_size
++  * Use unsigned int for secdownload.timeout (fixes #1966)
++  * Keep url/host values from connection to display information while keep-alive in mod_status (fixes #1202)
++  * Add server.breakagelog, a "special" stderr (fixes #1863)
++  * Fix config evaluation for debug.log-timeouts option (#1529)
++  * Add "cgi.execute-x-only" to mod_cgi, requires +x for cgi scripts (fixes #2013)
++  * Fix FD_SETSIZE comparision warnings
++  * Add "lua-5.1" to searched pkg-config names for lua
++  * Fix unused function webdav_lockdiscovery in mod_webdav
++  * cmake: Fix crypt lib check
++  * cmake: Add -export-dynamic to link flags, fixes build on FreeBSD
++  * Set FD_CLOEXEC for bound sockets before pipe-logger forks (fixes #2026)
++  * Reset ignored signals to SIG_DFL before exec() in fastcgi/scgi (fixes #2029)
++  * Show "no uri specified -> 400" error only when "debug.log-request-header-on-error" is enabled (fixes #2030)
++  * Fix hanging connection in mod_scgi (fixes #2024)
++  * Allow digits in hostnames in more places (fixes #1148)
++  * Use connection_reset instead of handle_request_done for cleanup callbacks
++  * Change mod_expire to append Cache-Control instead of overwriting it (fixes #1997)
++  * Allow all comparisons for $SERVER["socket"] - only bind for "=="
++  * Remove strptime failed message (fixes #2031)
++  * Fix issues found with clang analyzer
++  * Try to fix server.tag issue with localized svnversion
++  * Fix handling network-write return values (#2024)
++  * Use disable-time in fastcgi for all disables after errors, default is 1sec (fixes #2040)
++  * Remove adaptive spawning code from fastcgi (was disabled for a long time)
++  * Allow mod_mysql_vhost to use stored procedures (fixes #2011, thx Ben Brown)
++  * Fix ipv6 in mod_proxy (fixes #2043)
++  * Print errors from include_shell to stderr
++  * Set tm.tm_isdst = 0 before mktime() (fixes #2047)
++  * Use linux-epoll by default if available (fixes #2021, thx Olaf van der Spek)
++  * Print an error if you use too many captures in a regex pattern (fixes #2059)
++  * Combine Cache-Control header value in mod_expire to existing HTTP header if header already added by other modules (fixes #2068)
++
++- 1.4.23 - 2009-06-19
+   * Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
+   * New lighttpd man page (moved it to section 8) (fixes #1875)
+   * Create rrd file for empty rrdfile in mod_rrdtool (#1788)
 Index: CMakeLists.txt
 ===================================================================
-
-Property changes on: .
-___________________________________________________________________
-Modified: bzr:revision-info
-   - timestamp: 2009-03-07 14:58:05.338000059 +0100
-committer: Stefan Bühler <stbuehler@web.de>
-properties: 
-       branch-nick: lighttpd-1.4.x
-
-   + timestamp: 2009-03-07 22:04:32.213999987 +0100
-committer: Stefan Bühler <stbuehler@web.de>
-properties: 
-       branch-nick: lighttpd-1.4.x
-
-Modified: bzr:file-ids
-   - 
-   + doc/lighttpd.8    lighttpd.8-20090307205615-mc312p5ocjwthwte-1
-
-Modified: bzr:revision-id:v3-trunk0
-   - 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
-1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
-1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
-1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
-1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
-1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
-1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
-1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
-1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
-1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
-1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
-1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
-1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
-1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
-1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
-1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
-1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
-1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
-1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
-1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
-1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
-1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
-1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
-1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
-1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
-1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
-1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
-1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
-1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
-1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
-1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
-1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
-1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
-1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
-1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
-1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
-1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
-1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
-1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
-1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
-1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
-1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
-1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
-1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
-1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
-1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
-1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
-1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
-1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
-1176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
-1177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
-1178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
-1179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
-1180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
-1181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
-1182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
-1183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
-1184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
-1185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
-1186 stbuehler@web.de-20081001200802-l5og517etnneitk0
-1188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
-1189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
-1191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
-1192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
-1193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
-1195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
-1196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
-1197 stbuehler@web.de-20081016121114-65quosenmso8frf8
-1198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
-1199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
-1200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
-1201 stbuehler@web.de-20081205233903-708beaujtf26gprx
-1202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
-1203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
-1204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
-1205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
-1206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
-1208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
-1209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
-1210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
-1211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
-1212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
-1213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
-1214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
-1215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
-1216 stbuehler@web.de-20090205105134-6i5key9439wspueq
-1217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
-1218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3
-1219 stbuehler@web.de-20090205215425-vicbc6hzb3at7gj9
-1220 stbuehler@web.de-20090205220741-vqz9l1eui3dwnulq
-1221 stbuehler@web.de-20090205222705-8179v6jkv2x38l70
-1222 stbuehler@web.de-20090210194631-6epujtpen9xfxx5j
-1223 stbuehler@web.de-20090216134207-fg99ikt1ds21hx25
-1224 stbuehler@web.de-20090217085833-9g5c7j7zdylvezl5
-1225 stbuehler@web.de-20090217133414-y80hydn9raqgkgto
-1226 stbuehler@web.de-20090217224447-ve7ns45c9otbgz9h
-1227 stbuehler@web.de-20090219130703-117t93t4hr4j0e8d
-1228 stbuehler@web.de-20090219130728-m8nui64vin0w95b2
-1229 stbuehler@web.de-20090219131550-exi19tbqyd8fpa0d
-1230 stbuehler@web.de-20090224133046-toewpee0ybw5tuay
-1231 stbuehler@web.de-20090228205351-yqjhutdqf30jr66o
-1232 stbuehler@web.de-20090228213824-gnwuf6by8705g6zk
-1233 stbuehler@web.de-20090303100525-kamra70ocxpji0l5
-1234 stbuehler@web.de-20090303100929-p4w2995k61yhxws2
-1235 stbuehler@web.de-20090307135056-02q8f6l1e5jehu9y
-1236 stbuehler@web.de-20090307135805-z488kad68sgcjtzz
-
-   + 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
-1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
-1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
-1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
-1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
-1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
-1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
-1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
-1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
-1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
-1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
-1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
-1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
-1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
-1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
-1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
-1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
-1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
-1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
-1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
-1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
-1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
-1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
-1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
-1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
-1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
-1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
-1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
-1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
-1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
-1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
-1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
-1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
-1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
-1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
-1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
-1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
-1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
-1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
-1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
-1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
-1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
-1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
-1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
-1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
-1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
-1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
-1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
-1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
-1176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
-1177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
-1178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
-1179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
-1180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
-1181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
-1182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
-1183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
-1184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
-1185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
-1186 stbuehler@web.de-20081001200802-l5og517etnneitk0
-1188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
-1189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
-1191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
-1192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
-1193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
-1195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
-1196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
-1197 stbuehler@web.de-20081016121114-65quosenmso8frf8
-1198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
-1199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
-1200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
-1201 stbuehler@web.de-20081205233903-708beaujtf26gprx
-1202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
-1203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
-1204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
-1205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
-1206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
-1208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
-1209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
-1210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
-1211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
-1212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
-1213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
-1214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
-1215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
-1216 stbuehler@web.de-20090205105134-6i5key9439wspueq
-1217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
-1218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3
-1219 stbuehler@web.de-20090205215425-vicbc6hzb3at7gj9
-1220 stbuehler@web.de-20090205220741-vqz9l1eui3dwnulq
-1221 stbuehler@web.de-20090205222705-8179v6jkv2x38l70
-1222 stbuehler@web.de-20090210194631-6epujtpen9xfxx5j
-1223 stbuehler@web.de-20090216134207-fg99ikt1ds21hx25
-1224 stbuehler@web.de-20090217085833-9g5c7j7zdylvezl5
-1225 stbuehler@web.de-20090217133414-y80hydn9raqgkgto
-1226 stbuehler@web.de-20090217224447-ve7ns45c9otbgz9h
-1227 stbuehler@web.de-20090219130703-117t93t4hr4j0e8d
-1228 stbuehler@web.de-20090219130728-m8nui64vin0w95b2
-1229 stbuehler@web.de-20090219131550-exi19tbqyd8fpa0d
-1230 stbuehler@web.de-20090224133046-toewpee0ybw5tuay
-1231 stbuehler@web.de-20090228205351-yqjhutdqf30jr66o
-1232 stbuehler@web.de-20090228213824-gnwuf6by8705g6zk
-1233 stbuehler@web.de-20090303100525-kamra70ocxpji0l5
-1234 stbuehler@web.de-20090303100929-p4w2995k61yhxws2
-1235 stbuehler@web.de-20090307135056-02q8f6l1e5jehu9y
-1236 stbuehler@web.de-20090307135805-z488kad68sgcjtzz
-1237 stbuehler@web.de-20090307154555-xybvl7sxrha6vhds
-1238 stbuehler@web.de-20090307204326-10m0681831yvhi3k
-1239 stbuehler@web.de-20090307204846-seq3cmzn6dy9927i
-1240 stbuehler@web.de-20090307205519-ha3s58fcum106yl0
-1241 stbuehler@web.de-20090307210432-jdlv5pp9m519vyv2
-
-
This page took 0.301497 seconds and 4 git commands to generate.