2 ===================================================================
4 ===================================================================
6 ===================================================================
7 Index: src/configfile-glue.c
8 ===================================================================
9 --- src/configfile-glue.c (.../tags/lighttpd-1.4.23) (revision 2613)
10 +++ src/configfile-glue.c (.../branches/lighttpd-1.4.x) (revision 2613)
12 if (e != ds->value->ptr && !*e && l >=0 && l <= 65535) {
13 *((unsigned short *)(cv[i].destination)) = l;
23 - log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected a integer, range 0 ... 65535");
24 + log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected a short integer, range 0 ... 65535");
30 + case TYPE_INTEGER: {
31 + data_integer *di = (data_integer *)du;
33 + *((unsigned int *)(cv[i].destination)) = di->value;
37 + data_string *ds = (data_string *)du;
39 + if (ds->value->ptr && *ds->value->ptr) {
41 + long l = strtol(ds->value->ptr, &e, 10);
42 + if (e != ds->value->ptr && !*e && l >= 0) {
43 + *((unsigned int *)(cv[i].destination)) = l;
49 + log_error_write(srv, __FILE__, __LINE__, "ssb", "got a string but expected an integer:", cv[i].key, ds->value);
54 + log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected an integer, range 0 ... 4294967295");
58 case T_CONFIG_BOOLEAN:
59 if (du->type == TYPE_STRING) {
60 data_string *ds = (data_string *)du;
62 ===================================================================
63 --- src/mod_cgi.c (.../tags/lighttpd-1.4.23) (revision 2613)
64 +++ src/mod_cgi.c (.../branches/lighttpd-1.4.x) (revision 2613)
69 + unsigned short execute_x_only;
75 config_values_t cv[] = {
76 { "cgi.assign", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
77 + { "cgi.execute-x-only", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
78 { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET}
84 s->cgi = array_init();
85 + s->execute_x_only = 0;
87 cv[0].destination = s->cgi;
88 + cv[1].destination = &(s->execute_x_only);
90 p->config_storage[i] = s;
94 log_error_write(srv, __FILE__, __LINE__, "sd", "(debug) cgi exited fine, pid:", pid);
100 log_error_write(srv, __FILE__, __LINE__, "sd", "cgi died, pid:", pid);
102 return HANDLER_GO_ON;
105 @@ -1005,7 +1006,7 @@
106 args[i++] = cgi_handler->ptr;
108 args[i++] = con->physical.path->ptr;
112 /* search for the last / */
113 if (NULL != (c = strrchr(con->physical.path->ptr, '/'))) {
114 @@ -1018,8 +1019,6 @@
118 - openDevNull(STDERR_FILENO);
120 /* we don't need the client socket */
121 for (i = 3; i < 256; i++) {
122 if (i != srv->errorlog_fd) close(i);
123 @@ -1198,6 +1197,8 @@
125 if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.assign"))) {
127 + } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.execute-x-only"))) {
128 + PATCH(execute_x_only);
132 @@ -1220,6 +1221,7 @@
134 if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) return HANDLER_GO_ON;
135 if (!S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
136 + if (p->conf.execute_x_only == 1 && (sce->st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0) return HANDLER_GO_ON;
138 s_len = fn->used - 1;
140 Index: src/network_write.c
141 ===================================================================
142 --- src/network_write.c (.../tags/lighttpd-1.4.23) (revision 2613)
143 +++ src/network_write.c (.../branches/lighttpd-1.4.x) (revision 2613)
145 toSend = c->mem->used - 1 - c->offset;
147 if ((r = send(fd, offset, toSend, 0)) < 0) {
148 - log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed: ", strerror(errno), fd);
149 + /* no error handling for windows... */
150 + log_error_write(srv, __FILE__, __LINE__, "ssd", "send failed: ", strerror(errno), fd);
155 if ((r = write(fd, offset, toSend)) < 0) {
156 - log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed: ", strerror(errno), fd);
166 + log_error_write(srv, __FILE__, __LINE__, "ssd",
167 + "write failed:", strerror(errno), fd);
179 -#if defined USE_MMAP
181 if (MAP_FAILED == (p = mmap(0, sce->st.st_size, PROT_READ, MAP_SHARED, ifd, 0))) {
182 log_error_write(srv, __FILE__, __LINE__, "ss", "mmap failed: ", strerror(errno));
184 @@ -109,13 +121,26 @@
187 if ((r = write(fd, p + offset, toSend)) <= 0) {
188 - log_error_write(srv, __FILE__, __LINE__, "ss", "write failed: ", strerror(errno));
189 - munmap(p, sce->st.st_size);
198 + munmap(p, sce->st.st_size);
201 + log_error_write(srv, __FILE__, __LINE__, "ssd",
202 + "write failed:", strerror(errno), fd);
203 + munmap(p, sce->st.st_size);
209 munmap(p, sce->st.st_size);
211 +#else /* USE_MMAP */
212 buffer_prepare_copy(srv->tmp_buf, toSend);
214 lseek(ifd, offset, SEEK_SET);
215 @@ -127,12 +152,33 @@
219 - if (-1 == (r = send(fd, srv->tmp_buf->ptr, toSend, 0))) {
220 - log_error_write(srv, __FILE__, __LINE__, "ss", "write: ", strerror(errno));
222 + if ((r = send(fd, srv->tmp_buf->ptr, toSend, 0)) < 0) {
223 + /* no error handling for windows... */
224 + log_error_write(srv, __FILE__, __LINE__, "ssd", "send failed: ", strerror(errno), fd);
230 + if ((r = write(fd, srv->tmp_buf->ptr, toSend)) < 0) {
240 + log_error_write(srv, __FILE__, __LINE__, "ssd",
241 + "write failed:", strerror(errno), fd);
246 +#endif /* __WIN32 */
247 +#endif /* USE_MMAP */
252 Index: src/mod_secure_download.c
253 ===================================================================
254 --- src/mod_secure_download.c (.../tags/lighttpd-1.4.23) (revision 2613)
255 +++ src/mod_secure_download.c (.../branches/lighttpd-1.4.x) (revision 2613)
260 - unsigned short timeout;
261 + unsigned int timeout;
266 { "secdownload.secret", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
267 { "secdownload.document-root", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
268 { "secdownload.uri-prefix", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
269 - { "secdownload.timeout", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
270 + { "secdownload.timeout", NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
271 { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
278 - if ( (srv->cur_ts > ts && srv->cur_ts - ts > p->conf.timeout) ||
279 - (srv->cur_ts < ts && ts - srv->cur_ts > p->conf.timeout) ) {
280 + if ( (srv->cur_ts > ts && (unsigned int) (srv->cur_ts - ts) > p->conf.timeout) ||
281 + (srv->cur_ts < ts && (unsigned int) (ts - srv->cur_ts) > p->conf.timeout) ) {
282 /* "Gone" as the url will never be valid again instead of "408 - Timeout" where the request may be repeated */
283 con->http_status = 410;
286 ===================================================================
287 --- src/base.h (.../tags/lighttpd-1.4.23) (revision 2613)
288 +++ src/base.h (.../branches/lighttpd-1.4.x) (revision 2613)
290 typedef enum { T_CONFIG_UNSET,
298 unsigned short etag_use_mtime;
299 unsigned short etag_use_size;
300 unsigned short force_lowercase_filenames; /* if the FS is case-insensitive, force all files to lower-case */
301 - unsigned short max_request_size;
302 + unsigned int max_request_size;
304 unsigned short kbytes_per_second; /* connection kb/s limit */
308 buffer *errorlog_file;
309 unsigned short errorlog_use_syslog;
310 + buffer *breakagelog_file;
312 unsigned short dont_daemonize;
315 unsigned short max_worker;
316 unsigned short max_fds;
317 unsigned short max_conns;
318 - unsigned short max_request_size;
319 + unsigned int max_request_size;
321 unsigned short log_request_header_on_error;
322 unsigned short log_state_handling;
327 - enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
328 + enum { ERRORLOG_FILE, ERRORLOG_FD, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
329 buffer *errorlog_buf;
331 fdevents *ev, *ev_ins;
332 Index: src/mod_rewrite.c
333 ===================================================================
334 --- src/mod_rewrite.c (.../tags/lighttpd-1.4.23) (revision 2613)
335 +++ src/mod_rewrite.c (.../branches/lighttpd-1.4.x) (revision 2613)
339 if (NULL != (du = array_get_element(ca, option))) {
340 - data_array *da = (data_array *)du;
344 if (du->type != TYPE_ARRAY) {
354 @@ -383,17 +383,15 @@
356 buffer_reset(con->request.uri);
358 - start = 0; end = pattern_len;
360 for (k = 0; k < pattern_len; k++) {
361 if (pattern[k] == '$' || pattern[k] == '%') {
364 size_t num = pattern[k + 1] - '0';
367 + buffer_append_string_len(con->request.uri, pattern + start, k - start);
369 - buffer_append_string_len(con->request.uri, pattern + start, end - start);
371 if (!isdigit((unsigned char)pattern[k + 1])) {
372 /* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
373 buffer_append_string_len(con->request.uri, pattern+k, pattern[k] == pattern[k+1] ? 1 : 2);
374 Index: src/connections.c
375 ===================================================================
376 --- src/connections.c (.../tags/lighttpd-1.4.23) (revision 2613)
377 +++ src/connections.c (.../branches/lighttpd-1.4.x) (revision 2613)
378 @@ -782,13 +782,13 @@
379 CLEAN(request.pathinfo);
380 CLEAN(request.request);
382 - CLEAN(request.orig_uri);
383 + /* CLEAN(request.orig_uri); */
386 - CLEAN(uri.authority);
388 + /* CLEAN(uri.authority); */
389 + /* CLEAN(uri.path); */
392 + /* CLEAN(uri.query); */
394 CLEAN(physical.doc_root);
395 CLEAN(physical.path);
396 @@ -1401,6 +1401,11 @@
397 "state for fd", con->fd, connection_get_state(con->state));
400 + buffer_reset(con->uri.authority);
401 + buffer_reset(con->uri.path);
402 + buffer_reset(con->uri.query);
403 + buffer_reset(con->request.orig_uri);
405 if (http_request_parse(srv, con)) {
406 /* we have to read some data from the POST request */
408 @@ -1725,7 +1730,7 @@
409 case HANDLER_FINISHED:
412 - log_error_write(srv, __FILE__, __LINE__, "");
413 + log_error_write(srv, __FILE__, __LINE__, "sd", "unhandling return value", r);
418 ===================================================================
419 --- src/network.c (.../tags/lighttpd-1.4.23) (revision 2613)
420 +++ src/network.c (.../branches/lighttpd-1.4.x) (revision 2613)
426 + /* set FD_CLOEXEC now, fdevent_fcntl_set is called later; needed for pipe-logger forks */
427 + fcntl(srv_socket->fd, F_SETFD, FD_CLOEXEC);
431 srv->cur_fds = srv_socket->fd;
444 if (COMP_SERVER_SOCKET != dc->comp) continue;
446 - if (dc->cond != CONFIG_COND_EQ) {
447 - log_error_write(srv, __FILE__, __LINE__, "s", "only == is allowed for $SERVER[\"socket\"].");
448 + if (dc->cond != CONFIG_COND_EQ) continue;
453 /* check if we already know this socket,
454 * if yes, don't init it */
455 for (j = 0; j < srv->srv_sockets.used; j++) {
456 Index: src/configfile.c
457 ===================================================================
458 --- src/configfile.c (.../tags/lighttpd-1.4.23) (revision 2613)
459 +++ src/configfile.c (.../branches/lighttpd-1.4.x) (revision 2613)
462 { "server.event-handler", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 10 */
463 { "server.pid-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 11 */
464 - { "server.max-request-size", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
465 + { "server.max-request-size", NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
466 { "server.max-worker", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 13 */
467 { "server.document-root", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
468 - { "server.force-lowercase-filenames", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 15 */
469 + { "server.force-lowercase-filenames", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },/* 15 */
470 { "debug.log-condition-handling", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 16 */
471 - { "server.max-keep-alive-requests", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 17 */
472 + { "server.max-keep-alive-requests", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },/* 17 */
473 { "server.name", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 18 */
474 { "server.max-keep-alive-idle", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 19 */
477 { "server.core-files", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 46 */
478 { "ssl.cipher-list", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 47 */
479 { "ssl.use-sslv2", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 48 */
480 - { "etag.use-inode", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
481 - { "etag.use-mtime", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
482 - { "etag.use-size", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
483 + { "etag.use-inode", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
484 + { "etag.use-mtime", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
485 + { "etag.use-size", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
486 { "server.reject-expect-100-with-417", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 52 */
487 { "debug.log-timeouts", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 53 */
488 - { "server.defer-accept", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 54 */
489 + { "server.defer-accept", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 54 */
490 + { "server.breakagelog", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 55 */
491 { "server.host", "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
492 { "server.docroot", "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
493 { "server.virtual-root", "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
495 cv[43].destination = &(srv->srvconf.max_conns);
496 cv[12].destination = &(srv->srvconf.max_request_size);
497 cv[52].destination = &(srv->srvconf.reject_expect_100_with_417);
498 + cv[55].destination = srv->srvconf.breakagelog_file;
500 srv->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
502 assert(srv->config_storage);
504 PATCH(log_condition_handling);
505 PATCH(log_file_not_found);
506 PATCH(log_ssl_noise);
507 + PATCH(log_timeouts);
509 PATCH(range_requests);
510 PATCH(force_lowercase_filenames);
511 @@ -1135,15 +1139,15 @@
512 * - select works everywhere
513 * - linux-* are experimental
515 +#ifdef USE_LINUX_EPOLL
516 + { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
519 { FDEVENT_HANDLER_POLL, "poll" },
522 { FDEVENT_HANDLER_SELECT, "select" },
524 -#ifdef USE_LINUX_EPOLL
525 - { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
527 #ifdef USE_LINUX_SIGIO
528 { FDEVENT_HANDLER_LINUX_RTSIG, "linux-rtsig" },
530 Index: src/mod_evhost.c
531 ===================================================================
532 --- src/mod_evhost.c (.../tags/lighttpd-1.4.23) (revision 2613)
533 +++ src/mod_evhost.c (.../branches/lighttpd-1.4.x) (revision 2613)
536 ds = data_string_init();
537 buffer_copy_string_len(ds->key,CONST_STR_LEN("%"));
538 - buffer_append_long(ds->key, i++);
539 + buffer_append_long(ds->key, i /* ++ */);
540 buffer_copy_string_len(ds->value,ptr,colon-ptr);
542 array_insert_unique(host,(data_unset *)ds);
543 @@ -294,10 +294,10 @@
544 char *colon = strchr(con->uri.authority->ptr, ':');
547 - buffer_append_string_buffer(p->tmp_buf, con->uri.authority); // adds fqdn
548 + buffer_append_string_buffer(p->tmp_buf, con->uri.authority); /* adds fqdn */
550 /* strip the port out of the authority-part of the URI scheme */
551 - buffer_append_string_len(p->tmp_buf, con->uri.authority->ptr, colon - con->uri.authority->ptr); // adds fqdn
552 + buffer_append_string_len(p->tmp_buf, con->uri.authority->ptr, colon - con->uri.authority->ptr); /* adds fqdn */
554 } else if (NULL != (ds = (data_string *)array_get_element(parsed_host,p->conf.path_pieces[i]->ptr))) {
555 if (ds->value->used) {
556 Index: src/splaytree.c
557 ===================================================================
558 --- src/splaytree.c (.../tags/lighttpd-1.4.23) (revision 2613)
559 +++ src/splaytree.c (.../branches/lighttpd-1.4.x) (revision 2613)
561 * size fields are maintained */
562 splay_tree * splaytree_splay (splay_tree *t, int i) {
563 splay_tree N, *l, *r, *y;
564 - int comp, root_size, l_size, r_size;
565 + int comp, l_size, r_size;
567 if (t == NULL) return t;
568 N.left = N.right = NULL;
570 - root_size = node_size(t);
575 ===================================================================
576 --- src/lemon.c (.../tags/lighttpd-1.4.23) (revision 2613)
577 +++ src/lemon.c (.../branches/lighttpd-1.4.x) (revision 2613)
583 +#define NORETURN __attribute__ ((__noreturn__))
588 /* #define PRIVATE static */
589 #define PRIVATE static
593 extern void *malloc();
595 -extern void memory_error();
596 +extern void memory_error() NORETURN;
598 /******** From the file "action.h" *************************************/
599 struct action *Action_new();
603 /********* From the file "assert.h" ************************************/
605 +void myassert() NORETURN;
607 # define assert(X) if(!(X))myassert(__FILE__,__LINE__)
609 @@ -1333,7 +1339,7 @@
610 /* Report an out-of-memory condition and abort. This function
611 ** is used mostly by the "MemoryCheck" macro in struct.h
613 -void memory_error(){
614 +void memory_error() {
615 fprintf(stderr,"Out of memory. Aborting...\n");
618 @@ -1608,7 +1614,6 @@
623 if( argv[0] ) fprintf(err,"%s",argv[0]);
624 spcnt = strlen(argv[0]) + 1;
625 for(i=1; i<n && argv[i]; i++){
626 @@ -2913,7 +2918,7 @@
627 }else if( sp->destructor ){
629 fprintf(out,"#line %d \"%s\"\n{",sp->destructorln,lemp->filename);
630 - }else if( lemp->vardest ){
634 fprintf(out,"#line %d \"%s\"\n{",lemp->vardestln,lemp->filename);
635 @@ -3042,7 +3047,7 @@
636 int *plineno; /* Pointer to the line number */
637 int mhflag; /* True if generating makeheaders output */
639 - int lineno = *plineno; /* The line number of the output */
640 + int lineno; /* The line number of the output */
641 char **types; /* A hash table of datatypes */
642 int arraysize; /* Size of the "types" array */
643 int maxdtlength; /* Maximum length of any ".datatype" field. */
644 Index: src/mod_scgi.c
645 ===================================================================
646 --- src/mod_scgi.c (.../tags/lighttpd-1.4.23) (revision 2613)
647 +++ src/mod_scgi.c (.../branches/lighttpd-1.4.x) (revision 2613)
650 int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *proc);
652 +static void reset_signals(void) {
654 + signal(SIGTTOU, SIG_DFL);
657 + signal(SIGTTIN, SIG_DFL);
660 + signal(SIGTSTP, SIG_DFL);
662 + signal(SIGHUP, SIG_DFL);
663 + signal(SIGPIPE, SIG_DFL);
664 + signal(SIGUSR1, SIG_DFL);
668 static handler_ctx * handler_ctx_init() {
681 /* we don't need the client socket */
686 - openDevNull(STDERR_FILENO);
688 /* build clean environment */
689 if (host->bin_env_copy->used) {
690 for (i = 0; i < host->bin_env_copy->used; i++) {
692 buffer_copy_string_len(b, CONST_STR_LEN("exec "));
693 buffer_append_string_buffer(b, host->bin_path);
698 execle("/bin/sh", "sh", "-c", b->ptr, (char *)NULL, env.ptr);
700 @@ -2163,8 +2174,11 @@
705 - ((!host->host->used || !host->port) && !host->unixsocket->used)) {
707 + log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: host = NULL");
708 + return HANDLER_ERROR;
710 + if (((!host->host->used || !host->port) && !host->unixsocket->used)) {
711 log_error_write(srv, __FILE__, __LINE__, "sxddd",
714 @@ -2299,8 +2313,8 @@
716 chunkqueue_remove_finished_chunks(hctx->wb);
719 - if (errno == ENOTCONN) {
721 + if (errno == ENOTCONN || ret == -2) {
722 /* the connection got dropped after accept()
724 * this is most of the time a PHP which dies
725 @@ -2325,24 +2339,17 @@
728 log_error_write(srv, __FILE__, __LINE__, "ssosd",
729 - "[REPORT ME] connection was dropped after accept(). reconnect() denied:",
730 + "connection was dropped after accept(). reconnect() denied:",
731 "write-offset:", hctx->wb->bytes_out,
732 "reconnect attempts:", hctx->reconnects);
734 return HANDLER_ERROR;
737 - if ((errno != EAGAIN) &&
738 - (errno != EINTR)) {
741 + /* -1 == ret => error on our side */
742 log_error_write(srv, __FILE__, __LINE__, "ssd",
743 - "write failed:", strerror(errno), errno);
744 + "write failed:", strerror(errno), errno);
746 return HANDLER_ERROR;
748 - fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
750 - return HANDLER_WAIT_FOR_EVENT;
754 @@ -2469,12 +2476,10 @@
757 static handler_t scgi_connection_close(server *srv, handler_ctx *hctx) {
761 if (NULL == hctx) return HANDLER_GO_ON;
763 - p = hctx->plugin_data;
764 con = hctx->remote_conn;
766 log_error_write(srv, __FILE__, __LINE__, "ssdsd",
767 @@ -2724,27 +2729,29 @@
768 /* check if extension matches */
769 for (k = 0; k < p->conf.exts->used; k++) {
771 + scgi_extension *ext = p->conf.exts->exts[k];
773 - extension = p->conf.exts->exts[k];
774 + if (ext->key->used == 0) continue;
776 - if (extension->key->used == 0) continue;
777 + ct_len = ext->key->used - 1;
779 - ct_len = extension->key->used - 1;
781 if (s_len < ct_len) continue;
783 /* check extension in the form "/scgi_pattern" */
784 - if (*(extension->key->ptr) == '/') {
785 - if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0)
786 + if (*(ext->key->ptr) == '/') {
787 + if (strncmp(fn->ptr, ext->key->ptr, ct_len) == 0) {
790 - } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
792 + } else if (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len)) {
793 /* check extension in the form ".fcg" */
799 /* extension doesn't match */
800 - if (k == p->conf.exts->used) {
801 + if (NULL == extension) {
802 return HANDLER_GO_ON;
805 Index: src/mod_mysql_vhost.c
806 ===================================================================
807 --- src/mod_mysql_vhost.c (.../tags/lighttpd-1.4.23) (revision 2613)
808 +++ src/mod_mysql_vhost.c (.../branches/lighttpd-1.4.x) (revision 2613)
811 #define FOO(x) (s->x->used ? s->x->ptr : NULL)
813 +#if MYSQL_VERSION_ID >= 40100
814 + /* CLIENT_MULTI_STATEMENTS first appeared in 4.1 */
815 if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
816 + FOO(mydb), s->port, FOO(mysock), CLIENT_MULTI_STATEMENTS)) {
818 + if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
819 FOO(mydb), s->port, FOO(mysock), 0)) {
821 log_error_write(srv, __FILE__, __LINE__, "s", mysql_error(s->mysql));
823 return HANDLER_ERROR;
825 if (!row || cols < 1) {
826 /* no such virtual host */
827 mysql_free_result(result);
828 +#if MYSQL_VERSION_ID >= 40100
829 + while (mysql_next_result(p->conf.mysql) == 0);
831 return HANDLER_GO_ON;
835 c->fcgi_offset = c->fcgi_arg->used = 0;
837 mysql_free_result(result);
838 +#if MYSQL_VERSION_ID >= 40100
839 + while (mysql_next_result(p->conf.mysql) == 0);
842 /* fix virtual server and docroot */
843 GO_ON: buffer_copy_string_buffer(con->server_name, c->server_name);
845 return HANDLER_GO_ON;
847 ERR500: if (result) mysql_free_result(result);
848 +#if MYSQL_VERSION_ID >= 40100
849 + while (mysql_next_result(p->conf.mysql) == 0);
851 con->http_status = 500; /* Internal Error */
853 return HANDLER_FINISHED;
854 @@ -424,15 +439,15 @@
855 /* this function is called at dlopen() time and inits the callbacks */
856 int mod_mysql_vhost_plugin_init(plugin *p);
857 int mod_mysql_vhost_plugin_init(plugin *p) {
858 - p->version = LIGHTTPD_VERSION_ID;
859 - p->name = buffer_init_string("mysql_vhost");
860 + p->version = LIGHTTPD_VERSION_ID;
861 + p->name = buffer_init_string("mysql_vhost");
863 - p->init = mod_mysql_vhost_init;
864 - p->cleanup = mod_mysql_vhost_cleanup;
865 - p->handle_request_done = mod_mysql_vhost_handle_connection_close;
866 + p->init = mod_mysql_vhost_init;
867 + p->cleanup = mod_mysql_vhost_cleanup;
868 + p->connection_reset = mod_mysql_vhost_handle_connection_close;
870 - p->set_defaults = mod_mysql_vhost_set_defaults;
871 - p->handle_docroot = mod_mysql_vhost_handle_docroot;
872 + p->set_defaults = mod_mysql_vhost_set_defaults;
873 + p->handle_docroot = mod_mysql_vhost_handle_docroot;
878 int mod_mysql_vhost_plugin_init(plugin *p);
879 int mod_mysql_vhost_plugin_init(plugin *p) {
880 p->version = LIGHTTPD_VERSION_ID;
881 - p->name = buffer_init_string("mysql_vhost");
882 + p->name = buffer_init_string("mysql_vhost");
887 ===================================================================
888 --- src/request.c (.../tags/lighttpd-1.4.23) (revision 2613)
889 +++ src/request.c (.../branches/lighttpd-1.4.x) (revision 2613)
892 /* check the first character at right of the dot */
894 - if (!light_isalpha(host->ptr[i+1])) {
895 + if (!light_isalnum(host->ptr[i+1])) {
898 } else if (!light_isdigit(host->ptr[i+1])) {
902 /* the first character of the hostname */
903 - if (!light_isalpha(c)) {
904 + if (!light_isalnum(c)) {
909 con->response.keep_alive = 0;
912 - log_error_write(srv, __FILE__, __LINE__, "s", "no uri specified -> 400");
913 if (srv->srvconf.log_request_header_on_error) {
914 + log_error_write(srv, __FILE__, __LINE__, "s", "no uri specified -> 400");
915 log_error_write(srv, __FILE__, __LINE__, "Sb",
917 con->request.request);
918 Index: src/network_backends.h
919 ===================================================================
920 --- src/network_backends.h (.../tags/lighttpd-1.4.23) (revision 2613)
921 +++ src/network_backends.h (.../branches/lighttpd-1.4.x) (revision 2613)
927 + * >= 0 : chunks completed
928 + * -1 : error (on our side)
929 + * -2 : remote close
932 int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq);
933 int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq);
934 Index: src/mod_rrdtool.c
935 ===================================================================
936 --- src/mod_rrdtool.c (.../tags/lighttpd-1.4.23) (revision 2613)
937 +++ src/mod_rrdtool.c (.../branches/lighttpd-1.4.x) (revision 2613)
940 args[i++] = p->conf.path_rrdtool_bin->ptr;
945 - openDevNull(STDERR_FILENO);
947 /* we don't need the client socket */
948 for (i = 3; i < 256; i++) {
951 "RRA:MIN:0.5:24:775 "
952 "RRA:MIN:0.5:288:797\n"));
954 - if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
955 + if (-1 == (safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
956 log_error_write(srv, __FILE__, __LINE__, "ss",
957 "rrdtool-write: failed", strerror(errno));
959 Index: src/stat_cache.c
960 ===================================================================
961 --- src/stat_cache.c (.../tags/lighttpd-1.4.23) (revision 2613)
962 +++ src/stat_cache.c (.../branches/lighttpd-1.4.x) (revision 2613)
963 @@ -503,12 +503,10 @@
968 +#ifdef DEBUG_STAT_CACHE
969 + int osize = splaytree_size(sc->files);
973 - osize = sc->files->size;
976 sce = stat_cache_entry_init();
977 buffer_copy_string_buffer(sce->name, name);
979 Index: src/mod_proxy.c
980 ===================================================================
981 --- src/mod_proxy.c (.../tags/lighttpd-1.4.23) (revision 2613)
982 +++ src/mod_proxy.c (.../branches/lighttpd-1.4.x) (revision 2613)
983 @@ -756,12 +756,15 @@
985 switch(hctx->state) {
986 case PROXY_STATE_INIT:
987 +#if defined(HAVE_IPV6) && defined(HAVE_INET_PTON)
988 if (strstr(host->host->ptr,":")) {
989 if (-1 == (hctx->fd = socket(AF_INET6, SOCK_STREAM, 0))) {
990 log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
991 return HANDLER_ERROR;
997 if (-1 == (hctx->fd = socket(AF_INET, SOCK_STREAM, 0))) {
998 log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
999 return HANDLER_ERROR;
1000 @@ -842,17 +845,14 @@
1002 chunkqueue_remove_finished_chunks(hctx->wb);
1005 - if (errno != EAGAIN &&
1007 - log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno);
1008 + if (-1 == ret) { /* error on our side */
1009 + log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno);
1011 - return HANDLER_ERROR;
1013 - fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
1014 + return HANDLER_WAIT_FOR_EVENT;
1015 + } else if (-2 == ret) { /* remote close */
1016 + log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed, remote connection close:", strerror(errno), errno);
1018 - return HANDLER_WAIT_FOR_EVENT;
1020 + return HANDLER_WAIT_FOR_EVENT;
1023 if (hctx->wb->bytes_out == hctx->wb->bytes_in) {
1024 @@ -1107,19 +1107,20 @@
1026 /* check if extension matches */
1027 for (k = 0; k < p->conf.extensions->used; k++) {
1028 + data_array *ext = NULL;
1031 - extension = (data_array *)p->conf.extensions->data[k];
1032 + ext = (data_array *)p->conf.extensions->data[k];
1034 - if (extension->key->used == 0) continue;
1035 + if (ext->key->used == 0) continue;
1037 - ct_len = extension->key->used - 1;
1038 + ct_len = ext->key->used - 1;
1040 if (s_len < ct_len) continue;
1042 /* check extension in the form "/proxy_pattern" */
1043 - if (*(extension->key->ptr) == '/') {
1044 - if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
1045 + if (*(ext->key->ptr) == '/') {
1046 + if (strncmp(fn->ptr, ext->key->ptr, ct_len) == 0) {
1047 if (s_len > ct_len + 1) {
1050 @@ -1127,15 +1128,17 @@
1051 path_info_offset = pi_offset - fn->ptr;
1057 - } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
1058 + } else if (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len)) {
1059 /* check extension in the form ".fcg" */
1065 - if (k == p->conf.extensions->used) {
1066 + if (NULL == extension) {
1067 return HANDLER_GO_ON;
1070 Index: src/Makefile.am
1071 ===================================================================
1072 --- src/Makefile.am (.../tags/lighttpd-1.4.23) (revision 2613)
1073 +++ src/Makefile.am (.../branches/lighttpd-1.4.x) (revision 2613)
1076 @test -f versionstamp.h || touch versionstamp.h; \
1078 - if test -x "`which svnversion`"; then \
1079 - REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
1080 + if test -d "$(top_srcdir)/.svn" -a -x "`which svnversion`"; then \
1081 + REVISION="$$(LANG= LC_ALL=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
1082 if test "$$REVISION" = "exported"; then \
1086 if test -z "$$REVISION" -a -x "`which git`"; then \
1087 - REVISION="$$(cd "$(top_srcdir)"; LANG=C git describe --always 2>/dev/null || echo)"; \
1088 + REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
1090 if test -n "$$REVISION"; then \
1091 echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
1092 Index: src/mod_expire.c
1093 ===================================================================
1094 --- src/mod_expire.c (.../tags/lighttpd-1.4.23) (revision 2613)
1095 +++ src/mod_expire.c (.../branches/lighttpd-1.4.x) (revision 2613)
1097 buffer_copy_string_len(p->expire_tstmp, CONST_STR_LEN("max-age="));
1098 buffer_append_long(p->expire_tstmp, expires - srv->cur_ts); /* as expires >= srv->cur_ts the difference is >= 0 */
1100 - response_header_overwrite(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
1101 + response_header_insert(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
1103 return HANDLER_GO_ON;
1105 Index: src/http_auth.c
1106 ===================================================================
1107 --- src/http_auth.c (.../tags/lighttpd-1.4.23) (revision 2613)
1108 +++ src/http_auth.c (.../branches/lighttpd-1.4.x) (revision 2613)
1109 @@ -918,15 +918,15 @@
1122 + char *username = NULL;
1123 + char *realm = NULL;
1124 + char *nonce = NULL;
1126 + char *algorithm = NULL;
1128 + char *cnonce = NULL;
1130 + char *respons = NULL;
1133 const char *m = NULL;
1134 @@ -967,15 +967,9 @@
1135 dkv[6].ptr = &cnonce;
1137 dkv[8].ptr = &respons;
1138 - dkv[9].ptr = NULL;
1142 - for (i = 0; dkv[i].key; i++) {
1143 - *(dkv[i].ptr) = NULL;
1147 if (p->conf.auth_backend != AUTH_BACKEND_HTDIGEST &&
1148 p->conf.auth_backend != AUTH_BACKEND_PLAIN) {
1149 log_error_write(srv, __FILE__, __LINE__, "s",
1150 Index: src/mod_redirect.c
1151 ===================================================================
1152 --- src/mod_redirect.c (.../tags/lighttpd-1.4.23) (revision 2613)
1153 +++ src/mod_redirect.c (.../branches/lighttpd-1.4.x) (revision 2613)
1158 - size_t start, end;
1163 @@ -213,17 +213,15 @@
1165 buffer_reset(p->location);
1167 - start = 0; end = pattern_len;
1169 for (k = 0; k < pattern_len; k++) {
1170 if (pattern[k] == '$' || pattern[k] == '%') {
1173 size_t num = pattern[k + 1] - '0';
1176 + buffer_append_string_len(p->location, pattern + start, k - start);
1178 - buffer_append_string_len(p->location, pattern + start, end - start);
1180 if (!isdigit((unsigned char)pattern[k + 1])) {
1181 /* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
1182 buffer_append_string_len(p->location, pattern+k, pattern[k] == pattern[k+1] ? 1 : 2);
1183 Index: src/mod_webdav.c
1184 ===================================================================
1185 --- src/mod_webdav.c (.../tags/lighttpd-1.4.23) (revision 2613)
1186 +++ src/mod_webdav.c (.../branches/lighttpd-1.4.x) (revision 2613)
1187 @@ -1096,6 +1096,7 @@
1192 static int webdav_lockdiscovery(server *srv, connection *con,
1193 buffer *locktoken, const char *lockscope, const char *locktype, int depth) {
1195 @@ -1150,6 +1151,8 @@
1202 * check if resource is having the right locks to access to resource
1204 Index: src/configparser.y
1205 ===================================================================
1206 --- src/configparser.y (.../tags/lighttpd-1.4.23) (revision 2613)
1207 +++ src/configparser.y (.../branches/lighttpd-1.4.x) (revision 2613)
1210 return (data_unset *)ds;
1212 - fprintf(stderr, "data type mismatch, cannot be merge\n");
1213 + fprintf(stderr, "data type mismatch, cannot merge\n");
1218 du = configparser_merge_data(du, B);
1224 buffer_copy_string_buffer(du->key, A);
1225 Index: src/mod_status.c
1226 ===================================================================
1227 --- src/mod_status.c (.../tags/lighttpd-1.4.23) (revision 2613)
1228 +++ src/mod_status.c (.../branches/lighttpd-1.4.x) (revision 2613)
1231 buffer_append_string_len(b, CONST_STR_LEN(
1232 "<hr />\n<pre><b>legend</b>\n"
1233 - ". = connect, C = close, E = hard error\n"
1234 + ". = connect, C = close, E = hard error, k = keep-alive\n"
1235 "r = read, R = read-POST, W = write, h = handle-request\n"
1236 "q = request-start, Q = request-end\n"
1237 "s = response-start, S = response-end\n"));
1238 @@ -449,8 +449,14 @@
1240 for (j = 0; j < srv->conns->used; j++) {
1241 connection *c = srv->conns->ptr[j];
1242 - const char *state = connection_get_short_state(c->state);
1243 + const char *state;
1245 + if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
1248 + state = connection_get_short_state(c->state);
1251 buffer_append_string_len(b, state, 1);
1253 if (((j + 1) % 50) == 0) {
1254 @@ -497,7 +503,11 @@
1256 buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"string\">"));
1258 - buffer_append_string(b, connection_get_state(c->state));
1259 + if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
1260 + buffer_append_string_len(b, CONST_STR_LEN("keep-alive"));
1262 + buffer_append_string(b, connection_get_state(c->state));
1265 buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"int\">"));
1267 @@ -611,10 +621,10 @@
1270 static handler_t mod_status_handle_server_statistics(server *srv, connection *con, void *p_d) {
1271 - plugin_data *p = p_d;
1272 - buffer *b = p->module_list;
1275 array *st = srv->status;
1278 if (0 == st->used) {
1279 /* we have nothing to send */
1280 Index: src/mod_ssi.c
1281 ===================================================================
1282 --- src/mod_ssi.c (.../tags/lighttpd-1.4.23) (revision 2613)
1283 +++ src/mod_ssi.c (.../branches/lighttpd-1.4.x) (revision 2613)
1288 - int var = 0, enc = 0;
1290 + /* int enc = 0; */
1291 const char *var_val = NULL;
1292 stat_cache_entry *sce = NULL;
1295 { NULL, SSI_ECHO_UNSET }
1301 enum { SSI_ENC_UNSET, SSI_ENC_URL, SSI_ENC_NONE, SSI_ENC_ENTITY } type;
1304 { NULL, SSI_ENC_UNSET }
1308 for (i = 2; i < n; i += 2) {
1309 if (0 == strcmp(l[i], "var")) {
1313 } else if (0 == strcmp(l[i], "encoding")) {
1317 for (j = 0; encvars[j].var; j++) {
1324 log_error_write(srv, __FILE__, __LINE__, "sss",
1325 "ssi: unknow attribute for ",
1326 Index: src/mod_auth.c
1327 ===================================================================
1328 --- src/mod_auth.c (.../tags/lighttpd-1.4.23) (revision 2613)
1329 +++ src/mod_auth.c (.../branches/lighttpd-1.4.x) (revision 2613)
1332 if (method == NULL) {
1333 log_error_write(srv, __FILE__, __LINE__, "ss",
1334 - "the require field is missing in:",
1335 + "the method field is missing in:",
1336 "auth.require = ( \"...\" => ( ..., \"method\" => \"...\" ) )");
1337 return HANDLER_ERROR;
1341 if (realm == NULL) {
1342 log_error_write(srv, __FILE__, __LINE__, "ss",
1343 - "the require field is missing in:",
1344 + "the realm field is missing in:",
1345 "auth.require = ( \"...\" => ( ..., \"realm\" => \"...\" ) )");
1346 return HANDLER_ERROR;
1348 Index: src/mod_cml_lua.c
1349 ===================================================================
1350 --- src/mod_cml_lua.c (.../tags/lighttpd-1.4.23) (revision 2613)
1351 +++ src/mod_cml_lua.c (.../branches/lighttpd-1.4.x) (revision 2613)
1356 +#include <string.h>
1358 #include "mod_cml.h"
1359 #include "mod_cml_funcs.h"
1360 Index: src/http-header-glue.c
1361 ===================================================================
1362 --- src/http-header-glue.c (.../tags/lighttpd-1.4.23) (revision 2613)
1363 +++ src/http-header-glue.c (.../branches/lighttpd-1.4.x) (revision 2613)
1367 if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
1368 - con->http_status = 304;
1369 + if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
1370 return HANDLER_FINISHED;
1372 char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
1373 @@ -281,15 +281,16 @@
1374 strncpy(buf, con->request.http_if_modified_since, used_len);
1375 buf[used_len] = '\0';
1378 if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
1379 con->http_status = 412;
1381 return HANDLER_FINISHED;
1384 t_header = mktime(&tm);
1386 strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
1388 t_file = mktime(&tm);
1390 if (t_file > t_header) return HANDLER_GO_ON;
1394 if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
1395 - con->http_status = 304;
1396 + if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
1397 return HANDLER_FINISHED;
1399 char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
1400 @@ -331,18 +332,17 @@
1401 strncpy(buf, con->request.http_if_modified_since, used_len);
1402 buf[used_len] = '\0';
1405 if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
1407 * parsing failed, let's get out of here
1409 - log_error_write(srv, __FILE__, __LINE__, "ss",
1410 - "strptime() failed on", buf);
1411 return HANDLER_GO_ON;
1414 t_header = mktime(&tm);
1416 strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
1418 t_file = mktime(&tm);
1420 if (t_file > t_header) return HANDLER_GO_ON;
1421 Index: src/mod_setenv.c
1422 ===================================================================
1423 --- src/mod_setenv.c (.../tags/lighttpd-1.4.23) (revision 2613)
1424 +++ src/mod_setenv.c (.../branches/lighttpd-1.4.x) (revision 2613)
1426 return HANDLER_GO_ON;
1429 -REQUESTDONE_FUNC(mod_setenv_reset) {
1430 +CONNECTION_FUNC(mod_setenv_reset) {
1431 plugin_data *p = p_d;
1435 p->set_defaults = mod_setenv_set_defaults;
1436 p->cleanup = mod_setenv_free;
1438 - p->handle_request_done = mod_setenv_reset;
1439 + p->connection_reset = mod_setenv_reset;
1443 Index: src/mod_fastcgi.c
1444 ===================================================================
1445 --- src/mod_fastcgi.c (.../tags/lighttpd-1.4.23) (revision 2613)
1446 +++ src/mod_fastcgi.c (.../branches/lighttpd-1.4.x) (revision 2613)
1447 @@ -122,24 +122,11 @@
1451 - unsigned short min_procs;
1452 unsigned short max_procs;
1453 size_t num_procs; /* how many procs are started */
1454 size_t active_procs; /* how many of them are really running */
1456 - unsigned short max_load_per_proc;
1459 - * kick the process from the list if it was not
1460 - * used for idle_timeout until min_procs is
1461 - * reached. this helps to get the processlist
1462 - * small again we had a small peak load.
1466 - unsigned short idle_timeout;
1469 * time after a disabled remote connection is tried to be re-enabled
1472 @@ -384,6 +371,21 @@
1473 /* ok, we need a prototype */
1474 static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
1476 +static void reset_signals(void) {
1478 + signal(SIGTTOU, SIG_DFL);
1481 + signal(SIGTTIN, SIG_DFL);
1484 + signal(SIGTSTP, SIG_DFL);
1486 + signal(SIGHUP, SIG_DFL);
1487 + signal(SIGPIPE, SIG_DFL);
1488 + signal(SIGUSR1, SIG_DFL);
1491 static void fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
1492 buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
1493 buffer_append_string_buffer(b, host->id);
1498 - openDevNull(STDERR_FILENO);
1500 /* we don't need the client socket */
1501 for (i = 3; i < 256; i++) {
1503 @@ -1054,6 +1054,7 @@
1510 execve(arg.ptr[0], arg.ptr, env.ptr);
1511 @@ -1235,20 +1236,17 @@
1513 { "check-local", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
1514 { "port", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
1515 - { "min-procs-not-working", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 7 this is broken for now */
1516 - { "max-procs", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
1517 - { "max-load-per-proc", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
1518 - { "idle-timeout", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
1519 - { "disable-time", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
1520 + { "max-procs", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
1521 + { "disable-time", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
1523 - { "bin-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
1524 - { "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
1525 + { "bin-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
1526 + { "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
1528 - { "broken-scriptfilename", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
1529 - { "allow-x-send-file", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 15 */
1530 - { "strip-request-uri", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 16 */
1531 - { "kill-signal", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 17 */
1532 - { "fix-root-scriptname", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 18 */
1533 + { "broken-scriptfilename", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
1534 + { "allow-x-send-file", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
1535 + { "strip-request-uri", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
1536 + { "kill-signal", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
1537 + { "fix-root-scriptname", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 15 */
1539 { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
1541 @@ -1267,12 +1265,9 @@
1542 buffer_copy_string_buffer(host->id, da_host->key);
1544 host->check_local = 1;
1545 - host->min_procs = 4;
1546 host->max_procs = 4;
1547 - host->max_load_per_proc = 1;
1548 - host->idle_timeout = 60;
1549 host->mode = FCGI_RESPONDER;
1550 - host->disable_time = 60;
1551 + host->disable_time = 1;
1552 host->break_scriptfilename_for_php = 0;
1553 host->allow_xsendfile = 0; /* handle X-LIGHTTPD-send-file */
1554 host->kill_signal = SIGTERM;
1555 @@ -1286,19 +1281,16 @@
1557 fcv[5].destination = &(host->check_local);
1558 fcv[6].destination = &(host->port);
1559 - fcv[7].destination = &(host->min_procs);
1560 - fcv[8].destination = &(host->max_procs);
1561 - fcv[9].destination = &(host->max_load_per_proc);
1562 - fcv[10].destination = &(host->idle_timeout);
1563 - fcv[11].destination = &(host->disable_time);
1564 + fcv[7].destination = &(host->max_procs);
1565 + fcv[8].destination = &(host->disable_time);
1567 - fcv[12].destination = host->bin_env;
1568 - fcv[13].destination = host->bin_env_copy;
1569 - fcv[14].destination = &(host->break_scriptfilename_for_php);
1570 - fcv[15].destination = &(host->allow_xsendfile);
1571 - fcv[16].destination = host->strip_request_uri;
1572 - fcv[17].destination = &(host->kill_signal);
1573 - fcv[18].destination = &(host->fix_root_path_name);
1574 + fcv[9].destination = host->bin_env;
1575 + fcv[10].destination = host->bin_env_copy;
1576 + fcv[11].destination = &(host->break_scriptfilename_for_php);
1577 + fcv[12].destination = &(host->allow_xsendfile);
1578 + fcv[13].destination = host->strip_request_uri;
1579 + fcv[14].destination = &(host->kill_signal);
1580 + fcv[15].destination = &(host->fix_root_path_name);
1582 if (0 != config_insert_values_internal(srv, da_host->value, fcv)) {
1583 return HANDLER_ERROR;
1584 @@ -1355,23 +1347,16 @@
1585 /* a local socket + self spawning */
1588 - /* HACK: just to make sure the adaptive spawing is disabled */
1589 - host->min_procs = host->max_procs;
1591 - if (host->min_procs > host->max_procs) host->max_procs = host->min_procs;
1592 - if (host->max_load_per_proc < 1) host->max_load_per_proc = 0;
1595 - log_error_write(srv, __FILE__, __LINE__, "ssbsdsbsdsd",
1596 + log_error_write(srv, __FILE__, __LINE__, "ssbsdsbsd",
1597 "--- fastcgi spawning local",
1598 "\n\tproc:", host->bin_path,
1599 "\n\tport:", host->port,
1600 "\n\tsocket", host->unixsocket,
1601 - "\n\tmin-procs:", host->min_procs,
1602 "\n\tmax-procs:", host->max_procs);
1605 - for (pno = 0; pno < host->min_procs; pno++) {
1606 + for (pno = 0; pno < host->max_procs; pno++) {
1609 proc = fastcgi_process_init();
1610 @@ -1391,7 +1376,7 @@
1611 "--- fastcgi spawning",
1612 "\n\tport:", host->port,
1613 "\n\tsocket", host->unixsocket,
1614 - "\n\tcurrent:", pno, "/", host->min_procs);
1615 + "\n\tcurrent:", pno, "/", host->max_procs);
1618 if (fcgi_spawn_connection(srv, p, host, proc)) {
1619 @@ -1426,7 +1411,6 @@
1623 - host->min_procs = 1;
1624 host->max_procs = 1;
1627 @@ -2739,7 +2723,7 @@
1628 log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
1629 "--- fastcgi spawning",
1630 "\n\tsocket", proc->connection_name,
1631 - "\n\tcurrent:", 1, "/", host->min_procs);
1632 + "\n\tcurrent:", 1, "/", host->max_procs);
1635 if (fcgi_spawn_connection(srv, p, host, proc)) {
1636 @@ -2778,8 +2762,11 @@
1637 * - tcp socket (do not check host->host->uses, as it may be not set which means INADDR_LOOPBACK)
1641 - (!host->port && !host->unixsocket->used)) {
1643 + log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: host = NULL");
1644 + return HANDLER_ERROR;
1646 + if ((!host->port && !host->unixsocket->used)) {
1647 log_error_write(srv, __FILE__, __LINE__, "sxddd",
1650 @@ -2787,7 +2774,7 @@
1652 host->unixsocket->used);
1654 - hctx->proc->disabled_until = srv->cur_ts + 10;
1655 + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
1656 hctx->proc->state = PROC_STATE_DIED;
1658 return HANDLER_ERROR;
1659 @@ -2803,7 +2790,7 @@
1660 log_error_write(srv, __FILE__, __LINE__, "ss",
1661 "getsockopt failed:", strerror(errno));
1663 - hctx->proc->disabled_until = srv->cur_ts + 10;
1664 + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
1665 hctx->proc->state = PROC_STATE_DIED;
1667 return HANDLER_ERROR;
1668 @@ -2817,7 +2804,7 @@
1669 "socket:", hctx->proc->connection_name);
1672 - hctx->proc->disabled_until = srv->cur_ts + 5;
1673 + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
1675 if (hctx->proc->is_local) {
1676 hctx->proc->state = PROC_STATE_DIED_WAIT_FOR_PID;
1677 @@ -2910,13 +2897,13 @@
1678 /* cool down the backend, it is overloaded
1681 - log_error_write(srv, __FILE__, __LINE__, "ssdsd",
1682 - "backend is overloaded; we'll disable it for 2 seconds and send the request to another backend instead:",
1683 + log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
1684 + "backend is overloaded; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
1685 "reconnects:", hctx->reconnects,
1686 "load:", host->load);
1689 - hctx->proc->disabled_until = srv->cur_ts + 2;
1690 + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
1691 hctx->proc->state = PROC_STATE_OVERLOADED;
1693 fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
1694 @@ -2930,18 +2917,18 @@
1695 * - ECONNREFUSED for tcp-ip sockets
1696 * - ENOENT for unix-domain-sockets
1698 - * for check if the host is back in 5 seconds
1699 + * for check if the host is back in hctx->host->disable_time seconds
1702 - hctx->proc->disabled_until = srv->cur_ts + 5;
1703 + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
1704 if (hctx->proc->is_local) {
1705 hctx->proc->state = PROC_STATE_DIED_WAIT_FOR_PID;
1707 hctx->proc->state = PROC_STATE_DIED;
1710 - log_error_write(srv, __FILE__, __LINE__, "ssdsd",
1711 - "backend died; we'll disable it for 5 seconds and send the request to another backend instead:",
1712 + log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
1713 + "backend died; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
1714 "reconnects:", hctx->reconnects,
1715 "load:", host->load);
1717 @@ -3032,11 +3019,6 @@
1718 "reconnect attempts:", hctx->reconnects);
1720 return HANDLER_ERROR;
1723 - fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
1725 - return HANDLER_WAIT_FOR_EVENT;
1727 log_error_write(srv, __FILE__, __LINE__, "ssd",
1728 "write failed:", strerror(errno), errno);
1729 @@ -3266,7 +3248,7 @@
1730 log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
1731 "--- fastcgi spawning",
1732 "\n\tsocket", proc->connection_name,
1733 - "\n\tcurrent:", 1, "/", host->min_procs);
1734 + "\n\tcurrent:", 1, "/", host->max_procs);
1737 if (fcgi_spawn_connection(srv, p, host, proc)) {
1738 @@ -3489,25 +3471,27 @@
1739 /* check if extension matches */
1740 for (k = 0; k < p->conf.exts->used; k++) {
1741 size_t ct_len; /* length of the config entry */
1742 + fcgi_extension *ext = p->conf.exts->exts[k];
1744 - extension = p->conf.exts->exts[k];
1745 + if (ext->key->used == 0) continue;
1747 - if (extension->key->used == 0) continue;
1748 + ct_len = ext->key->used - 1;
1750 - ct_len = extension->key->used - 1;
1752 /* check _url_ in the form "/fcgi_pattern" */
1753 - if (extension->key->ptr[0] == '/') {
1754 + if (ext->key->ptr[0] == '/') {
1755 if ((ct_len <= con->uri.path->used -1) &&
1756 - (strncmp(con->uri.path->ptr, extension->key->ptr, ct_len) == 0))
1757 + (strncmp(con->uri.path->ptr, ext->key->ptr, ct_len) == 0)) {
1760 - } else if ((ct_len <= s_len) && (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len))) {
1762 + } else if ((ct_len <= s_len) && (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len))) {
1763 /* check extension in the form ".fcg" */
1768 /* extension doesn't match */
1769 - if (k == p->conf.exts->used) {
1770 + if (NULL == extension) {
1771 return HANDLER_GO_ON;
1774 @@ -3727,107 +3711,12 @@
1775 for (n = 0; n < ex->used; n++) {
1778 - unsigned long sum_load = 0;
1779 fcgi_extension_host *host;
1781 host = ex->hosts[n];
1783 fcgi_restart_dead_procs(srv, p, host);
1785 - for (proc = host->first; proc; proc = proc->next) {
1786 - sum_load += proc->load;
1789 - if (host->num_procs &&
1790 - host->num_procs < host->max_procs &&
1791 - (sum_load / host->num_procs) > host->max_load_per_proc) {
1792 - /* overload, spawn new child */
1793 - if (p->conf.debug) {
1794 - log_error_write(srv, __FILE__, __LINE__, "s",
1795 - "overload detected, spawning a new child");
1798 - for (proc = host->unused_procs; proc && proc->pid != 0; proc = proc->next);
1801 - if (proc == host->unused_procs) host->unused_procs = proc->next;
1803 - if (proc->next) proc->next->prev = NULL;
1807 - proc = fastcgi_process_init();
1808 - proc->id = host->max_id++;
1811 - host->num_procs++;
1813 - if (buffer_is_empty(host->unixsocket)) {
1814 - proc->port = host->port + proc->id;
1816 - buffer_copy_string_buffer(proc->unixsocket, host->unixsocket);
1817 - buffer_append_string_len(proc->unixsocket, CONST_STR_LEN("-"));
1818 - buffer_append_long(proc->unixsocket, proc->id);
1821 - if (fcgi_spawn_connection(srv, p, host, proc)) {
1822 - log_error_write(srv, __FILE__, __LINE__, "s",
1823 - "ERROR: spawning fcgi failed.");
1824 - return HANDLER_ERROR;
1827 - proc->prev = NULL;
1828 - proc->next = host->first;
1829 - if (host->first) {
1830 - host->first->prev = proc;
1832 - host->first = proc;
1835 - for (proc = host->first; proc; proc = proc->next) {
1836 - if (proc->load != 0) break;
1837 - if (host->num_procs <= host->min_procs) break;
1838 - if (proc->pid == 0) continue;
1840 - if (srv->cur_ts - proc->last_used > host->idle_timeout) {
1841 - /* a proc is idling for a long time now,
1844 - if (p->conf.debug) {
1845 - log_error_write(srv, __FILE__, __LINE__, "ssbsd",
1846 - "idle-timeout reached; terminating child:",
1847 - "socket:", proc->connection_name,
1848 - "pid", proc->pid);
1852 - if (proc->next) proc->next->prev = proc->prev;
1853 - if (proc->prev) proc->prev->next = proc->next;
1855 - if (proc->prev == NULL) host->first = proc->next;
1857 - proc->prev = NULL;
1858 - proc->next = host->unused_procs;
1860 - if (host->unused_procs) host->unused_procs->prev = proc;
1861 - host->unused_procs = proc;
1863 - kill(proc->pid, SIGTERM);
1865 - proc->state = PROC_STATE_KILLED;
1867 - log_error_write(srv, __FILE__, __LINE__, "ssbsd",
1869 - "socket:", proc->connection_name,
1870 - "pid", proc->pid);
1872 - host->num_procs--;
1874 - /* proc is now in unused, let the next second handle the next process */
1879 for (proc = host->unused_procs; proc; proc = proc->next) {
1882 Index: src/fdevent_poll.c
1883 ===================================================================
1884 --- src/fdevent_poll.c (.../tags/lighttpd-1.4.23) (revision 2613)
1885 +++ src/fdevent_poll.c (.../branches/lighttpd-1.4.x) (revision 2613)
1887 if (poll_r & POLLNVAL) r |= FDEVENT_NVAL;
1888 if (poll_r & POLLPRI) r |= FDEVENT_PRI;
1890 - return ev->pollfds[ndx].revents;
1894 static int fdevent_poll_event_get_fd(fdevents *ev, size_t ndx) {
1895 Index: src/fdevent_select.c
1896 ===================================================================
1897 --- src/fdevent_select.c (.../tags/lighttpd-1.4.23) (revision 2613)
1898 +++ src/fdevent_select.c (.../branches/lighttpd-1.4.x) (revision 2613)
1902 /* we should be protected by max-fds, but you never know */
1903 - assert(fd < FD_SETSIZE);
1904 + assert(fd < ((int)FD_SETSIZE));
1906 if (events & FDEVENT_IN) {
1907 FD_SET(fd, &(ev->select_set_read));
1908 Index: src/CMakeLists.txt
1909 ===================================================================
1911 ===================================================================
1912 --- src/server.c (.../tags/lighttpd-1.4.23) (revision 2613)
1913 +++ src/server.c (.../branches/lighttpd-1.4.x) (revision 2613)
1915 CLEAN(cond_check_buf);
1917 CLEAN(srvconf.errorlog_file);
1918 + CLEAN(srvconf.breakagelog_file);
1919 CLEAN(srvconf.groupname);
1920 CLEAN(srvconf.username);
1921 CLEAN(srvconf.changeroot);
1923 srv->srvconf.reject_expect_100_with_417 = 1;
1926 - srv->errorlog_fd = -1;
1927 - srv->errorlog_mode = ERRORLOG_STDERR;
1928 + srv->errorlog_fd = STDERR_FILENO;
1929 + srv->errorlog_mode = ERRORLOG_FD;
1931 srv->split_vals = array_init();
1934 CLEAN(cond_check_buf);
1936 CLEAN(srvconf.errorlog_file);
1937 + CLEAN(srvconf.breakagelog_file);
1938 CLEAN(srvconf.groupname);
1939 CLEAN(srvconf.username);
1940 CLEAN(srvconf.changeroot);
1944 if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
1945 - srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
1946 + srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
1948 srv->max_fds = rlim.rlim_cur;
1952 if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
1953 /* don't raise the limit above FD_SET_SIZE */
1954 - if (srv->max_fds > FD_SETSIZE - 200) {
1955 + if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
1956 log_error_write(srv, __FILE__, __LINE__, "sd",
1957 "can't raise max filedescriptors above", FD_SETSIZE - 200,
1958 "if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");
1960 * Change group before chroot, when we have access
1963 - if (srv->srvconf.groupname->used) {
1964 + if (NULL != grp) {
1965 setgid(grp->gr_gid);
1967 if (srv->srvconf.username->used) {
1971 /* drop root privs */
1972 - if (srv->srvconf.username->used) {
1973 + if (NULL != pwd) {
1974 setuid(pwd->pw_uid);
1980 if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
1981 - srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
1982 + srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
1984 srv->max_fds = rlim.rlim_cur;
1988 if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
1989 /* don't raise the limit above FD_SET_SIZE */
1990 - if (srv->max_fds > FD_SETSIZE - 200) {
1991 + if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
1992 log_error_write(srv, __FILE__, __LINE__, "sd",
1993 "can't raise max filedescriptors above", FD_SETSIZE - 200,
1994 "if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");
1995 Index: src/mod_dirlisting.c
1996 ===================================================================
1997 --- src/mod_dirlisting.c (.../tags/lighttpd-1.4.23) (revision 2613)
1998 +++ src/mod_dirlisting.c (.../branches/lighttpd-1.4.x) (revision 2613)
2002 if (NULL != (du = array_get_element(ca, option))) {
2003 - data_array *da = (data_array *)du;
2007 if (du->type != TYPE_ARRAY) {
2008 Index: src/mod_magnet.c
2009 ===================================================================
2010 --- src/mod_magnet.c (.../tags/lighttpd-1.4.23) (revision 2613)
2011 +++ src/mod_magnet.c (.../branches/lighttpd-1.4.x) (revision 2613)
2012 @@ -283,17 +283,11 @@
2015 static int magnet_reqhdr_get(lua_State *L) {
2020 const char *key = luaL_checkstring(L, 2);
2022 - lua_pushstring(L, "lighty.srv");
2023 - lua_gettable(L, LUA_REGISTRYINDEX);
2024 - srv = lua_touserdata(L, -1);
2027 lua_pushstring(L, "lighty.con");
2028 lua_gettable(L, LUA_REGISTRYINDEX);
2029 con = lua_touserdata(L, -1);
2031 ===================================================================
2032 --- src/log.c (.../tags/lighttpd-1.4.23) (revision 2613)
2033 +++ src/log.c (.../branches/lighttpd-1.4.x) (revision 2613)
2035 /* create write pipe and spawn process */
2040 if (pipe(to_log_fds)) {
2041 log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
2046 - switch (pid = fork()) {
2050 close(STDIN_FILENO);
2051 @@ -150,14 +149,14 @@
2054 int log_error_open(server *srv) {
2055 - int close_stderr = 1;
2057 #ifdef HAVE_SYSLOG_H
2058 /* perhaps someone wants to use syslog() */
2059 openlog("lighttpd", LOG_CONS | LOG_PID, LOG_DAEMON);
2061 - srv->errorlog_mode = ERRORLOG_STDERR;
2063 + srv->errorlog_mode = ERRORLOG_FD;
2064 + srv->errorlog_fd = STDERR_FILENO;
2066 if (srv->srvconf.errorlog_use_syslog) {
2067 srv->errorlog_mode = ERRORLOG_SYSLOG;
2068 } else if (!buffer_is_empty(srv->srvconf.errorlog_file)) {
2069 @@ -171,20 +170,36 @@
2071 log_error_write(srv, __FILE__, __LINE__, "s", "server started");
2073 -#ifdef HAVE_VALGRIND_VALGRIND_H
2074 - /* don't close stderr for debugging purposes if run in valgrind */
2075 - if (RUNNING_ON_VALGRIND) close_stderr = 0;
2078 - if (srv->errorlog_mode == ERRORLOG_STDERR && srv->srvconf.dont_daemonize) {
2079 + if (srv->errorlog_mode == ERRORLOG_FD && !srv->srvconf.dont_daemonize) {
2080 /* We can only log to stderr in dont-daemonize mode;
2081 * if we do daemonize and no errorlog file is specified, we log into /dev/null
2084 + srv->errorlog_fd = -1;
2087 - /* move stderr to /dev/null */
2088 - if (close_stderr) openDevNull(STDERR_FILENO);
2089 + if (!buffer_is_empty(srv->srvconf.breakagelog_file)) {
2091 + const char *logfile = srv->srvconf.breakagelog_file->ptr;
2093 + if (srv->errorlog_mode == ERRORLOG_FD) {
2094 + srv->errorlog_fd = dup(STDERR_FILENO);
2096 + fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
2100 + if (-1 == (breakage_fd = open_logfile_or_pipe(srv, logfile))) {
2104 + if (STDERR_FILENO != breakage_fd) {
2105 + dup2(breakage_fd, STDERR_FILENO);
2106 + close(breakage_fd);
2108 + } else if (!srv->srvconf.dont_daemonize) {
2109 + /* move stderr to /dev/null */
2110 + openDevNull(STDERR_FILENO);
2115 @@ -235,15 +250,19 @@
2116 switch(srv->errorlog_mode) {
2119 - close(srv->errorlog_fd);
2121 + if (-1 != srv->errorlog_fd) {
2122 + /* don't close STDERR */
2123 + if (STDERR_FILENO != srv->errorlog_fd)
2124 + close(srv->errorlog_fd);
2125 + srv->errorlog_fd = -1;
2128 case ERRORLOG_SYSLOG:
2129 #ifdef HAVE_SYSLOG_H
2133 - case ERRORLOG_STDERR:
2139 switch(srv->errorlog_mode) {
2142 - case ERRORLOG_STDERR:
2144 + if (-1 == srv->errorlog_fd) return 0;
2145 /* cache the generated timestamp */
2146 if (srv->cur_ts != srv->last_generated_debug_ts) {
2147 buffer_prepare_copy(srv->ts_debug_str, 255);
2148 @@ -349,13 +369,10 @@
2149 switch(srv->errorlog_mode) {
2153 buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
2154 write(srv->errorlog_fd, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
2156 - case ERRORLOG_STDERR:
2157 - buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
2158 - write(STDERR_FILENO, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
2160 case ERRORLOG_SYSLOG:
2161 syslog(LOG_ERR, "%s", srv->errorlog_buf->ptr);
2163 Index: src/proc_open.c
2164 ===================================================================
2165 --- src/proc_open.c (.../tags/lighttpd-1.4.23) (revision 2613)
2166 +++ src/proc_open.c (.../branches/lighttpd-1.4.x) (revision 2613)
2167 @@ -309,6 +309,14 @@
2170 proc_read_fd_to_buffer(proc.err.fd, err);
2172 + buffer *tmp = buffer_init();
2173 + proc_read_fd_to_buffer(proc.err.fd, tmp);
2174 + if (tmp->used > 0 && write(2, (void*)tmp->ptr, tmp->used) < 0) {
2175 + perror("error writing pipe");
2180 pipe_close(&proc.err);
2182 Index: tests/.cvsignore
2183 ===================================================================
2184 --- tests/.cvsignore (.../tags/lighttpd-1.4.23) (revision 2613)
2185 +++ tests/.cvsignore (.../branches/lighttpd-1.4.x) (revision 2613)
2193 Index: tests/bug-12.conf
2194 ===================================================================
2195 --- tests/bug-12.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2196 +++ tests/bug-12.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2198 ## bind to localhost (default: all interfaces)
2199 server.bind = "localhost"
2200 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2201 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2202 server.name = "www.example.org"
2203 server.tag = "Apache 1.3.29"
2205 Index: tests/fastcgi-10.conf
2206 ===================================================================
2207 --- tests/fastcgi-10.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2208 +++ tests/fastcgi-10.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2210 ## bind to localhost (default: all interfaces)
2211 server.bind = "localhost"
2212 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2213 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2214 server.name = "www.example.org"
2215 server.tag = "Apache 1.3.29"
2217 Index: tests/bug-06.conf
2218 ===================================================================
2219 --- tests/bug-06.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2220 +++ tests/bug-06.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2222 ## bind to localhost (default: all interfaces)
2223 server.bind = "localhost"
2224 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2225 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2226 server.name = "www.example.org"
2227 server.tag = "Apache 1.3.29"
2229 Index: tests/mod-extforward.conf
2230 ===================================================================
2231 --- tests/mod-extforward.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2232 +++ tests/mod-extforward.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2234 ## bind to localhost (default: all interfaces)
2235 server.bind = "localhost"
2236 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2237 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2238 server.name = "www.example.org"
2239 server.tag = "Apache 1.3.29"
2241 Index: tests/var-include.conf
2242 ===================================================================
2243 --- tests/var-include.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2244 +++ tests/var-include.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2246 ## bind to localhost (default: all interfaces)
2247 server.bind = "localhost"
2248 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2249 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2250 server.name = "www.example.org"
2251 server.tag = "Apache 1.3.29"
2253 Index: tests/404-handler.conf
2254 ===================================================================
2255 --- tests/404-handler.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2256 +++ tests/404-handler.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2258 ## bind to localhost (default: all interfaces)
2259 server.bind = "localhost"
2260 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2261 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2262 server.name = "www.example.org"
2263 server.tag = "Apache 1.3.29"
2265 Index: tests/lowercase.conf
2266 ===================================================================
2267 --- tests/lowercase.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2268 +++ tests/lowercase.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2270 ## bind to localhost (default: all interfaces)
2271 server.bind = "localhost"
2272 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2273 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2275 server.force-lowercase-filenames = "enable"
2277 Index: tests/condition.conf
2278 ===================================================================
2279 --- tests/condition.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2280 +++ tests/condition.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2282 ## bind to localhost (default: all interfaces)
2283 server.bind = "localhost"
2284 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2285 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2286 server.name = "www.example.org"
2287 server.tag = "Apache 1.3.29"
2289 Index: tests/fastcgi-13.conf
2290 ===================================================================
2291 --- tests/fastcgi-13.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2292 +++ tests/fastcgi-13.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2294 ## bind to localhost (default: all interfaces)
2295 server.bind = "localhost"
2296 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2297 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2298 server.name = "www.example.org"
2299 server.tag = "Apache 1.3.29"
2301 Index: tests/mod-compress.conf
2302 ===================================================================
2303 --- tests/mod-compress.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2304 +++ tests/mod-compress.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2306 ## bind to localhost (default: all interfaces)
2307 server.bind = "localhost"
2308 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2309 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2310 server.name = "www.example.org"
2313 Index: tests/lighttpd.conf
2314 ===================================================================
2315 --- tests/lighttpd.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2316 +++ tests/lighttpd.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2318 ## bind to localhost (default: all interfaces)
2319 server.bind = "localhost"
2320 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2321 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2322 server.name = "www.example.org"
2323 server.tag = "Apache 1.3.29"
2325 Index: tests/fastcgi-responder.conf
2326 ===================================================================
2327 --- tests/fastcgi-responder.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2328 +++ tests/fastcgi-responder.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2330 ## bind to localhost (default: all interfaces)
2331 server.bind = "localhost"
2332 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2333 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2334 server.name = "www.example.org"
2335 server.tag = "Apache 1.3.29"
2337 Index: tests/fastcgi-auth.conf
2338 ===================================================================
2339 --- tests/fastcgi-auth.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2340 +++ tests/fastcgi-auth.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2342 ## bind to localhost (default: all interfaces)
2343 server.bind = "localhost"
2344 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2345 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2346 server.name = "www.example.org"
2347 server.tag = "Apache 1.3.29"
2349 Index: tests/proxy.conf
2350 ===================================================================
2351 --- tests/proxy.conf (.../tags/lighttpd-1.4.23) (revision 2613)
2352 +++ tests/proxy.conf (.../branches/lighttpd-1.4.x) (revision 2613)
2354 ## bind to localhost (default: all interfaces)
2355 server.bind = "localhost"
2356 server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2357 +server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
2358 server.name = "www.example.org"
2359 server.tag = "Proxy"
2361 Index: tests/LightyTest.pm
2362 ===================================================================
2363 --- tests/LightyTest.pm (.../tags/lighttpd-1.4.23) (revision 2613)
2364 +++ tests/LightyTest.pm (.../branches/lighttpd-1.4.x) (revision 2613)
2369 + my $timeout = 5*10; # 5 secs, select waits 0.1 s
2371 while (0 == $self->listening_on($port)) {
2372 select(undef, undef, undef, 0.1);
2375 # the process is gone, we failed
2376 if (0 != waitpid($child, WNOHANG)) {
2379 + if (0 >= $timeout) {
2380 + diag("Timeout while trying to connect; killing child");
2381 + kill('TERM', $child);
2388 ===================================================================
2389 --- configure.ac (.../tags/lighttpd-1.4.23) (revision 2613)
2390 +++ configure.ac (.../branches/lighttpd-1.4.x) (revision 2613)
2393 # Process this file with autoconf to produce a configure script.
2395 -AC_INIT([lighttpd], [1.4.23], [contact@lighttpd.net])
2396 +AC_INIT([lighttpd], [1.4.24], [contact@lighttpd.net])
2397 AC_CONFIG_SRCDIR([src/server.c])
2398 AC_CONFIG_HEADER([config.h])
2400 @@ -417,12 +417,18 @@
2401 AC_DEFINE([HAVE_LUA], [1], [liblua])
2402 AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
2404 - # for debian based systems
2405 - PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
2406 - AC_DEFINE([HAVE_LUA], [1], [liblua])
2407 - AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
2409 + # for debian based systems
2410 + PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
2411 + AC_DEFINE([HAVE_LUA], [1], [liblua])
2412 + AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
2415 + PKG_CHECK_MODULES(LUA, lua-5.1 >= 5.1, [
2416 + AC_DEFINE([HAVE_LUA], [1], [liblua])
2417 + AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
2422 AC_SUBST(LUA_CFLAGS)
2424 Index: doc/.cvsignore
2425 ===================================================================
2426 --- doc/.cvsignore (.../tags/lighttpd-1.4.23) (revision 2613)
2427 +++ doc/.cvsignore (.../branches/lighttpd-1.4.x) (revision 2613)
2433 Index: doc/fastcgi.txt
2434 ===================================================================
2435 --- doc/fastcgi.txt (.../tags/lighttpd-1.4.23) (revision 2613)
2436 +++ doc/fastcgi.txt (.../branches/lighttpd-1.4.x) (revision 2613)
2439 ( "host" => <string> ,
2440 "port" => <integer> ,
2441 - "socket" => <string>, # either socket
2443 - "bin-path" => <string>, # OPTIONAL
2444 - "bin-environment" => <array>, # OPTIONAL
2445 - "bin-copy-environment" => <array>, # OPTIONAL
2446 + "socket" => <string>, # either socket
2448 + "bin-path" => <string>, # OPTIONAL
2449 + "bin-environment" => <array>, # OPTIONAL
2450 + "bin-copy-environment" => <array>, # OPTIONAL
2451 "mode" => <string>, # OPTIONAL
2452 "docroot" => <string> , # OPTIONAL if "mode"
2453 - # is not "authorizer"
2454 + # is not "authorizer"
2455 "check-local" => <string>, # OPTIONAL
2456 - "min-procs" => <integer>, # OPTIONAL
2457 - "max-procs" => <integer>, # OPTIONAL
2458 - "max-load-per-proc" => <integer>, # OPTIONAL
2459 - "idle-timeout" => <integer>, # OPTIONAL
2460 - "broken-scriptfilename" => <boolean>, # OPTIONAL
2461 + "max-procs" => <integer>, # OPTIONAL
2462 + "broken-scriptfilename" => <boolean>, # OPTIONAL
2463 "disable-time" => <integer>, # optional
2464 - "allow-x-send-file" => <boolean> # optional
2466 + "allow-x-send-file" => <boolean>, # optional
2467 + "kill-signal" => <integer>, # OPTIONAL
2468 + "fix-root-scriptname" => <boolean>,
2473 @@ -127,42 +126,38 @@
2474 :"socket": path to the unix-domain socket
2475 :"mode": is the FastCGI protocol mode.
2476 Default is "responder", also "authorizer"
2477 - mode is implemented.
2478 + mode is implemented.
2479 :"docroot": is optional and is the docroot on the remote
2480 host for default "responder" mode. For
2481 - "authorizer" mode it is MANDATORY and it points
2482 - to docroot for authorized requests. For security
2483 - reasons it is recommended to keep this docroot
2484 + "authorizer" mode it is MANDATORY and it points
2485 + to docroot for authorized requests. For security
2486 + reasons it is recommended to keep this docroot
2487 outside of server.document-root tree.
2488 :"check-local": is optional and may be "enable" (default) or
2489 "disable". If enabled the server first check
2490 - for a file in local server.document-root tree
2491 - and return 404 (Not Found) if no such file.
2492 + for a file in local server.document-root tree
2493 + and return 404 (Not Found) if no such file.
2494 If disabled, the server forward request to
2495 - FastCGI interface without this check.
2496 + FastCGI interface without this check.
2497 :"broken-scriptfilename": breaks SCRIPT_FILENAME in a wat that
2498 PHP can extract PATH_INFO from it (default: disabled)
2499 :"disable-time": time to wait before a disabled backend is checked
2501 :"allow-x-send-file": controls if X-LIGHTTPD-send-file headers
2503 + :"fix-root-scriptname": fix broken path-info split for "/" extension ("prefix")
2507 - :"min-procs": sets the minium processes to start
2508 :"max-procs": the upper limit of the processess to start
2509 - :"max-load-per-proc": maximum number of waiting processes on
2510 - average per process before a new process is
2512 - :"idle-timeout": number of seconds before a unused process
2514 :"bin-environment": put an entry into the environment of
2516 :"bin-copy-environement": clean up the environment and copy
2517 only the specified entries into the fresh
2518 environment of the spawn process
2519 + :"kill-signal": signal to terminate the FastCGI process with,
2520 + defauls to SIGTERM
2526 @@ -171,11 +166,11 @@
2527 fastcgi.server = ( ".php" =>
2528 (( "host" => "127.0.0.1",
2530 - "bin-path" => "/usr/local/bin/php"
2531 + "bin-path" => "/usr/local/bin/php"
2534 (( "host" => "127.0.0.1",
2540 @@ -183,10 +178,10 @@
2542 fastcgi.server = ( "/remote_scripts/" =>
2543 (( "host" => "192.168.0.3",
2546 "check-local" => "disable",
2547 "docroot" => "/" # remote server may use
2548 - # it's own docroot
2549 + # it's own docroot
2555 fastcgi.server = ( "/remote_scripts/" =>
2556 (( "host" => "10.0.0.2",
2559 "docroot" => "/path_to_private_docs",
2560 "mode" => "authorizer"
2562 @@ -318,10 +313,10 @@
2563 $ PHP_FCGI_CHILDREN=384 ./lighttpd -f ./lighttpd.conf
2565 fastcgi.server = ( ".php" =>
2566 - (( "socket" => "/tmp/php.socket",
2567 + (( "socket" => "/tmp/php.socket",
2568 "bin-path" => "/usr/local/bin/php",
2572 "max-load-per-proc" => 4,
2573 "idle-timeout" => 20
2576 "PHP_FCGI_CHILDREN" => "16",
2577 "PHP_FCGI_MAX_REQUESTS" => "10000" ),
2578 "bin-copy-environment" => (
2579 - "PATH", "SHELL", "USER" )
2580 + "PATH", "SHELL", "USER" )
2585 ===================================================================
2587 ===================================================================
2588 --- NEWS (.../tags/lighttpd-1.4.23) (revision 2613)
2589 +++ NEWS (.../branches/lighttpd-1.4.x) (revision 2613)
2596 + * Add T_CONFIG_INT for bigger integers from the config (needed for #1966)
2597 + * Use unsigned int (and T_CONFIG_INT) for max_request_size
2598 + * Use unsigned int for secdownload.timeout (fixes #1966)
2599 + * Keep url/host values from connection to display information while keep-alive in mod_status (fixes #1202)
2600 + * Add server.breakagelog, a "special" stderr (fixes #1863)
2601 + * Fix config evaluation for debug.log-timeouts option (#1529)
2602 + * Add "cgi.execute-x-only" to mod_cgi, requires +x for cgi scripts (fixes #2013)
2603 + * Fix FD_SETSIZE comparision warnings
2604 + * Add "lua-5.1" to searched pkg-config names for lua
2605 + * Fix unused function webdav_lockdiscovery in mod_webdav
2606 + * cmake: Fix crypt lib check
2607 + * cmake: Add -export-dynamic to link flags, fixes build on FreeBSD
2608 + * Set FD_CLOEXEC for bound sockets before pipe-logger forks (fixes #2026)
2609 + * Reset ignored signals to SIG_DFL before exec() in fastcgi/scgi (fixes #2029)
2610 + * Show "no uri specified -> 400" error only when "debug.log-request-header-on-error" is enabled (fixes #2030)
2611 + * Fix hanging connection in mod_scgi (fixes #2024)
2612 + * Allow digits in hostnames in more places (fixes #1148)
2613 + * Use connection_reset instead of handle_request_done for cleanup callbacks
2614 + * Change mod_expire to append Cache-Control instead of overwriting it (fixes #1997)
2615 + * Allow all comparisons for $SERVER["socket"] - only bind for "=="
2616 + * Remove strptime failed message (fixes #2031)
2617 + * Fix issues found with clang analyzer
2618 + * Try to fix server.tag issue with localized svnversion
2619 + * Fix handling network-write return values (#2024)
2620 + * Use disable-time in fastcgi for all disables after errors, default is 1sec (fixes #2040)
2621 + * Remove adaptive spawning code from fastcgi (was disabled for a long time)
2622 + * Allow mod_mysql_vhost to use stored procedures (fixes #2011, thx Ben Brown)
2623 + * Fix ipv6 in mod_proxy (fixes #2043)
2624 + * Print errors from include_shell to stderr
2625 + * Set tm.tm_isdst = 0 before mktime() (fixes #2047)
2626 + * Use linux-epoll by default if available (fixes #2021, thx Olaf van der Spek)
2628 +- 1.4.23 - 2009-06-19
2629 * Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
2630 * New lighttpd man page (moved it to section 8) (fixes #1875)
2631 * Create rrd file for empty rrdfile in mod_rrdtool (#1788)
2632 Index: CMakeLists.txt
2633 ===================================================================