2 ===================================================================
3 Index: src/spawn-fcgi.c
4 ===================================================================
5 --- src/spawn-fcgi.c (.../tags/lighttpd-1.4.22) (revision 2475)
6 +++ src/spawn-fcgi.c (.../branches/lighttpd-1.4.x) (revision 2475)
8 -#include <sys/types.h>
10 -#include <sys/stat.h>
33 -#define FCGI_LISTENSOCK_FILENO 0
35 -#include "sys-socket.h"
37 -#ifdef HAVE_SYS_WAIT_H
38 -#include <sys/wait.h>
41 -/* for solaris 2.5 and netbsd 1.3.x */
42 -#ifndef HAVE_SOCKLEN_T
43 -typedef int socklen_t;
47 -int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int fork_count, int child_count, int pid_fd, int nofork) {
49 - int socket_type, status, rc = 0;
50 - struct timeval tv = { 0, 100 * 1000 };
52 - struct sockaddr_un fcgi_addr_un;
53 - struct sockaddr_in fcgi_addr_in;
54 - struct sockaddr *fcgi_addr;
58 - if (child_count < 2) {
62 - if (child_count > 256) {
68 - memset(&fcgi_addr_un, 0, sizeof(fcgi_addr_un));
70 - fcgi_addr_un.sun_family = AF_UNIX;
71 - strcpy(fcgi_addr_un.sun_path, unixsocket);
74 - servlen = SUN_LEN(&fcgi_addr_un);
77 - servlen = strlen(fcgi_addr_un.sun_path) + sizeof(fcgi_addr_un.sun_family);
79 - socket_type = AF_UNIX;
80 - fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
82 - memset(&fcgi_addr_in, 0, sizeof(fcgi_addr_in));
83 - fcgi_addr_in.sin_family = AF_INET;
85 - fcgi_addr_in.sin_addr.s_addr = inet_addr(addr);
87 - fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
89 - fcgi_addr_in.sin_port = htons(port);
90 - servlen = sizeof(fcgi_addr_in);
92 - socket_type = AF_INET;
93 - fcgi_addr = (struct sockaddr *) &fcgi_addr_in;
96 - if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
97 - fprintf(stderr, "%s.%d\n",
98 - __FILE__, __LINE__);
102 - if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {
103 - /* server is not up, spawn in */
107 - if (unixsocket) unlink(unixsocket);
111 - /* reopen socket */
112 - if (-1 == (fcgi_fd = socket(socket_type, SOCK_STREAM, 0))) {
113 - fprintf(stderr, "%s.%d\n",
114 - __FILE__, __LINE__);
119 - if (setsockopt(fcgi_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
120 - fprintf(stderr, "%s.%d\n",
121 - __FILE__, __LINE__);
125 - /* create socket */
126 - if (-1 == bind(fcgi_fd, fcgi_addr, servlen)) {
127 - fprintf(stderr, "%s.%d: bind failed: %s\n",
128 - __FILE__, __LINE__,
133 - if (-1 == listen(fcgi_fd, 1024)) {
134 - fprintf(stderr, "%s.%d: fd = -1\n",
135 - __FILE__, __LINE__);
139 - while (fork_count-- > 0) {
149 - char cgi_childs[64];
154 - /* loose control terminal */
157 - /* is safe as we limit to 256 childs */
158 - sprintf(cgi_childs, "PHP_FCGI_CHILDREN=%d", child_count);
160 - if(fcgi_fd != FCGI_LISTENSOCK_FILENO) {
161 - close(FCGI_LISTENSOCK_FILENO);
162 - dup2(fcgi_fd, FCGI_LISTENSOCK_FILENO);
166 - max_fd = open("/dev/null", O_RDWR);
167 - close(STDERR_FILENO);
168 - dup2(max_fd, STDERR_FILENO);
171 - max_fd = open("/dev/null", O_RDWR);
172 - close(STDOUT_FILENO);
173 - dup2(max_fd, STDOUT_FILENO);
176 - /* we don't need the client socket */
177 - for (i = 3; i < max_fd; i++) {
178 - if (i != FCGI_LISTENSOCK_FILENO) close(i);
181 - /* create environment */
183 - putenv(cgi_childs);
185 - /* fork and replace shell */
187 - execv(appArgv[0], appArgv);
190 - char *b = malloc(strlen("exec ") + strlen(appPath) + 1);
191 - strcpy(b, "exec ");
192 - strcat(b, appPath);
195 - execl("/bin/sh", "sh", "-c", b, (char *)NULL);
209 - select(0, NULL, NULL, NULL, &tv);
211 - switch (waitpid(child, &status, WNOHANG)) {
213 - fprintf(stdout, "%s.%d: child spawned successfully: PID: %d\n",
214 - __FILE__, __LINE__,
217 - /* write pid file */
218 - if (pid_fd != -1) {
219 - /* assume a 32bit pid_t */
222 - snprintf(pidbuf, sizeof(pidbuf) - 1, "%d", child);
224 - write(pid_fd, pidbuf, strlen(pidbuf));
225 - /* avoid eol for the last one */
226 - if (fork_count != 0) {
227 - write(pid_fd, "\n", 1);
235 - if (WIFEXITED(status)) {
236 - fprintf(stderr, "%s.%d: child exited with: %d\n",
237 - __FILE__, __LINE__, WEXITSTATUS(status));
238 - rc = WEXITSTATUS(status);
239 - } else if (WIFSIGNALED(status)) {
240 - fprintf(stderr, "%s.%d: child signaled: %d\n",
241 - __FILE__, __LINE__,
245 - fprintf(stderr, "%s.%d: child died somehow: %d\n",
246 - __FILE__, __LINE__,
258 - fprintf(stderr, "%s.%d: socket is already used, can't spawn\n",
259 - __FILE__, __LINE__);
269 -void show_version () {
270 - char *b = "spawn-fcgi" "-" PACKAGE_VERSION \
271 -" - spawns fastcgi processes\n"
273 - write(1, b, strlen(b));
278 -"Usage: spawn-fcgi [options] -- <fcgiapp> [fcgi app arguments]\n" \
280 -"spawn-fcgi v" PACKAGE_VERSION " - spawns fastcgi processes\n" \
283 -" -f <fcgiapp> filename of the fcgi-application\n" \
284 -" -a <addr> bind to ip address\n" \
285 -" -p <port> bind to tcp-port\n" \
286 -" -s <path> bind to unix-domain socket\n" \
287 -" -C <childs> (PHP only) numbers of childs to spawn (default 5)\n" \
288 -" -F <childs> numbers of childs to fork (default 1)\n" \
289 -" -P <path> name of PID-file for spawed process\n" \
290 -" -n no fork (for daemontools)\n" \
291 -" -v show version\n" \
292 -" -h show this help\n" \
294 -" -c <dir> chroot to directory\n" \
295 -" -u <user> change to user-id\n" \
296 -" -g <group> change to group-id\n" \
298 - write(1, b, strlen(b));
302 -int main(int argc, char **argv) {
303 - char *fcgi_app = NULL, *changeroot = NULL, *username = NULL,
304 - *groupname = NULL, *unixsocket = NULL, *pid_file = NULL,
306 - char **fcgi_app_argv = { NULL };
307 - unsigned short port = 0;
308 - int child_count = 5;
309 - int fork_count = 1;
313 - struct sockaddr_un un;
315 - i_am_root = (getuid() == 0);
317 - while (-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:F:s:P:"))) {
319 - case 'f': fcgi_app = optarg; break;
320 - case 'a': addr = optarg;/* ip addr */ break;
321 - case 'p': port = strtol(optarg, NULL, 10);/* port */ break;
322 - case 'C': child_count = strtol(optarg, NULL, 10);/* */ break;
323 - case 'F': fork_count = strtol(optarg, NULL, 10);/* */ break;
324 - case 's': unixsocket = optarg; /* unix-domain socket */ break;
325 - case 'c': if (i_am_root) { changeroot = optarg; }/* chroot() */ break;
326 - case 'u': if (i_am_root) { username = optarg; } /* set user */ break;
327 - case 'g': if (i_am_root) { groupname = optarg; } /* set group */ break;
328 - case 'n': nofork = 1; break;
329 - case 'P': pid_file = optarg; /* PID file */ break;
330 - case 'v': show_version(); return 0;
331 - case 'h': show_help(); return 0;
338 - if (optind < argc) {
339 - fcgi_app_argv = &argv[optind];
342 - if ((fcgi_app == NULL && fcgi_app_argv == NULL) || (port == 0 && unixsocket == NULL)) {
347 - if (unixsocket && port) {
348 - fprintf(stderr, "%s.%d: %s\n",
349 - __FILE__, __LINE__,
350 - "either a unix domain socket or a tcp-port, but not both\n");
355 - if (unixsocket && strlen(unixsocket) > sizeof(un.sun_path) - 1) {
356 - fprintf(stderr, "%s.%d: %s\n",
357 - __FILE__, __LINE__,
358 - "path of the unix socket is too long\n");
364 - if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
365 - /* we are setuid-root */
367 - fprintf(stderr, "%s.%d: %s\n",
368 - __FILE__, __LINE__,
369 - "Are you nuts ? Don't apply a SUID bit to this binary\n");
375 - (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)))) {
377 - if (errno != EEXIST) {
378 - fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
379 - __FILE__, __LINE__,
380 - pid_file, strerror(errno));
385 - /* ok, file exists */
387 - if (0 != stat(pid_file, &st)) {
388 - fprintf(stderr, "%s.%d: stating pid-file '%s' failed: %s\n",
389 - __FILE__, __LINE__,
390 - pid_file, strerror(errno));
395 - /* is it a regular file ? */
397 - if (!S_ISREG(st.st_mode)) {
398 - fprintf(stderr, "%s.%d: pid-file exists and isn't regular file: '%s'\n",
399 - __FILE__, __LINE__,
405 - if (-1 == (pid_fd = open(pid_file, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) {
406 - fprintf(stderr, "%s.%d: opening pid-file '%s' failed: %s\n",
407 - __FILE__, __LINE__,
408 - pid_file, strerror(errno));
415 - struct group *grp = NULL;
416 - struct passwd *pwd = NULL;
418 - /* set user and group */
421 - if (NULL == (pwd = getpwnam(username))) {
422 - fprintf(stderr, "%s.%d: %s, %s\n",
423 - __FILE__, __LINE__,
424 - "can't find username", username);
428 - if (pwd->pw_uid == 0) {
429 - fprintf(stderr, "%s.%d: %s\n",
430 - __FILE__, __LINE__,
431 - "I will not set uid to 0\n");
437 - if (NULL == (grp = getgrnam(groupname))) {
438 - fprintf(stderr, "%s.%d: %s %s\n",
439 - __FILE__, __LINE__,
440 - "can't find groupname",
444 - if (grp->gr_gid == 0) {
445 - fprintf(stderr, "%s.%d: %s\n",
446 - __FILE__, __LINE__,
447 - "I will not set gid to 0\n");
451 - /* do the change before we do the chroot() */
452 - setgid(grp->gr_gid);
453 - setgroups(0, NULL);
456 - initgroups(username, grp->gr_gid);
462 - if (-1 == chroot(changeroot)) {
463 - fprintf(stderr, "%s.%d: %s %s\n",
464 - __FILE__, __LINE__,
465 - "chroot failed: ", strerror(errno));
468 - if (-1 == chdir("/")) {
469 - fprintf(stderr, "%s.%d: %s %s\n",
470 - __FILE__, __LINE__,
471 - "chdir failed: ", strerror(errno));
476 - /* drop root privs */
478 - setuid(pwd->pw_uid);
482 - return fcgi_spawn_connection(fcgi_app, fcgi_app_argv, addr, port, unixsocket, fork_count, child_count, pid_fd, nofork);
489 Index: src/configfile-glue.c
490 ===================================================================
491 --- src/configfile-glue.c (.../tags/lighttpd-1.4.22) (revision 2475)
492 +++ src/configfile-glue.c (.../branches/lighttpd-1.4.x) (revision 2475)
494 buffer_copy_string_buffer(ds->value, ((data_string *)(da->value->data[j]))->value);
495 if (!da->is_index_key) {
496 /* the id's were generated automaticly, as we copy now we might have to renumber them
497 - * this is used to prepend server.modules by mod_indexfiles as it has to be loaded
498 + * this is used to prepend server.modules by mod_indexfile as it has to be loaded
499 * before mod_fastcgi and friends */
500 buffer_copy_string_buffer(ds->key, ((data_string *)(da->value->data[j]))->key);
503 return config_insert_values_internal(srv, ca, cv);
506 -unsigned short sock_addr_get_port(sock_addr *addr) {
507 +static unsigned short sock_addr_get_port(sock_addr *addr) {
509 return ntohs(addr->plain.sa_family ? addr->ipv6.sin6_port : addr->ipv4.sin_port);
512 ===================================================================
513 --- src/mod_cgi.c (.../tags/lighttpd-1.4.22) (revision 2475)
514 +++ src/mod_cgi.c (.../branches/lighttpd-1.4.x) (revision 2475)
519 +#include "stat_cache.h"
520 #include "keyvalue.h"
522 #include "connections.h"
524 # include <sys/filio.h>
527 +#include "version.h"
529 enum {EOL_UNSET, EOL_N, EOL_RN};
532 @@ -776,25 +779,23 @@
534 close(to_cgi_fds[1]);
537 - * this is not nice, but it works
539 - * we feed the stderr of the CGI to our errorlog, if possible
541 - if (srv->errorlog_mode == ERRORLOG_FILE) {
542 - close(STDERR_FILENO);
543 - dup2(srv->errorlog_fd, STDERR_FILENO);
546 /* create environment */
551 - cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
552 + if (buffer_is_empty(con->conf.server_tag)) {
553 + cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
555 + cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
558 if (!buffer_is_empty(con->server_name)) {
559 - cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
560 + size_t len = con->server_name->used - 1;
561 + char *colon = strchr(con->server_name->ptr, ':');
562 + if (colon) len = colon - con->server_name->ptr;
564 + cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
567 s = inet_ntop(srv_sock->addr.plain.sa_family,
568 @@ -1203,6 +1204,7 @@
570 plugin_data *p = p_d;
571 buffer *fn = con->physical.path;
572 + stat_cache_entry *sce = NULL;
574 if (con->mode != DIRECT) return HANDLER_GO_ON;
576 @@ -1210,6 +1212,9 @@
578 mod_cgi_patch_connection(srv, con, p);
580 + if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) return HANDLER_GO_ON;
581 + if (!S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
583 s_len = fn->used - 1;
585 for (k = 0; k < p->conf.cgi->used; k++) {
586 @@ -1369,6 +1374,7 @@
590 +int mod_cgi_plugin_init(plugin *p);
591 int mod_cgi_plugin_init(plugin *p) {
592 p->version = LIGHTTPD_VERSION_ID;
593 p->name = buffer_init_string("cgi");
595 ===================================================================
596 --- src/mod_cml.c (.../tags/lighttpd-1.4.22) (revision 2475)
597 +++ src/mod_cml.c (.../branches/lighttpd-1.4.x) (revision 2475)
602 -int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
603 +static int cache_call_lua(server *srv, connection *con, plugin_data *p, buffer *cml_file) {
611 +int mod_cml_plugin_init(plugin *p);
612 int mod_cml_plugin_init(plugin *p) {
613 p->version = LIGHTTPD_VERSION_ID;
614 p->name = buffer_init_string("cache");
615 Index: src/mod_secure_download.c
616 ===================================================================
617 --- src/mod_secure_download.c (.../tags/lighttpd-1.4.22) (revision 2475)
618 +++ src/mod_secure_download.c (.../branches/lighttpd-1.4.x) (revision 2475)
620 * @return if the supplied string is a valid MD5 string 1 is returned otherwise 0
623 -int is_hex_len(const char *str, size_t len) {
624 +static int is_hex_len(const char *str, size_t len) {
627 if (NULL == str) return 0;
630 /* this function is called at dlopen() time and inits the callbacks */
632 +int mod_secdownload_plugin_init(plugin *p);
633 int mod_secdownload_plugin_init(plugin *p) {
634 p->version = LIGHTTPD_VERSION_ID;
635 p->name = buffer_init_string("secdownload");
637 ===================================================================
638 --- src/base.h (.../tags/lighttpd-1.4.22) (revision 2475)
639 +++ src/base.h (.../branches/lighttpd-1.4.x) (revision 2475)
640 @@ -183,11 +183,15 @@
645 + buffer *scheme; /* scheme without colon or slashes ( "http" or "https" ) */
647 + /* authority with optional portnumber ("site.name" or "site.name:8080" ) NOTE: without "username:password@" */
650 + /* path including leading slash ("/" or "/index.html") - urldecoded, and sanitized ( buffer_path_simplify() && buffer_urldecode_path() ) */
654 + buffer *path_raw; /* raw path, as sent from client. no urldecoding or path simplifying */
655 + buffer *query; /* querystring ( everything after "?", ie: in "/index.php?foo=1", query is "foo=1" ) */
663 - enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG } errorlog_mode;
664 + enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
665 buffer *errorlog_buf;
667 fdevents *ev, *ev_ins;
668 Index: src/mod_rewrite.c
669 ===================================================================
670 --- src/mod_rewrite.c (.../tags/lighttpd-1.4.22) (revision 2475)
671 +++ src/mod_rewrite.c (.../branches/lighttpd-1.4.x) (revision 2475)
676 -rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
677 +static rewrite_rule_buffer *rewrite_rule_buffer_init(void) {
678 rewrite_rule_buffer *kvb;
680 kvb = calloc(1, sizeof(*kvb));
685 -int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
686 +static int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) {
694 -void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
695 +static void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) {
700 return HANDLER_GO_ON;
703 +int mod_rewrite_plugin_init(plugin *p);
704 int mod_rewrite_plugin_init(plugin *p) {
705 p->version = LIGHTTPD_VERSION_ID;
706 p->name = buffer_init_string("rewrite");
707 Index: src/connections.c
708 ===================================================================
709 --- src/connections.c (.../tags/lighttpd-1.4.22) (revision 2475)
710 +++ src/connections.c (.../branches/lighttpd-1.4.x) (revision 2475)
713 * we get called by the state-engine and by the fdevent-handler
715 -int connection_handle_read_state(server *srv, connection *con) {
716 +static int connection_handle_read_state(server *srv, connection *con) {
717 connection_state_t ostate = con->state;
718 chunk *c, *last_chunk;
720 @@ -1156,7 +1156,7 @@
724 -handler_t connection_handle_fdevent(void *s, void *context, int revents) {
725 +static handler_t connection_handle_fdevent(void *s, void *context, int revents) {
726 server *srv = (server *)s;
727 connection *con = context;
729 Index: src/mod_staticfile.c
730 ===================================================================
731 --- src/mod_staticfile.c (.../tags/lighttpd-1.4.22) (revision 2475)
732 +++ src/mod_staticfile.c (.../branches/lighttpd-1.4.x) (revision 2475)
735 /* this function is called at dlopen() time and inits the callbacks */
737 +int mod_staticfile_plugin_init(plugin *p);
738 int mod_staticfile_plugin_init(plugin *p) {
739 p->version = LIGHTTPD_VERSION_ID;
740 p->name = buffer_init_string("staticfile");
741 Index: src/mod_alias.c
742 ===================================================================
743 --- src/mod_alias.c (.../tags/lighttpd-1.4.22) (revision 2475)
744 +++ src/mod_alias.c (.../branches/lighttpd-1.4.x) (revision 2475)
747 /* this function is called at dlopen() time and inits the callbacks */
749 +int mod_alias_plugin_init(plugin *p);
750 int mod_alias_plugin_init(plugin *p) {
751 p->version = LIGHTTPD_VERSION_ID;
752 p->name = buffer_init_string("alias");
754 ===================================================================
755 --- src/network.c (.../tags/lighttpd-1.4.22) (revision 2475)
756 +++ src/network.c (.../branches/lighttpd-1.4.x) (revision 2475)
758 # include <openssl/rand.h>
761 -handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
762 +static handler_t network_server_handle_fdevent(void *s, void *context, int revents) {
763 server *srv = (server *)s;
764 server_socket *srv_socket = (server_socket *)context;
767 return HANDLER_GO_ON;
770 -int network_server_init(server *srv, buffer *host_token, specific_config *s) {
771 +static int network_server_init(server *srv, buffer *host_token, specific_config *s) {
774 server_socket *srv_socket;
775 Index: src/mod_trigger_b4_dl.c
776 ===================================================================
777 --- src/mod_trigger_b4_dl.c (.../tags/lighttpd-1.4.22) (revision 2475)
778 +++ src/mod_trigger_b4_dl.c (.../branches/lighttpd-1.4.x) (revision 2475)
781 /* this function is called at dlopen() time and inits the callbacks */
783 +int mod_trigger_b4_dl_plugin_init(plugin *p);
784 int mod_trigger_b4_dl_plugin_init(plugin *p) {
785 p->version = LIGHTTPD_VERSION_ID;
786 p->name = buffer_init_string("trigger_b4_dl");
787 Index: src/mod_evhost.c
788 ===================================================================
789 --- src/mod_evhost.c (.../tags/lighttpd-1.4.22) (revision 2475)
790 +++ src/mod_evhost.c (.../branches/lighttpd-1.4.x) (revision 2475)
792 return HANDLER_GO_ON;
795 +int mod_evhost_plugin_init(plugin *p);
796 int mod_evhost_plugin_init(plugin *p) {
797 p->version = LIGHTTPD_VERSION_ID;
798 p->name = buffer_init_string("evhost");
799 Index: src/splaytree.c
800 ===================================================================
801 --- src/splaytree.c (.../tags/lighttpd-1.4.22) (revision 2475)
802 +++ src/splaytree.c (.../branches/lighttpd-1.4.x) (revision 2475)
807 -splay_tree *find_rank(int r, splay_tree *t) {
809 +static splay_tree *find_rank(int r, splay_tree *t) {
810 /* Returns a pointer to the node in the tree with the given rank. */
811 /* Returns NULL if there is no such node. */
812 /* Does not change the tree. To guarantee logarithmic behavior, */
821 ===================================================================
822 --- src/chunk.h (.../tags/lighttpd-1.4.22) (revision 2475)
823 +++ src/chunk.h (.../branches/lighttpd-1.4.x) (revision 2475)
828 +#include "sys-mmap.h"
830 typedef struct chunk {
831 enum { UNUSED_CHUNK, MEM_CHUNK, FILE_CHUNK } type;
833 ===================================================================
834 --- src/etag.c (.../tags/lighttpd-1.4.22) (revision 2475)
835 +++ src/etag.c (.../branches/lighttpd-1.4.x) (revision 2475)
840 - for (h=0, i=0; i < etag->used; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
841 + for (h=0, i=0; i < etag->used-1; ++i) h = (h<<5)^(h>>27)^(etag->ptr[i]);
844 buffer_copy_string_len(mut, CONST_STR_LEN("\""));
845 Index: src/mod_scgi.c
846 ===================================================================
847 --- src/mod_scgi.c (.../tags/lighttpd-1.4.22) (revision 2475)
848 +++ src/mod_scgi.c (.../branches/lighttpd-1.4.x) (revision 2475)
850 #include <sys/wait.h>
853 +#include "version.h"
855 enum {EOL_UNSET, EOL_N, EOL_RN};
862 -scgi_proc *scgi_process_init() {
863 +static scgi_proc *scgi_process_init() {
866 f = calloc(1, sizeof(*f));
871 -void scgi_process_free(scgi_proc *f) {
872 +static void scgi_process_free(scgi_proc *f) {
875 scgi_process_free(f->next);
880 -scgi_extension_host *scgi_host_init() {
881 +static scgi_extension_host *scgi_host_init() {
882 scgi_extension_host *f;
884 f = calloc(1, sizeof(*f));
889 -void scgi_host_free(scgi_extension_host *h) {
890 +static void scgi_host_free(scgi_extension_host *h) {
893 buffer_free(h->host);
898 -scgi_exts *scgi_extensions_init() {
899 +static scgi_exts *scgi_extensions_init() {
902 f = calloc(1, sizeof(*f));
907 -void scgi_extensions_free(scgi_exts *f) {
908 +static void scgi_extensions_free(scgi_exts *f) {
916 -int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
917 +static int scgi_extension_insert(scgi_exts *ext, buffer *key, scgi_extension_host *fh) {
921 @@ -1178,7 +1180,7 @@
925 -void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
926 +static void scgi_connection_cleanup(server *srv, handler_ctx *hctx) {
930 @@ -1461,10 +1463,18 @@
931 scgi_env_add(p->scgi_env, CONST_STR_LEN("SCGI"), CONST_STR_LEN("1"));
934 - scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
935 + if (buffer_is_empty(con->conf.server_tag)) {
936 + scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
938 + scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
941 if (con->server_name->used) {
942 - scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
943 + size_t len = con->server_name->used - 1;
944 + char *colon = strchr(con->server_name->ptr, ':');
945 + if (colon) len = colon - con->server_name->ptr;
947 + scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
950 s = inet_ntop(srv_sock->addr.plain.sa_family,
951 @@ -1915,7 +1925,7 @@
955 -int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
956 +static int scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
960 @@ -3105,6 +3115,7 @@
964 +int mod_scgi_plugin_init(plugin *p);
965 int mod_scgi_plugin_init(plugin *p) {
966 p->version = LIGHTTPD_VERSION_ID;
967 p->name = buffer_init_string("scgi");
968 Index: src/mod_mysql_vhost.c
969 ===================================================================
970 --- src/mod_mysql_vhost.c (.../tags/lighttpd-1.4.22) (revision 2475)
971 +++ src/mod_mysql_vhost.c (.../branches/lighttpd-1.4.x) (revision 2475)
975 /* this function is called at dlopen() time and inits the callbacks */
976 +int mod_mysql_vhost_plugin_init(plugin *p);
977 int mod_mysql_vhost_plugin_init(plugin *p) {
978 p->version = LIGHTTPD_VERSION_ID;
979 p->name = buffer_init_string("mysql_vhost");
983 /* we don't have mysql support, this plugin does nothing */
984 +int mod_mysql_vhost_plugin_init(plugin *p);
985 int mod_mysql_vhost_plugin_init(plugin *p) {
986 p->version = LIGHTTPD_VERSION_ID;
987 p->name = buffer_init_string("mysql_vhost");
989 ===================================================================
990 --- src/request.c (.../tags/lighttpd-1.4.22) (revision 2475)
991 +++ src/request.c (.../branches/lighttpd-1.4.x) (revision 2475)
993 if (host_len == 0) return -1;
995 /* if the hostname ends in a "." strip it */
996 - if (host->ptr[host_len-1] == '.') host_len -= 1;
997 + if (host->ptr[host_len-1] == '.') {
998 + /* shift port info one left */
999 + if (NULL != colon) memmove(colon-1, colon, host->used - host_len);
1000 + else host->ptr[host_len-1] = '\0';
1005 + if (host_len == 0) return -1;
1007 /* scan from the right and skip the \0 */
1008 - for (i = host_len - 1; i + 1 > 0; i--) {
1009 + for (i = host_len; i-- > 0; ) {
1010 const char c = host->ptr[i];
1017 -int http_request_split_value(array *vals, buffer *b) {
1018 +static int http_request_split_value(array *vals, buffer *b) {
1026 -int request_uri_is_valid_char(unsigned char c) {
1027 +static int request_uri_is_valid_char(unsigned char c) {
1028 if (c <= 32) return 0;
1029 if (c == 127) return 0;
1030 if (c == 255) return 0;
1031 Index: src/mod_magnet_cache.c
1032 ===================================================================
1033 --- src/mod_magnet_cache.c (.../tags/lighttpd-1.4.22) (revision 2475)
1034 +++ src/mod_magnet_cache.c (.../branches/lighttpd-1.4.x) (revision 2475)
1037 #include <lauxlib.h>
1039 -script *script_init() {
1040 +static script *script_init() {
1043 sc = calloc(1, sizeof(*sc));
1048 -void script_free(script *sc) {
1049 +static void script_free(script *sc) {
1052 lua_pop(sc->L, 1); /* the function copy */
1053 Index: src/mod_flv_streaming.c
1054 ===================================================================
1055 --- src/mod_flv_streaming.c (.../tags/lighttpd-1.4.22) (revision 2475)
1056 +++ src/mod_flv_streaming.c (.../branches/lighttpd-1.4.x) (revision 2475)
1059 /* this function is called at dlopen() time and inits the callbacks */
1061 +int mod_flv_streaming_plugin_init(plugin *p);
1062 int mod_flv_streaming_plugin_init(plugin *p) {
1063 p->version = LIGHTTPD_VERSION_ID;
1064 p->name = buffer_init_string("flv_streaming");
1065 Index: src/mod_rrdtool.c
1066 ===================================================================
1067 --- src/mod_rrdtool.c (.../tags/lighttpd-1.4.22) (revision 2475)
1068 +++ src/mod_rrdtool.c (.../branches/lighttpd-1.4.x) (revision 2475)
1070 return HANDLER_GO_ON;
1073 -int mod_rrd_create_pipe(server *srv, plugin_data *p) {
1074 +static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
1080 static int mod_rrdtool_create_rrd(server *srv, plugin_data *p, plugin_config *s) {
1084 /* check if DB already exists */
1085 if (0 == stat(s->path_rrd->ptr, &st)) {
1086 @@ -239,54 +240,57 @@
1087 "not a regular file:", s->path_rrd);
1088 return HANDLER_ERROR;
1092 - /* create a new one */
1095 - buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
1096 - buffer_append_string_buffer(p->cmd, s->path_rrd);
1097 - buffer_append_string_len(p->cmd, CONST_STR_LEN(
1099 - "DS:InOctets:ABSOLUTE:600:U:U "
1100 - "DS:OutOctets:ABSOLUTE:600:U:U "
1101 - "DS:Requests:ABSOLUTE:600:U:U "
1102 - "RRA:AVERAGE:0.5:1:600 "
1103 - "RRA:AVERAGE:0.5:6:700 "
1104 - "RRA:AVERAGE:0.5:24:775 "
1105 - "RRA:AVERAGE:0.5:288:797 "
1106 - "RRA:MAX:0.5:1:600 "
1107 - "RRA:MAX:0.5:6:700 "
1108 - "RRA:MAX:0.5:24:775 "
1109 - "RRA:MAX:0.5:288:797 "
1110 - "RRA:MIN:0.5:1:600 "
1111 - "RRA:MIN:0.5:6:700 "
1112 - "RRA:MIN:0.5:24:775 "
1113 - "RRA:MIN:0.5:288:797\n"));
1114 + /* still create DB if it's empty file */
1115 + if (st.st_size > 0) {
1116 + return HANDLER_GO_ON;
1119 - if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
1120 - log_error_write(srv, __FILE__, __LINE__, "ss",
1121 - "rrdtool-write: failed", strerror(errno));
1122 + /* create a new one */
1123 + buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
1124 + buffer_append_string_buffer(p->cmd, s->path_rrd);
1125 + buffer_append_string_len(p->cmd, CONST_STR_LEN(
1127 + "DS:InOctets:ABSOLUTE:600:U:U "
1128 + "DS:OutOctets:ABSOLUTE:600:U:U "
1129 + "DS:Requests:ABSOLUTE:600:U:U "
1130 + "RRA:AVERAGE:0.5:1:600 "
1131 + "RRA:AVERAGE:0.5:6:700 "
1132 + "RRA:AVERAGE:0.5:24:775 "
1133 + "RRA:AVERAGE:0.5:288:797 "
1134 + "RRA:MAX:0.5:1:600 "
1135 + "RRA:MAX:0.5:6:700 "
1136 + "RRA:MAX:0.5:24:775 "
1137 + "RRA:MAX:0.5:288:797 "
1138 + "RRA:MIN:0.5:1:600 "
1139 + "RRA:MIN:0.5:6:700 "
1140 + "RRA:MIN:0.5:24:775 "
1141 + "RRA:MIN:0.5:288:797\n"));
1143 - return HANDLER_ERROR;
1145 + if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
1146 + log_error_write(srv, __FILE__, __LINE__, "ss",
1147 + "rrdtool-write: failed", strerror(errno));
1149 - buffer_prepare_copy(p->resp, 4096);
1150 - if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
1151 - log_error_write(srv, __FILE__, __LINE__, "ss",
1152 - "rrdtool-read: failed", strerror(errno));
1153 + return HANDLER_ERROR;
1156 - return HANDLER_ERROR;
1158 + buffer_prepare_copy(p->resp, 4096);
1159 + if (-1 == (r = safe_read(p->read_fd, p->resp->ptr, p->resp->size))) {
1160 + log_error_write(srv, __FILE__, __LINE__, "ss",
1161 + "rrdtool-read: failed", strerror(errno));
1163 - p->resp->used = r;
1164 + return HANDLER_ERROR;
1167 - if (p->resp->ptr[0] != 'O' ||
1168 - p->resp->ptr[1] != 'K') {
1169 - log_error_write(srv, __FILE__, __LINE__, "sbb",
1170 - "rrdtool-response:", p->cmd, p->resp);
1171 + p->resp->used = r;
1173 - return HANDLER_ERROR;
1175 + if (p->resp->ptr[0] != 'O' ||
1176 + p->resp->ptr[1] != 'K') {
1177 + log_error_write(srv, __FILE__, __LINE__, "sbb",
1178 + "rrdtool-response:", p->cmd, p->resp);
1180 + return HANDLER_ERROR;
1183 return HANDLER_GO_ON;
1185 return HANDLER_GO_ON;
1188 +int mod_rrdtool_plugin_init(plugin *p);
1189 int mod_rrdtool_plugin_init(plugin *p) {
1190 p->version = LIGHTTPD_VERSION_ID;
1191 p->name = buffer_init_string("rrd");
1192 Index: src/stat_cache.c
1193 ===================================================================
1194 --- src/stat_cache.c (.../tags/lighttpd-1.4.22) (revision 2475)
1195 +++ src/stat_cache.c (.../branches/lighttpd-1.4.x) (revision 2475)
1196 @@ -595,29 +595,31 @@
1197 if (S_ISREG(st.st_mode)) {
1198 /* determine mimetype */
1199 buffer_reset(sce->content_type);
1201 + if (con->conf.use_xattr) {
1202 + stat_cache_attr_get(sce->content_type, name->ptr);
1205 + /* xattr did not set a content-type. ask the config */
1206 + if (buffer_is_empty(sce->content_type)) {
1207 + for (k = 0; k < con->conf.mimetypes->used; k++) {
1208 + data_string *ds = (data_string *)con->conf.mimetypes->data[k];
1209 + buffer *type = ds->key;
1211 - for (k = 0; k < con->conf.mimetypes->used; k++) {
1212 - data_string *ds = (data_string *)con->conf.mimetypes->data[k];
1213 - buffer *type = ds->key;
1214 + if (type->used == 0) continue;
1216 - if (type->used == 0) continue;
1217 + /* check if the right side is the same */
1218 + if (type->used > name->used) continue;
1220 - /* check if the right side is the same */
1221 - if (type->used > name->used) continue;
1223 - if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
1224 - buffer_copy_string_buffer(sce->content_type, ds->value);
1226 + if (0 == strncasecmp(name->ptr + name->used - type->used, type->ptr, type->used - 1)) {
1227 + buffer_copy_string_buffer(sce->content_type, ds->value);
1232 - etag_create(sce->etag, &(sce->st), con->etag_flags);
1234 - if (con->conf.use_xattr && buffer_is_empty(sce->content_type)) {
1235 - stat_cache_attr_get(sce->content_type, name->ptr);
1238 + etag_create(sce->etag, &(sce->st), con->etag_flags);
1239 } else if (S_ISDIR(st.st_mode)) {
1240 - etag_create(sce->etag, &(sce->st), con->etag_flags);
1241 + etag_create(sce->etag, &(sce->st), con->etag_flags);
1245 Index: src/response.c
1246 ===================================================================
1247 --- src/response.c (.../tags/lighttpd-1.4.22) (revision 2475)
1248 +++ src/response.c (.../branches/lighttpd-1.4.x) (revision 2475)
1252 #include "sys-socket.h"
1253 +#include "version.h"
1255 int http_response_write_header(server *srv, connection *con) {
1260 if (buffer_is_empty(con->conf.server_tag)) {
1261 - buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_NAME "/" PACKAGE_VERSION));
1262 + buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_DESC));
1263 } else if (con->conf.server_tag->used > 1) {
1264 buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: "));
1265 buffer_append_string_encoded(b, CONST_BUF_LEN(con->conf.server_tag), ENCODING_HTTP_HEADER);
1266 Index: src/SConscript
1267 ===================================================================
1268 --- src/SConscript (.../tags/lighttpd-1.4.22) (revision 2475)
1269 +++ src/SConscript (.../branches/lighttpd-1.4.x) (revision 2475)
1272 'src' : [ 'mod_cml_lua.c', 'mod_cml.c', 'mod_cml_funcs.c' ],
1273 'lib' : [ env['LIBPCRE'], env['LIBMEMCACHE'], env['LIBLUA'], env['LIBLUALIB'] ] },
1274 - 'mod_uploadprogress' : { 'src' : [ 'mod_uploadprogress.c' ] },
1275 +# 'mod_uploadprogress' : { 'src' : [ 'mod_uploadprogress.c' ] },
1276 'mod_evasive' : { 'src' : [ 'mod_evasive.c' ] },
1277 'mod_ssi' : { 'src' : [ 'mod_ssi_exprparser.c', 'mod_ssi_expr.c', 'mod_ssi.c' ], 'lib' : [ env['LIBPCRE'] ] },
1278 'mod_flv_streaming' : { 'src' : [ 'mod_flv_streaming.c' ] },
1280 instbin = env.Program(bin_targets, src, LINKFLAGS = bin_linkflags, LIBS= [ env['LIBS'], common_lib, env['LIBDL'] ])
1281 env.Depends(instbin, configparser)
1283 -spawn_fcgi = env.Program("spawn-fcgi", "spawn-fcgi.c")
1285 if env['COMMON_LIB'] == 'bin':
1286 common_lib = instbin[1]
1292 -Default(spawn_fcgi)
1293 -inst += env.Install('${bindir}', spawn_fcgi)
1295 if env['build_dynamic']:
1296 Default(instbin[0], instlib)
1297 inst += env.Install('${sbindir}', instbin[0])
1298 Index: src/mod_cml_funcs.c
1299 ===================================================================
1300 --- src/mod_cml_funcs.c (.../tags/lighttpd-1.4.22) (revision 2475)
1301 +++ src/mod_cml_funcs.c (.../branches/lighttpd-1.4.x) (revision 2475)
1306 -int f_dir_files_iter(lua_State *L) {
1307 +static int f_dir_files_iter(lua_State *L) {
1314 if (NULL == (r = mc_aget(mc,
1315 - lua_tostring(L, 1), lua_strlen(L, 1)))) {
1316 + (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
1318 lua_pushboolean(L, 0);
1323 if (NULL == (r = mc_aget(mc,
1324 - lua_tostring(L, 1), lua_strlen(L, 1)))) {
1325 + (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
1332 if (NULL == (r = mc_aget(mc,
1333 - lua_tostring(L, 1), lua_strlen(L, 1)))) {
1334 + (char*) lua_tostring(L, 1), lua_strlen(L, 1)))) {
1338 Index: src/mod_simple_vhost.c
1339 ===================================================================
1340 --- src/mod_simple_vhost.c (.../tags/lighttpd-1.4.22) (revision 2475)
1341 +++ src/mod_simple_vhost.c (.../branches/lighttpd-1.4.x) (revision 2475)
1346 +int mod_simple_vhost_plugin_init(plugin *p);
1347 int mod_simple_vhost_plugin_init(plugin *p) {
1348 p->version = LIGHTTPD_VERSION_ID;
1349 p->name = buffer_init_string("simple_vhost");
1350 Index: src/mod_userdir.c
1351 ===================================================================
1352 --- src/mod_userdir.c (.../tags/lighttpd-1.4.22) (revision 2475)
1353 +++ src/mod_userdir.c (.../branches/lighttpd-1.4.x) (revision 2475)
1356 /* this function is called at dlopen() time and inits the callbacks */
1358 +int mod_userdir_plugin_init(plugin *p);
1359 int mod_userdir_plugin_init(plugin *p) {
1360 p->version = LIGHTTPD_VERSION_ID;
1361 p->name = buffer_init_string("userdir");
1362 Index: src/mod_proxy.c
1363 ===================================================================
1364 --- src/mod_proxy.c (.../tags/lighttpd-1.4.22) (revision 2475)
1365 +++ src/mod_proxy.c (.../branches/lighttpd-1.4.x) (revision 2475)
1367 return HANDLER_GO_ON;
1370 -void proxy_connection_close(server *srv, handler_ctx *hctx) {
1371 +static void proxy_connection_close(server *srv, handler_ctx *hctx) {
1379 -void proxy_set_header(connection *con, const char *key, const char *value) {
1380 +static void proxy_set_header(connection *con, const char *key, const char *value) {
1381 data_string *ds_dst;
1383 if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
1385 array_insert_unique(con->request.headers, (data_unset *)ds_dst);
1388 -void proxy_append_header(connection *con, const char *key, const char *value) {
1389 +static void proxy_append_header(connection *con, const char *key, const char *value) {
1390 data_string *ds_dst;
1392 if (NULL == (ds_dst = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
1393 @@ -1209,7 +1209,7 @@
1395 if (ndx >= (int) extension->value->used) {
1396 /* didn't found a higher id, wrap to the start */
1397 - for (ndx = 0; ndx < (int) k; ndx++) {
1398 + for (ndx = 0; ndx <= (int) k; ndx++) {
1399 host = (data_proxy *)extension->value->data[ndx];
1400 if (!host->is_disabled) break;
1402 @@ -1321,6 +1321,7 @@
1406 +int mod_proxy_plugin_init(plugin *p);
1407 int mod_proxy_plugin_init(plugin *p) {
1408 p->version = LIGHTTPD_VERSION_ID;
1409 p->name = buffer_init_string("proxy");
1410 Index: src/mod_extforward.c
1411 ===================================================================
1412 --- src/mod_extforward.c (.../tags/lighttpd-1.4.22) (revision 2475)
1413 +++ src/mod_extforward.c (.../branches/lighttpd-1.4.x) (revision 2475)
1418 -struct addrinfo *ipstr_to_sockaddr(const char *host)
1419 +static struct addrinfo *ipstr_to_sockaddr(const char *host)
1421 struct addrinfo hints, *res0;
1425 /* this function is called at dlopen() time and inits the callbacks */
1427 +int mod_extforward_plugin_init(plugin *p);
1428 int mod_extforward_plugin_init(plugin *p) {
1429 p->version = LIGHTTPD_VERSION_ID;
1430 p->name = buffer_init_string("extforward");
1431 Index: src/Makefile.am
1432 ===================================================================
1433 --- src/Makefile.am (.../tags/lighttpd-1.4.22) (revision 2475)
1434 +++ src/Makefile.am (.../branches/lighttpd-1.4.x) (revision 2475)
1437 noinst_PROGRAMS=proc_open lemon # simple-fcgi #graphic evalo bench ajp ssl error_test adserver gen-license
1438 sbin_PROGRAMS=lighttpd lighttpd-angel
1439 -bin_PROGRAMS=spawn-fcgi
1440 LEMON=$(top_builddir)/src/lemon$(EXEEXT)
1442 lemon_SOURCES=lemon.c
1444 lighttpd_angel_SOURCES=lighttpd-angel.c
1446 -#simple_fcgi_SOURCES=simple-fcgi.c
1447 -#simple_fcgi_LDADD=-lfcgi
1448 +.PHONY: versionstamp parsers
1453 + @test -f versionstamp.h || touch versionstamp.h; \
1454 + REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
1455 + if test $$REVISION = "exported"; then \
1456 + REVISION="$$(LANG=C cd "$(top_srcdir)"; git describe --always 2>/dev/null)"; \
1458 + if test -n "$$REVISION"; then \
1459 + echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
1461 + echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
1463 + if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
1464 + mv versionstamp.h.tmp versionstamp.h; \
1466 + rm versionstamp.h.tmp; \
1470 configparser.c configparser.h:
1471 mod_ssi_exprparser.c mod_ssi_exprparser.h:
1476 configparser.h: configparser.c
1478 rm -f mod_ssi_exprparser.h
1479 $(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
1482 parsers: configparser.c mod_ssi_exprparser.c
1485 BUILT_SOURCES = parsers
1486 MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
1487 +CLEANFILES = versionstamp.h versionstamp.h.tmp
1489 common_src=buffer.c log.c \
1490 keyvalue.c chunk.c \
1492 src = server.c response.c connections.c network.c \
1493 configfile.c configparser.c request.c proc_open.c
1495 -spawn_fcgi_SOURCES=spawn-fcgi.c
1500 @@ -259,9 +273,10 @@
1501 configparser.h mod_ssi_exprparser.h \
1502 sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
1503 splaytree.h proc_open.h status_counter.h \
1504 - mod_magnet_cache.h
1505 + mod_magnet_cache.h \
1508 -DEFS= @DEFS@ -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
1509 +DEFS= @DEFS@ -DHAVE_VERSION_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
1511 lighttpd_SOURCES = $(src)
1512 lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS)
1515 noinst_HEADERS = $(hdr)
1516 EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c SConscript
1518 Index: src/config.h.cmake
1519 ===================================================================
1520 Index: src/mod_expire.c
1521 ===================================================================
1522 --- src/mod_expire.c (.../tags/lighttpd-1.4.22) (revision 2475)
1523 +++ src/mod_expire.c (.../branches/lighttpd-1.4.x) (revision 2475)
1526 /* this function is called at dlopen() time and inits the callbacks */
1528 +int mod_expire_plugin_init(plugin *p);
1529 int mod_expire_plugin_init(plugin *p) {
1530 p->version = LIGHTTPD_VERSION_ID;
1531 p->name = buffer_init_string("expire");
1532 Index: src/mod_redirect.c
1533 ===================================================================
1534 --- src/mod_redirect.c (.../tags/lighttpd-1.4.22) (revision 2475)
1535 +++ src/mod_redirect.c (.../branches/lighttpd-1.4.x) (revision 2475)
1540 +int mod_redirect_plugin_init(plugin *p);
1541 int mod_redirect_plugin_init(plugin *p) {
1542 p->version = LIGHTTPD_VERSION_ID;
1543 p->name = buffer_init_string("redirect");
1544 Index: src/mod_usertrack.c
1545 ===================================================================
1546 --- src/mod_usertrack.c (.../tags/lighttpd-1.4.22) (revision 2475)
1547 +++ src/mod_usertrack.c (.../branches/lighttpd-1.4.x) (revision 2475)
1550 /* this function is called at dlopen() time and inits the callbacks */
1552 +int mod_usertrack_plugin_init(plugin *p);
1553 int mod_usertrack_plugin_init(plugin *p) {
1554 p->version = LIGHTTPD_VERSION_ID;
1555 p->name = buffer_init_string("usertrack");
1556 Index: src/mod_webdav.c
1557 ===================================================================
1558 --- src/mod_webdav.c (.../tags/lighttpd-1.4.22) (revision 2475)
1559 +++ src/mod_webdav.c (.../branches/lighttpd-1.4.x) (revision 2475)
1560 @@ -1096,7 +1096,7 @@
1564 -int webdav_lockdiscovery(server *srv, connection *con,
1565 +static int webdav_lockdiscovery(server *srv, connection *con,
1566 buffer *locktoken, const char *lockscope, const char *locktype, int depth) {
1569 @@ -1156,7 +1156,7 @@
1573 -int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
1574 +static int webdav_has_lock(server *srv, connection *con, plugin_data *p, buffer *uri) {
1578 @@ -2474,6 +2474,7 @@
1580 /* this function is called at dlopen() time and inits the callbacks */
1582 +int mod_webdav_plugin_init(plugin *p);
1583 int mod_webdav_plugin_init(plugin *p) {
1584 p->version = LIGHTTPD_VERSION_ID;
1585 p->name = buffer_init_string("webdav");
1586 Index: src/mod_status.c
1587 ===================================================================
1588 --- src/mod_status.c (.../tags/lighttpd-1.4.22) (revision 2475)
1589 +++ src/mod_status.c (.../branches/lighttpd-1.4.x) (revision 2475)
1593 #include "inet_ntop_cache.h"
1594 +#include "version.h"
1599 " <title>Status</title>\n"
1602 - " <h1>" PACKAGE_NAME " " PACKAGE_VERSION "</h1>\n"
1603 + " <h1>" PACKAGE_DESC "</h1>\n"
1604 " <table summary=\"status\" border=\"1\">\n"));
1606 mod_status_header_append(b, "Server-Features");
1608 return HANDLER_GO_ON;
1611 +int mod_status_plugin_init(plugin *p);
1612 int mod_status_plugin_init(plugin *p) {
1613 p->version = LIGHTTPD_VERSION_ID;
1614 p->name = buffer_init_string("status");
1615 Index: src/mod_compress.c
1616 ===================================================================
1617 --- src/mod_compress.c (.../tags/lighttpd-1.4.22) (revision 2475)
1618 +++ src/mod_compress.c (.../branches/lighttpd-1.4.x) (revision 2475)
1622 /* 0 on success, -1 for error */
1623 -int mkdir_recursive(char *dir) {
1624 +static int mkdir_recursive(char *dir) {
1627 if (!dir || !dir[0])
1631 /* 0 on success, -1 for error */
1632 -int mkdir_for_file(char *filename) {
1633 +static int mkdir_for_file(char *filename) {
1636 if (!filename || !filename[0])
1638 return HANDLER_GO_ON;
1641 +int mod_compress_plugin_init(plugin *p);
1642 int mod_compress_plugin_init(plugin *p) {
1643 p->version = LIGHTTPD_VERSION_ID;
1644 p->name = buffer_init_string("compress");
1645 Index: src/mod_ssi.c
1646 ===================================================================
1647 --- src/mod_ssi.c (.../tags/lighttpd-1.4.22) (revision 2475)
1648 +++ src/mod_ssi.c (.../branches/lighttpd-1.4.x) (revision 2475)
1653 +#include "version.h"
1655 /* The newest modified time of included files for include statement */
1656 static volatile time_t include_file_last_mtime = 0;
1658 return HANDLER_GO_ON;
1661 -int ssi_env_add(array *env, const char *key, const char *val) {
1662 +static int ssi_env_add(array *env, const char *key, const char *val) {
1665 if (NULL == (ds = (data_string *)array_get_unused_element(env, TYPE_STRING))) {
1668 array_reset(p->ssi_cgi_env);
1670 - ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_NAME"/"PACKAGE_VERSION);
1671 + ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_DESC);
1672 ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_NAME"),
1674 inet_ntop(srv_sock->addr.plain.sa_family,
1675 @@ -1125,6 +1126,7 @@
1677 /* this function is called at dlopen() time and inits the callbacks */
1679 +int mod_ssi_plugin_init(plugin *p);
1680 int mod_ssi_plugin_init(plugin *p) {
1681 p->version = LIGHTTPD_VERSION_ID;
1682 p->name = buffer_init_string("ssi");
1683 Index: src/mod_auth.c
1684 ===================================================================
1685 --- src/mod_auth.c (.../tags/lighttpd-1.4.22) (revision 2475)
1686 +++ src/mod_auth.c (.../branches/lighttpd-1.4.x) (revision 2475)
1687 @@ -313,20 +313,20 @@
1689 config_values_t cv[] = {
1690 { "auth.backend", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
1691 - { "auth.backend.plain.groupfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1692 - { "auth.backend.plain.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1693 - { "auth.require", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION },
1694 - { "auth.backend.ldap.hostname", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1695 - { "auth.backend.ldap.base-dn", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1696 - { "auth.backend.ldap.filter", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1697 - { "auth.backend.ldap.ca-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1698 - { "auth.backend.ldap.starttls", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
1699 - { "auth.backend.ldap.bind-dn", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1700 + { "auth.backend.plain.groupfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
1701 + { "auth.backend.plain.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
1702 + { "auth.require", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
1703 + { "auth.backend.ldap.hostname", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
1704 + { "auth.backend.ldap.base-dn", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
1705 + { "auth.backend.ldap.filter", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
1706 + { "auth.backend.ldap.ca-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
1707 + { "auth.backend.ldap.starttls", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
1708 + { "auth.backend.ldap.bind-dn", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
1709 { "auth.backend.ldap.bind-pw", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
1710 - { "auth.backend.ldap.allow-empty-pw", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
1711 - { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1712 - { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
1713 - { "auth.debug", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
1714 + { "auth.backend.ldap.allow-empty-pw", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
1715 + { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
1716 + { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
1717 + { "auth.debug", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
1718 { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
1725 +int mod_auth_plugin_init(plugin *p);
1726 int mod_auth_plugin_init(plugin *p) {
1727 p->version = LIGHTTPD_VERSION_ID;
1728 p->name = buffer_init_string("auth");
1729 Index: src/mod_cml_lua.c
1730 ===================================================================
1731 --- src/mod_cml_lua.c (.../tags/lighttpd-1.4.22) (revision 2475)
1732 +++ src/mod_cml_lua.c (.../branches/lighttpd-1.4.x) (revision 2475)
1737 -int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
1738 +static int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) {
1741 char *key = NULL, *val = NULL;
1742 Index: src/version.h
1743 ===================================================================
1744 --- src/version.h (.../tags/lighttpd-1.4.22) (revision 0)
1745 +++ src/version.h (.../branches/lighttpd-1.4.x) (revision 2475)
1747 +#ifndef _VERSION_H_
1748 +#define _VERSION_H_
1750 +#ifdef HAVE_VERSION_H
1751 +#include "versionstamp.h"
1753 +#define REPO_VERSION ""
1756 +#define PACKAGE_DESC PACKAGE_NAME "/" PACKAGE_VERSION REPO_VERSION
1759 Index: src/mod_evasive.c
1760 ===================================================================
1761 --- src/mod_evasive.c (.../tags/lighttpd-1.4.22) (revision 2475)
1762 +++ src/mod_evasive.c (.../branches/lighttpd-1.4.x) (revision 2475)
1767 +int mod_evasive_plugin_init(plugin *p);
1768 int mod_evasive_plugin_init(plugin *p) {
1769 p->version = LIGHTTPD_VERSION_ID;
1770 p->name = buffer_init_string("evasive");
1771 Index: src/mod_setenv.c
1772 ===================================================================
1773 --- src/mod_setenv.c (.../tags/lighttpd-1.4.22) (revision 2475)
1774 +++ src/mod_setenv.c (.../branches/lighttpd-1.4.x) (revision 2475)
1777 /* this function is called at dlopen() time and inits the callbacks */
1779 +int mod_setenv_plugin_init(plugin *p);
1780 int mod_setenv_plugin_init(plugin *p) {
1781 p->version = LIGHTTPD_VERSION_ID;
1782 p->name = buffer_init_string("setenv");
1783 Index: src/mod_indexfile.c
1784 ===================================================================
1785 --- src/mod_indexfile.c (.../tags/lighttpd-1.4.22) (revision 2475)
1786 +++ src/mod_indexfile.c (.../branches/lighttpd-1.4.x) (revision 2475)
1789 /* this function is called at dlopen() time and inits the callbacks */
1791 +int mod_indexfile_plugin_init(plugin *p);
1792 int mod_indexfile_plugin_init(plugin *p) {
1793 p->version = LIGHTTPD_VERSION_ID;
1794 p->name = buffer_init_string("indexfile");
1795 Index: src/mod_uploadprogress.c
1796 ===================================================================
1797 Index: src/mod_fastcgi.c
1798 ===================================================================
1799 --- src/mod_fastcgi.c (.../tags/lighttpd-1.4.22) (revision 2475)
1800 +++ src/mod_fastcgi.c (.../branches/lighttpd-1.4.x) (revision 2475)
1802 #include <sys/wait.h>
1805 +#include "version.h"
1807 #define FCGI_ENV_ADD_CHECK(ret, con) \
1809 con->http_status = 400; \
1811 /* ok, we need a prototype */
1812 static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
1814 -int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
1815 +static int fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
1816 buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
1817 buffer_append_string_buffer(b, host->id);
1823 -int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
1824 +static int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
1826 fastcgi_status_copy_procname(b, host, proc); \
1827 buffer_append_string_len(b, CONST_STR_LEN(x)); \
1832 -fcgi_proc *fastcgi_process_init() {
1833 +static fcgi_proc *fastcgi_process_init() {
1836 f = calloc(1, sizeof(*f));
1841 -void fastcgi_process_free(fcgi_proc *f) {
1842 +static void fastcgi_process_free(fcgi_proc *f) {
1845 fastcgi_process_free(f->next);
1850 -fcgi_extension_host *fastcgi_host_init() {
1851 +static fcgi_extension_host *fastcgi_host_init() {
1852 fcgi_extension_host *f;
1854 f = calloc(1, sizeof(*f));
1859 -void fastcgi_host_free(fcgi_extension_host *h) {
1860 +static void fastcgi_host_free(fcgi_extension_host *h) {
1868 -fcgi_exts *fastcgi_extensions_init() {
1869 +static fcgi_exts *fastcgi_extensions_init() {
1872 f = calloc(1, sizeof(*f));
1877 -void fastcgi_extensions_free(fcgi_exts *f) {
1878 +static void fastcgi_extensions_free(fcgi_exts *f) {
1886 -int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
1887 +static int fastcgi_extension_insert(fcgi_exts *ext, buffer *key, fcgi_extension_host *fh) {
1891 @@ -1056,10 +1058,7 @@
1892 "child exited with status",
1893 WEXITSTATUS(status), host->bin_path);
1894 log_error_write(srv, __FILE__, __LINE__, "s",
1895 - "If you're trying to run PHP as a FastCGI backend, make sure you're using the FastCGI-enabled version.\n"
1896 - "You can find out if it is the right one by executing 'php -v' and it should display '(cgi-fcgi)' "
1897 - "in the output, NOT '(cgi)' NOR '(cli)'.\n"
1898 - "For more information, check http://trac.lighttpd.net/trac/wiki/Docs%3AModFastCGI#preparing-php-as-a-fastcgi-program"
1899 + "If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.\n"
1900 "If this is PHP on Gentoo, add 'fastcgi' to the USE flags.");
1901 } else if (WIFSIGNALED(status)) {
1902 log_error_write(srv, __FILE__, __LINE__, "sd",
1903 @@ -1479,7 +1478,7 @@
1907 -void fcgi_connection_close(server *srv, handler_ctx *hctx) {
1908 +static void fcgi_connection_close(server *srv, handler_ctx *hctx) {
1912 @@ -1885,10 +1884,18 @@
1913 buffer_prepare_copy(p->fcgi_env, 1024);
1916 - FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION)),con)
1917 + if (buffer_is_empty(con->conf.server_tag)) {
1918 + FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC)),con)
1920 + FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag)),con)
1923 if (con->server_name->used) {
1924 - FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name)),con)
1925 + size_t len = con->server_name->used - 1;
1926 + char *colon = strchr(con->server_name->ptr, ':');
1927 + if (colon) len = colon - con->server_name->ptr;
1929 + FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len),con)
1932 s = inet_ntop(srv_sock->addr.plain.sa_family,
1933 @@ -2060,7 +2067,7 @@
1935 fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"),
1936 con->request.orig_uri->ptr + (host->strip_request_uri->used - 2),
1937 - con->request.orig_uri->used - (host->strip_request_uri->used - 2));
1938 + con->request.orig_uri->used - (host->strip_request_uri->used - 2) - 1);
1940 FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri)),con)
1942 @@ -3639,7 +3646,11 @@
1945 /* the rewrite is only done for /prefix/? matches */
1946 - if (extension->key->ptr[0] == '/' &&
1947 + if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1948 + buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1949 + con->uri.path->used = 1;
1950 + con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1951 + } else if (extension->key->ptr[0] == '/' &&
1952 con->uri.path->used > extension->key->used &&
1953 NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
1954 /* rewrite uri.path and pathinfo */
1955 @@ -3648,10 +3659,6 @@
1957 con->uri.path->used -= con->request.pathinfo->used - 1;
1958 con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1959 - } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1960 - buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1961 - con->uri.path->used = 1;
1962 - con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1966 @@ -3916,6 +3923,7 @@
1970 +int mod_fastcgi_plugin_init(plugin *p);
1971 int mod_fastcgi_plugin_init(plugin *p) {
1972 p->version = LIGHTTPD_VERSION_ID;
1973 p->name = buffer_init_string("fastcgi");
1974 Index: src/CMakeLists.txt
1975 ===================================================================
1976 Index: src/mod_access.c
1977 ===================================================================
1978 --- src/mod_access.c (.../tags/lighttpd-1.4.22) (revision 2475)
1979 +++ src/mod_access.c (.../branches/lighttpd-1.4.x) (revision 2475)
1984 +int mod_access_plugin_init(plugin *p);
1985 int mod_access_plugin_init(plugin *p) {
1986 p->version = LIGHTTPD_VERSION_ID;
1987 p->name = buffer_init_string("access");
1988 Index: src/mod_accesslog.c
1989 ===================================================================
1990 --- src/mod_accesslog.c (.../tags/lighttpd-1.4.22) (revision 2475)
1991 +++ src/mod_accesslog.c (.../branches/lighttpd-1.4.x) (revision 2475)
1996 -int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
1997 +static int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
1998 size_t i, j, k = 0, start = 0;
2000 if (format->used == 0) return -1;
2001 @@ -475,74 +475,9 @@
2003 if (s->access_logfile->used < 2) continue;
2005 - if (s->access_logfile->ptr[0] == '|') {
2007 - /* create write pipe and spawn process */
2009 - int to_log_fds[2];
2012 - if (pipe(to_log_fds)) {
2013 - log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
2014 - return HANDLER_ERROR;
2017 - /* fork, execve */
2018 - switch (pid = fork()) {
2022 - close(STDIN_FILENO);
2023 - dup2(to_log_fds[0], STDIN_FILENO);
2024 - close(to_log_fds[0]);
2026 - close(to_log_fds[1]);
2028 - openDevNull(STDERR_FILENO);
2030 - /* we don't need the client socket */
2031 - for (i = 3; i < 256; i++) {
2035 - /* exec the log-process (skip the | )
2039 - execl("/bin/sh", "sh", "-c", s->access_logfile->ptr + 1, (char *)NULL);
2041 - log_error_write(srv, __FILE__, __LINE__, "sss",
2042 - "spawning log-process failed: ", strerror(errno),
2043 - s->access_logfile->ptr + 1);
2049 - log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
2052 - close(to_log_fds[0]);
2054 - s->log_access_fd = to_log_fds[1];
2061 - } else if (-1 == (s->log_access_fd =
2062 - open(s->access_logfile->ptr, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
2064 - log_error_write(srv, __FILE__, __LINE__, "ssb",
2065 - "opening access-log failed:",
2066 - strerror(errno), s->access_logfile);
2068 + if (-1 == (s->log_access_fd = open_logfile_or_pipe(srv, s->access_logfile->ptr)))
2069 return HANDLER_ERROR;
2072 - fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
2077 return HANDLER_GO_ON;
2082 +int mod_accesslog_plugin_init(plugin *p);
2083 int mod_accesslog_plugin_init(plugin *p) {
2084 p->version = LIGHTTPD_VERSION_ID;
2085 p->name = buffer_init_string("accesslog");
2087 ===================================================================
2088 --- src/server.c (.../tags/lighttpd-1.4.22) (revision 2475)
2089 +++ src/server.c (.../branches/lighttpd-1.4.x) (revision 2475)
2092 #include "joblist.h"
2093 #include "network_backends.h"
2094 +#include "version.h"
2096 #ifdef HAVE_GETOPT_H
2099 /* #define USE_ALARM */
2103 +# ifndef HAVE_ISSETUGID
2105 +static int l_issetugid() {
2106 + return (geteuid() != getuid() || getegid() != getgid());
2109 +# define issetugid l_issetugid
2113 static volatile sig_atomic_t srv_shutdown = 0;
2114 static volatile sig_atomic_t graceful_shutdown = 0;
2115 static volatile sig_atomic_t handle_sig_alarm = 1;
2120 - char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL \
2121 + char *b = PACKAGE_DESC TEXT_SSL \
2122 " - a light and fast webserver\n" \
2123 "Build-Date: " __DATE__ " " __TIME__ "\n";
2129 - char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
2130 + char *b = PACKAGE_DESC TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
2131 " - a light and fast webserver\n" \
2133 " -f <name> filename of the config-file\n" \
2138 - if (!i_am_root && (geteuid() == 0 || getegid() == 0)) {
2139 + if (!i_am_root && issetugid()) {
2140 /* we are setuid-root */
2142 log_error_write(srv, __FILE__, __LINE__, "s",
2143 Index: src/mod_dirlisting.c
2144 ===================================================================
2145 --- src/mod_dirlisting.c (.../tags/lighttpd-1.4.22) (revision 2475)
2146 +++ src/mod_dirlisting.c (.../branches/lighttpd-1.4.x) (revision 2475)
2148 #include <attr/attributes.h>
2151 +#include "version.h"
2153 /* plugin config for all request/connections */
2160 -excludes_buffer *excludes_buffer_init(void) {
2161 +static excludes_buffer *excludes_buffer_init(void) {
2162 excludes_buffer *exb;
2164 exb = calloc(1, sizeof(*exb));
2169 -int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
2170 +static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
2178 -void excludes_buffer_free(excludes_buffer *exb) {
2179 +static void excludes_buffer_free(excludes_buffer *exb) {
2184 if (p->conf.set_footer->used > 1) {
2185 buffer_append_string_buffer(out, p->conf.set_footer);
2186 } else if (buffer_is_empty(con->conf.server_tag)) {
2187 - buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_NAME "/" PACKAGE_VERSION));
2188 + buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_DESC));
2190 buffer_append_string_buffer(out, con->conf.server_tag);
2194 /* this function is called at dlopen() time and inits the callbacks */
2196 +int mod_dirlisting_plugin_init(plugin *p);
2197 int mod_dirlisting_plugin_init(plugin *p) {
2198 p->version = LIGHTTPD_VERSION_ID;
2199 p->name = buffer_init_string("dirlisting");
2200 Index: src/mod_magnet.c
2201 ===================================================================
2202 --- src/mod_magnet.c (.../tags/lighttpd-1.4.22) (revision 2475)
2203 +++ src/mod_magnet.c (.../branches/lighttpd-1.4.x) (revision 2475)
2205 MAGNET_ENV_REQUEST_METHOD,
2206 MAGNET_ENV_REQUEST_URI,
2207 MAGNET_ENV_REQUEST_ORIG_URI,
2208 + MAGNET_ENV_REQUEST_PATH_INFO,
2209 + MAGNET_ENV_REQUEST_REMOTE_IP,
2210 MAGNET_ENV_REQUEST_PROTOCOL
2214 { "request.method", MAGNET_ENV_REQUEST_METHOD },
2215 { "request.uri", MAGNET_ENV_REQUEST_URI },
2216 { "request.orig-uri", MAGNET_ENV_REQUEST_ORIG_URI },
2217 + { "request.path-info", MAGNET_ENV_REQUEST_PATH_INFO },
2218 + { "request.remote-ip", MAGNET_ENV_REQUEST_REMOTE_IP },
2219 { "request.protocol", MAGNET_ENV_REQUEST_PROTOCOL },
2221 { NULL, MAGNET_ENV_UNSET }
2224 case MAGNET_ENV_REQUEST_URI: dest = con->request.uri; break;
2225 case MAGNET_ENV_REQUEST_ORIG_URI: dest = con->request.orig_uri; break;
2226 + case MAGNET_ENV_REQUEST_PATH_INFO: dest = con->request.pathinfo; break;
2227 + case MAGNET_ENV_REQUEST_REMOTE_IP: dest = con->dst_addr_buf; break;
2228 case MAGNET_ENV_REQUEST_PROTOCOL:
2229 buffer_copy_string(srv->tmp_buf, get_http_version_name(con->request.http_version));
2230 dest = srv->tmp_buf;
2233 /* this function is called at dlopen() time and inits the callbacks */
2235 +int mod_magnet_plugin_init(plugin *p);
2236 int mod_magnet_plugin_init(plugin *p) {
2237 p->version = LIGHTTPD_VERSION_ID;
2238 p->name = buffer_init_string("magnet");
2243 +int mod_magnet_plugin_init(plugin *p);
2244 int mod_magnet_plugin_init(plugin *p) {
2248 ===================================================================
2249 --- src/log.c (.../tags/lighttpd-1.4.22) (revision 2475)
2250 +++ src/log.c (.../branches/lighttpd-1.4.x) (revision 2475)
2252 return (tmpfd != -1) ? 0 : -1;
2255 +int open_logfile_or_pipe(server *srv, const char* logfile) {
2258 + if (logfile[0] == '|') {
2260 + /* create write pipe and spawn process */
2262 + int to_log_fds[2];
2266 + if (pipe(to_log_fds)) {
2267 + log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
2271 + /* fork, execve */
2272 + switch (pid = fork()) {
2275 + close(STDIN_FILENO);
2277 + /* dup the filehandle to STDIN */
2278 + if (to_log_fds[0] != STDIN_FILENO) {
2279 + if (STDIN_FILENO != dup2(to_log_fds[0], STDIN_FILENO)) {
2280 + log_error_write(srv, __FILE__, __LINE__, "ss",
2281 + "dup2 failed: ", strerror(errno));
2284 + close(to_log_fds[0]);
2286 + close(to_log_fds[1]);
2289 + /* we don't need the client socket */
2290 + for (i = 3; i < 256; i++) {
2295 + /* close old stderr */
2296 + openDevNull(STDERR_FILENO);
2298 + /* exec the log-process (skip the | ) */
2299 + execl("/bin/sh", "sh", "-c", logfile + 1, NULL);
2300 + log_error_write(srv, __FILE__, __LINE__, "sss",
2301 + "spawning log process failed: ", strerror(errno),
2308 + log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed: ", strerror(errno));
2311 + close(to_log_fds[0]);
2312 + fd = to_log_fds[1];
2319 + } else if (-1 == (fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
2320 + log_error_write(srv, __FILE__, __LINE__, "SSSS",
2321 + "opening errorlog '", logfile,
2322 + "' failed: ", strerror(errno));
2328 + fcntl(fd, F_SETFD, FD_CLOEXEC);
2338 - * we have 3 possibilities:
2339 + * we have 4 possibilities:
2340 * - stderr (default)
2345 * if the open failed, report to the user and die
2347 @@ -80,18 +161,10 @@
2348 } else if (!buffer_is_empty(srv->srvconf.errorlog_file)) {
2349 const char *logfile = srv->srvconf.errorlog_file->ptr;
2351 - if (-1 == (srv->errorlog_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
2352 - log_error_write(srv, __FILE__, __LINE__, "SSSS",
2353 - "opening errorlog '", logfile,
2354 - "' failed: ", strerror(errno));
2356 + if (-1 == (srv->errorlog_fd = open_logfile_or_pipe(srv, logfile))) {
2360 - /* close fd on exec (cgi) */
2361 - fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
2363 - srv->errorlog_mode = ERRORLOG_FILE;
2364 + srv->errorlog_mode = (logfile[0] == '|') ? ERRORLOG_PIPE : ERRORLOG_FILE;
2367 log_error_write(srv, __FILE__, __LINE__, "s", "server started");
2371 int log_error_cycle(server *srv) {
2372 - /* only cycle if we are not in syslog-mode */
2373 + /* only cycle if the error log is a file */
2375 if (srv->errorlog_mode == ERRORLOG_FILE) {
2376 const char *logfile = srv->srvconf.errorlog_file->ptr;
2381 - if (-1 == (new_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) {
2382 + if (-1 == (new_fd = open_logfile_or_pipe(srv, logfile))) {
2383 /* write to old log */
2384 log_error_write(srv, __FILE__, __LINE__, "SSSSS",
2385 "cycling errorlog '", logfile,
2388 int log_error_close(server *srv) {
2389 switch(srv->errorlog_mode) {
2390 + case ERRORLOG_PIPE:
2392 close(srv->errorlog_fd);
2397 switch(srv->errorlog_mode) {
2398 + case ERRORLOG_PIPE:
2400 case ERRORLOG_STDERR:
2401 /* cache the generated timestamp */
2405 switch(srv->errorlog_mode) {
2406 + case ERRORLOG_PIPE:
2408 buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
2409 write(srv->errorlog_fd, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
2411 ===================================================================
2412 --- src/log.h (.../tags/lighttpd-1.4.22) (revision 2475)
2413 +++ src/log.h (.../branches/lighttpd-1.4.x) (revision 2475)
2416 #define WP() log_error_write(srv, __FILE__, __LINE__, "");
2418 +int open_logfile_or_pipe(server *srv, const char* logfile);
2420 int log_error_open(server *srv);
2421 int log_error_close(server *srv);
2422 int log_error_write(server *srv, const char *filename, unsigned int line, const char *fmt, ...);
2423 Index: src/fdevent.c
2424 ===================================================================
2425 --- src/fdevent.c (.../tags/lighttpd-1.4.22) (revision 2475)
2426 +++ src/fdevent.c (.../branches/lighttpd-1.4.x) (revision 2475)
2431 -fdnode *fdnode_init() {
2432 +static fdnode *fdnode_init() {
2435 fdn = calloc(1, sizeof(*fdn));
2440 -void fdnode_free(fdnode *fdn) {
2441 +static void fdnode_free(fdnode *fdn) {
2445 Index: tests/fcgi-responder.c
2446 ===================================================================
2447 --- tests/fcgi-responder.c (.../tags/lighttpd-1.4.22) (revision 2475)
2448 +++ tests/fcgi-responder.c (.../branches/lighttpd-1.4.x) (revision 2475)
2450 printf("Status: 500 Internal Foo\r\n\r\n");
2453 - printf("test123");
2454 + if (0 == strcmp(p, "path_info")) {
2455 + printf("%s", getenv("PATH_INFO"));
2456 + } else if (0 == strcmp(p, "script_name")) {
2457 + printf("%s", getenv("SCRIPT_NAME"));
2459 + printf("test123");
2464 Index: tests/mod-fastcgi.t
2465 ===================================================================
2466 --- tests/mod-fastcgi.t (.../tags/lighttpd-1.4.22) (revision 2475)
2467 +++ tests/mod-fastcgi.t (.../branches/lighttpd-1.4.x) (revision 2475)
2472 -use Test::More tests => 50;
2473 +use Test::More tests => 52;
2476 my $tf = LightyTest->new();
2478 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo/bar' } ];
2479 ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off');
2483 ok($tf->stop_proc == 0, "Stopping lighttpd");
2490 - skip "no fcgi-responder found", 9 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe";
2491 + skip "no fcgi-responder found", 11 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe";
2493 $tf->{CONFIGFILE} = 'fastcgi-responder.conf';
2494 ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
2495 @@ -319,6 +319,23 @@
2496 ok($tf->handle_http($t) == 0, 'line-ending \r\n + \r\n');
2498 $t->{REQUEST} = ( <<EOF
2499 +GET /abc/def/ghi?path_info HTTP/1.0
2500 +Host: wsgi.example.org
2503 + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/abc/def/ghi' } ];
2504 + ok($tf->handle_http($t) == 0, 'PATH_INFO (wsgi)');
2506 + $t->{REQUEST} = ( <<EOF
2507 +GET /abc/def/ghi?script_name HTTP/1.0
2508 +Host: wsgi.example.org
2511 + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '' } ];
2512 + ok($tf->handle_http($t) == 0, 'SCRIPT_NAME (wsgi)');
2515 + $t->{REQUEST} = ( <<EOF
2516 GET /index.fcgi?die-at-end HTTP/1.0
2517 Host: www.example.org
2519 Index: tests/fastcgi-responder.conf
2520 ===================================================================
2521 --- tests/fastcgi-responder.conf (.../tags/lighttpd-1.4.22) (revision 2475)
2522 +++ tests/fastcgi-responder.conf (.../branches/lighttpd-1.4.x) (revision 2475)
2523 @@ -159,3 +159,15 @@
2524 server.name = "zzz.example.org"
2527 +$HTTP["host"] == "wsgi.example.org" {
2528 + fastcgi.server = (
2531 + "host" => "127.0.0.1", "port" => 10000,
2532 + "fix-root-scriptname" => "enable",
2533 + "check-local" => "disable",
2534 + "bin-path" => env.SRCDIR + "/fcgi-responder",
2539 Index: tests/LightyTest.pm
2540 ===================================================================
2541 --- tests/LightyTest.pm (.../tags/lighttpd-1.4.22) (revision 2475)
2542 +++ tests/LightyTest.pm (.../branches/lighttpd-1.4.x) (revision 2475)
2547 -use POSIX ":sys_wait_h";
2548 +use POSIX qw(:sys_wait_h dup2);
2549 +use Errno qw(EADDRINUSE);
2553 @@ -344,8 +345,14 @@
2557 - my $cmd = $self->{BINDIR}.'/spawn-fcgi -n -p '.$port.' -f "'.$binary.'"';
2558 - exec $cmd or die($?);
2559 + my $iaddr = inet_aton('localhost') || die "no host: localhost";
2560 + my $proto = getprotobyname('tcp');
2561 + socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
2562 + setsockopt(SOCK, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) || die "setsockopt: $!";
2563 + bind(SOCK, sockaddr_in($port, $iaddr)) || die "bind: $!";
2564 + listen(SOCK, 1024) || die "listen: $!";
2565 + dup2(fileno(SOCK), 0) || die "dup2: $!";
2566 + exec $binary or die($?);
2568 if (0 != $self->wait_for_port_with_proc($port, $child)) {
2569 diag(sprintf('The process %i is not up (port %i, %s)', $child, $port, $binary));
2571 ===================================================================
2572 --- configure.ac (.../tags/lighttpd-1.4.22) (revision 0)
2573 +++ configure.ac (.../branches/lighttpd-1.4.x) (revision 2475)
2576 +# Process this file with autoconf to produce a configure script.
2578 +AC_INIT([lighttpd], [1.4.23], [jan@kneschke.de])
2579 +AC_CONFIG_SRCDIR([src/server.c])
2580 +AC_CONFIG_HEADER([config.h])
2582 +AC_CANONICAL_TARGET
2586 +# Checks for programs.
2597 +dnl check environment
2602 +dnl AC_CANONICAL_HOST
2604 + *darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;;
2605 + * ) NO_RDYNAMIC=no;;
2607 +AM_CONDITIONAL(NO_RDYNAMIC, test x$NO_RDYNAMIC = xyes)
2611 +dnl more automake stuff
2622 +CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
2624 +# Checks for header files.
2627 +AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
2628 +sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \
2629 +getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
2630 +sys/mman.h sys/event.h sys/port.h pwd.h sys/syslimits.h \
2631 +sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h])
2633 +# Checks for typedefs, structures, and compiler characteristics.
2641 +AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
2642 +AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>])
2643 +AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
2644 +#include <sys/socket.h>])
2646 +# Checks for library functions.
2650 +dnl AC_FUNC_REALLOC
2654 +AC_CHECK_FUNCS([issetugid])
2656 +dnl Checks for database.
2660 +AC_MSG_CHECKING(for MySQL support)
2662 + AC_HELP_STRING([--with-mysql@<:@=PATH@:>@],[Include MySQL support. PATH is the path to 'mysql_config']),
2663 + [WITH_MYSQL=$withval],[WITH_MYSQL=no])
2665 +if test "$WITH_MYSQL" != "no"; then
2666 + AC_MSG_RESULT(yes)
2667 + if test "$WITH_MYSQL" = "yes"; then
2668 + AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
2670 + MYSQL_CONFIG=$WITH_MYSQL
2673 + if test "$MYSQL_CONFIG" = ""; then
2674 + AC_MSG_ERROR(mysql_config is not found)
2676 + if test \! -x $MYSQL_CONFIG; then
2677 + AC_MSG_ERROR(mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config)
2680 + if $MYSQL_CONFIG | grep -- '--include' > /dev/null ; then
2681 + MYSQL_INCLUDE="`$MYSQL_CONFIG --include | sed s/\'//g`"
2683 + MYSQL_INCLUDE="`$MYSQL_CONFIG --cflags | sed s/\'//g`"
2685 + MYSQL_LIBS="`$MYSQL_CONFIG --libs | sed s/\'//g`"
2687 + AC_MSG_CHECKING(for MySQL includes at)
2688 + AC_MSG_RESULT($MYSQL_INCLUDE)
2690 + AC_MSG_CHECKING(for MySQL libraries at)
2691 + AC_MSG_RESULT($MYSQL_LIBS)
2692 +dnl check for errmsg.h, which isn't installed by some versions of 3.21
2693 + old_CPPFLAGS="$CPPFLAGS"
2694 + CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
2695 + AC_CHECK_HEADERS(errmsg.h mysql.h)
2696 + CPPFLAGS="$old_CPPFLAGS"
2698 + AC_DEFINE([HAVE_MYSQL], [1], [mysql support])
2703 +AC_SUBST(MYSQL_LIBS)
2704 +AC_SUBST(MYSQL_INCLUDE)
2707 +AC_MSG_CHECKING(for LDAP support)
2708 +AC_ARG_WITH(ldap, AC_HELP_STRING([--with-ldap],[enable LDAP support]),
2709 +[WITH_LDAP=$withval], [WITH_LDAP=no])
2710 +AC_MSG_RESULT([$withval])
2711 +if test "$WITH_LDAP" != "no"; then
2712 + AC_CHECK_LIB(ldap, ldap_bind, [
2713 + AC_CHECK_HEADERS([ldap.h],[
2715 + AC_DEFINE([HAVE_LIBLDAP], [1], [libldap])
2716 + AC_DEFINE([HAVE_LDAP_H], [1])
2717 + AC_DEFINE([LDAP_DEPRECATED], [1], [Using deprecated ldap api])
2720 + AC_SUBST(LDAP_LIB)
2721 + AC_CHECK_LIB(lber, ber_printf, [
2722 + AC_CHECK_HEADERS([lber.h],[
2724 + AC_DEFINE([HAVE_LIBLBER], [1], [liblber])
2725 + AC_DEFINE([HAVE_LBER_H], [1])
2728 + AC_SUBST(LBER_LIB)
2731 +dnl Check for xattr
2732 +AC_MSG_CHECKING(for extended attributes support)
2733 +AC_ARG_WITH(attr, AC_HELP_STRING([--with-attr],[enable extended attribute support]),
2734 +[WITH_ATTR=$withval],[WITH_ATTR=no])
2735 +AC_MSG_RESULT($withval)
2736 +if test "$WITH_ATTR" != "no"; then
2737 + AC_CHECK_LIB(attr, attr_get, [
2738 + AC_CHECK_HEADERS([attr/attributes.h],[
2740 + AC_DEFINE([HAVE_XATTR], [1], [libattr])
2741 + AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1])
2744 + AC_SUBST(ATTR_LIB)
2747 +## openssl on solaris needs -lsocket -lnsl
2748 +AC_SEARCH_LIBS(socket,socket)
2749 +AC_SEARCH_LIBS(gethostbyname,nsl socket)
2750 +AC_SEARCH_LIBS(hstrerror,resolv)
2753 +AC_SEARCH_LIBS(dlopen,dl,[
2754 + AC_CHECK_HEADERS([dlfcn.h],[
2755 + if test "$ac_cv_search_dlopen" != no; then
2756 + test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen"
2759 + AC_DEFINE([HAVE_LIBDL], [1], [libdl])
2760 + AC_DEFINE([HAVE_DLFCN_H], [1])
2766 +dnl Check for valgrind
2767 +AC_MSG_CHECKING(for valgrind)
2768 +AC_ARG_WITH(valgrind, AC_HELP_STRING([--with-valgrind],[enable internal support for valgrind]),
2769 +[WITH_VALGRIND=$withval],[WITH_VALGRIND=no])
2770 +AC_MSG_RESULT([$WITH_VALGRIND])
2771 +if test "$WITH_VALGRIND" != "no"; then
2772 + AC_CHECK_HEADERS([valgrind/valgrind.h])
2775 +dnl Check for openssl
2776 +AC_MSG_CHECKING(for OpenSSL)
2777 +AC_ARG_WITH(openssl,
2778 + AC_HELP_STRING([--with-openssl@<:@=DIR@:>@],[Include openssl support (default no)]),
2779 + [WITH_OPENSSL=$withval],[WITH_OPENSSL=no])
2781 +if test "$WITH_OPENSSL" != "no"; then
2783 + if test "$WITH_OPENSSL" != "yes"; then
2784 + CPPFLAGS="$CPPFLAGS -I$WITH_OPENSSL/include"
2785 + LDFLAGS="$LDFLAGS -L$WITH_OPENSSL/lib"
2790 +AC_MSG_RESULT([$use_openssl])
2792 +AC_ARG_WITH(openssl-includes,
2793 + AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
2794 + [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
2797 +AC_ARG_WITH(openssl-libs,
2798 + AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
2799 + [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
2802 +AC_ARG_WITH(kerberos5,
2803 + AC_HELP_STRING([--with-kerberos5],[use Kerberos5 support with OpenSSL]),
2804 + [ use_kerberos=yes ], [use_kerberos=no]
2807 +if test "x$use_openssl" = "xyes"; then
2808 + if test "x$use_kerberos" != "xyes"; then
2809 + CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
2812 + AC_CHECK_HEADERS([openssl/ssl.h])
2814 + AC_CHECK_LIB(crypto, BIO_f_base64, [
2815 + AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto"
2816 + AC_DEFINE(HAVE_LIBSSL, [], [Have libssl]) ], [], [ -lcrypto "$DL_LIB" ])
2822 +AC_MSG_CHECKING(for perl regular expressions support)
2823 +AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes)]),
2824 + [WITH_PCRE=$withval],[WITH_PCRE=yes])
2825 +AC_MSG_RESULT([$WITH_PCRE])
2827 +if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then
2828 + AC_PATH_PROG(PCRECONFIG, pcre-config)
2830 + if test x"$PCRECONFIG" != x; then
2831 + PCRE_LIB=`$PCRECONFIG --libs`
2832 + CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
2833 + AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
2834 + AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
2836 + AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
2842 +AC_MSG_CHECKING(for zlib support)
2843 +AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib],[Enable zlib support for mod_compress]),
2844 + [WITH_ZLIB=$withval],[WITH_ZLIB=yes])
2845 +AC_MSG_RESULT([$WITH_ZLIB])
2847 +if test "$WITH_ZLIB" != "no"; then
2848 + AC_CHECK_LIB(z, deflate, [
2849 + AC_CHECK_HEADERS([zlib.h],[
2851 + AC_DEFINE([HAVE_LIBZ], [1], [libz])
2852 + AC_DEFINE([HAVE_ZLIB_H], [1])
2855 + if test x$Z_LIB = x; then
2856 + AC_MSG_ERROR([zlib-headers and/or libs where not found, install them or build with --without-zlib])
2861 +AC_MSG_CHECKING(for bzip2 support)
2862 +AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2],[Enable bzip2 support for mod_compress]),
2863 + [WITH_BZIP2=$withval],[WITH_BZIP2=yes])
2864 +AC_MSG_RESULT([$WITH_BZIP2])
2866 +if test "$WITH_BZIP2" != "no"; then
2867 + AC_CHECK_LIB(bz2, BZ2_bzCompress, [
2868 + AC_CHECK_HEADERS([bzlib.h],[
2870 + AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2])
2871 + AC_DEFINE([HAVE_BZLIB_H], [1])
2874 + if test x$BZ_LIB = x; then
2875 + AC_MSG_ERROR([bzip2-headers and/or libs where not found, install them or build with --without-bzip2])
2880 +if test -z "$PKG_CONFIG"; then
2881 + AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2884 +dnl Check for gamin
2885 +AC_MSG_CHECKING(for FAM)
2886 +AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]),
2887 +[WITH_FAM=$withval],[WITH_FAM=no])
2888 +AC_MSG_RESULT([$WITH_FAM])
2890 +if test "$WITH_FAM" != "no"; then
2891 + AC_CHECK_LIB(fam, FAMOpen2, [
2892 + AC_CHECK_HEADERS([fam.h],[
2894 + AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
2895 + AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
2898 + if test "x$FAM_LIBS" = x; then
2899 + PKG_CHECK_MODULES(FAM, gamin >= 0.1.0, [
2900 + AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
2901 + AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
2906 + AC_CHECK_FUNCS([FAMNoExists])
2909 + if test x$FAM_LIBS = x; then
2910 + AC_MSG_ERROR([fam/gamin-headers and/or libs where not found, install them or build with --without-fam])
2914 +AC_MSG_CHECKING(for properties in mod_webdav)
2915 +AC_ARG_WITH(webdav-props, AC_HELP_STRING([--with-webdav-props],[properties in mod_webdav]),
2916 +[WITH_WEBDAV_PROPS=$withval],[WITH_WEBDAV_PROPS=no])
2917 +AC_MSG_RESULT([$WITH_WEBDAV_PROPS])
2919 +if test "$WITH_WEBDAV_PROPS" != "no"; then
2920 + PKG_CHECK_MODULES(XML, libxml-2.0, [
2921 + AC_DEFINE([HAVE_LIBXML2], [1], [libxml2])
2922 + AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h])
2924 + PKG_CHECK_MODULES(SQLITE, sqlite3, [
2925 + AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
2926 + AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
2929 + AC_MSG_CHECKING(for locks in mod_webdav)
2930 + AC_ARG_WITH(webdav-locks, AC_HELP_STRING([--with-webdav-locks],[locks in mod_webdav]),
2931 + [WITH_WEBDAV_LOCKS=$withval],[WITH_WEBDAV_LOCKS=no])
2932 + AC_MSG_RESULT([$WITH_WEBDAV_LOCKS])
2934 + if test "$WITH_WEBDAV_LOCKS" != "no"; then
2935 + AC_CHECK_LIB(uuid, uuid_unparse, [
2936 + AC_CHECK_HEADERS([uuid/uuid.h],[
2938 + AC_DEFINE([HAVE_UUID], [1], [libuuid])
2939 + AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available])
2945 +AC_SUBST(UUID_LIBS)
2948 +AC_MSG_CHECKING(for gdbm)
2949 +AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm],[gdbm storage for mod_trigger_b4_dl]),
2950 +[WITH_GDBM=$withval],[WITH_GDBM=no])
2951 +AC_MSG_RESULT([$WITH_GDBM])
2953 +if test "$WITH_GDBM" != "no"; then
2954 + AC_CHECK_LIB(gdbm, gdbm_open, [
2955 + AC_CHECK_HEADERS([gdbm.h],[
2957 + AC_DEFINE([HAVE_GDBM], [1], [libgdbm])
2958 + AC_DEFINE([HAVE_GDBM_H], [1])
2961 + AC_SUBST(GDBM_LIB)
2964 +dnl Check for memcache
2965 +AC_MSG_CHECKING(for memcache)
2966 +AC_ARG_WITH(memcache, AC_HELP_STRING([--with-memcache],[memcached storage for mod_trigger_b4_dl]),
2967 +[WITH_MEMCACHE=$withval],[WITH_MEMCACHE=no])
2968 +AC_MSG_RESULT([$WITH_MEMCACHE])
2969 +if test "$WITH_MEMCACHE" != "no"; then
2970 + AC_CHECK_LIB(memcache, mc_new, [
2971 + AC_CHECK_HEADERS([memcache.h],[
2972 + MEMCACHE_LIB=-lmemcache
2973 + AC_DEFINE([HAVE_MEMCACHE], [1], [libmemcache])
2974 + AC_DEFINE([HAVE_MEMCACHE_H], [1], [memcache.h])
2977 + AC_SUBST(MEMCACHE_LIB)
2981 +AC_MSG_CHECKING(if lua-support is requested)
2982 +AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
2983 +[WITH_LUA=$withval],[WITH_LUA=no])
2985 +AC_MSG_RESULT($WITH_LUA)
2986 +if test "$WITH_LUA" != "no"; then
2987 + if test "$WITH_LUA" = "yes"; then
2990 + PKG_CHECK_MODULES(LUA, $WITH_LUA >= 5.1, [
2991 + AC_DEFINE([HAVE_LUA], [1], [liblua])
2992 + AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
2994 + # for debian based systems
2995 + PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
2996 + AC_DEFINE([HAVE_LUA], [1], [liblua])
2997 + AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
3001 + AC_SUBST(LUA_CFLAGS)
3002 + AC_SUBST(LUA_LIBS)
3006 +AC_SEARCH_LIBS(crypt,crypt,[
3007 + AC_CHECK_HEADERS([crypt.h],[
3008 + AC_DEFINE([HAVE_CRYPT_H], [1])
3011 + AC_DEFINE([HAVE_LIBCRYPT], [1], [libcrypt])
3012 + if test "$ac_cv_search_crypt" != no; then
3013 + test "$ac_cv_search_crypt" = "none required" || CRYPT_LIB="$ac_cv_search_crypt"
3017 +AC_SUBST(CRYPT_LIB)
3020 +AC_SEARCH_LIBS(sendfilev,sendfile,[
3021 + if test "$ac_cv_search_sendfilev" != no; then
3022 + test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev"
3023 + AC_DEFINE([HAVE_SENDFILEV], [1], [solaris sendfilev])
3027 +AC_SUBST(SENDFILE_LIB)
3030 + *mingw* ) LIBS="$LIBS -lwsock32";;
3034 +AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
3035 + strdup strerror strstr strtol sendfile getopt socket lstat \
3036 + gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
3037 + getuid select signal pathconf madvise posix_fadvise posix_madvise \
3038 + writev sigaction sendfile64 send_file kqueue port_create localtime_r gmtime_r])
3040 +AC_MSG_CHECKING(for Large File System support)
3042 + AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]),
3043 + [case "${enableval}" in
3044 + yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
3046 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;;
3047 + esac],[CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
3049 +AC_MSG_RESULT($enableval)
3051 +AC_CHECK_SIZEOF(long)
3052 +AC_CHECK_SIZEOF(off_t)
3054 +if test "x$ac_cv_func_sendfile" = xyes; then
3055 + # check if sendfile works
3056 + AC_MSG_CHECKING(if sendfile works)
3057 + if test "x$cross_compiling" = xno; then
3059 + #ifdef HAVE_SYS_SENDFILE_H
3060 + #include <sys/sendfile.h>
3061 + #endif /* HAVE_SYS_SENDFILE_H */
3062 + #include <errno.h>
3065 + if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1;
3068 + AC_MSG_RESULT(yes),
3069 + [ AC_MSG_RESULT(no)
3070 + AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) ] )
3072 + AC_MSG_RESULT(no, cross-compiling)
3073 + AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])
3077 +dnl Check for IPv6 support
3079 +AC_ARG_ENABLE(ipv6,
3080 + AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
3081 + [case "${enableval}" in
3084 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
3085 + esac],[ipv6=true])
3087 +if test x$ipv6 = xtrue; then
3088 + AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
3089 + [AC_TRY_LINK([ #include <sys/types.h>
3090 +#include <sys/socket.h>
3091 +#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ],
3092 + [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
3094 + if test "$ac_cv_ipv6_support" = yes; then
3095 + AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
3100 +AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
3102 +dnl check for fastcgi lib, for the tests only
3104 +AC_CHECK_LIB(fcgi, FCGI_Accept, [
3105 + AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h],[
3110 +AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
3113 +# check for extra compiler options (warning options)
3114 +if test "${GCC}" = "yes"; then
3115 + CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
3118 +AC_ARG_ENABLE(extra-warnings,
3119 + AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
3120 + [case "${enableval}" in
3121 + yes) extrawarnings=true ;;
3122 + no) extrawarnings=false ;;
3123 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
3124 + esac],[extrawarnings=false])
3126 +if test x$extrawarnings = xtrue; then
3127 + 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"
3130 +dnl build version-id
3131 +LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'`
3132 +AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id])
3134 +AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile \
3135 + tests/docroot/Makefile \
3136 + tests/docroot/123/Makefile \
3137 + tests/docroot/www/Makefile \
3138 + tests/docroot/www/go/Makefile \
3139 + tests/docroot/www/indexfile/Makefile \
3140 + tests/docroot/www/expire/Makefile \
3145 +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"
3146 +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"
3148 +plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl"
3149 +features="regex-conditionals"
3150 +if test ! "x$PCRE_LIB" = x; then
3151 + do_build="$do_build $plugins"
3152 + enable_feature="$features"
3154 + no_build="$no_build $plugins"
3155 + disable_feature="$features"
3158 +plugins="mod_mysql_vhost"
3159 +if test ! "x$MYSQL_LIBS" = x; then
3160 + do_build="$do_build $plugins"
3162 + no_build="$no_build $plugins"
3165 +plugins="mod_cml mod_magnet"
3166 +if test ! "x$LUA_LIBS" = x; then
3167 + do_build="$do_build $plugins"
3169 + no_build="$no_build $plugins"
3172 +features="storage-gdbm"
3173 +if test ! "x$GDBM_LIB" = x; then
3174 + enable_feature="$enable_feature $features"
3176 + disable_feature="$disable_feature $features"
3179 +features="storage-memcache"
3180 +if test ! "x$MEMCACHE_LIB" = x; then
3181 + enable_feature="$enable_feature $features"
3183 + disable_feature="$disable_feature $features"
3186 +features="compress-gzip compress-deflate"
3187 +if test ! "x$Z_LIB" = x; then
3188 + enable_feature="$enable_feature $features"
3190 + disable_feature="$disable_feature $features"
3193 +features="compress-bzip2"
3194 +if test ! "x$BZ_LIB" = x; then
3195 + enable_feature="$enable_feature $features"
3197 + disable_feature="$disable_feature $features"
3200 +features="auth-ldap"
3201 +if test ! "x$LDAP_LIB" = x; then
3202 + enable_feature="$enable_feature $features"
3204 + disable_feature="$disable_feature $features"
3207 +features="network-openssl"
3208 +if test ! "x$SSL_LIB" = x; then
3209 + enable_feature="$enable_feature $features"
3211 + disable_feature="$disable_feature $features"
3215 +features="auth-crypt"
3216 +if test "$ac_cv_search_crypt" = no; then
3217 + disable_feature="$disable_feature $features"
3219 + enable_feature="$enable_feature $features"
3222 +features="network-ipv6"
3223 +if test "$ac_cv_ipv6_support" = yes; then
3224 + enable_feature="$enable_feature $features"
3226 + disable_feature="$disable_feature $features"
3229 +features="large-files"
3230 +if test "$enable_lfs" = yes; then
3231 + enable_feature="$enable_feature $features"
3233 + disable_feature="$disable_feature $features"
3236 +features="stat-cache-fam"
3237 +if test ! "x$FAM_LIBS" = x; then
3238 + enable_feature="$enable_feature $features"
3240 + disable_feature="$disable_feature $features"
3243 +features="webdav-properties"
3244 +if test "x$XML_LIBS" \!= x -a "x$SQLITE_LIBS" \!= x; then
3245 + enable_feature="$enable_feature $features"
3247 + disable_feature="$disable_feature $features"
3250 +features="webdav-locks"
3251 +if test "x$UUID_LIBS" \!= x; then
3252 + enable_feature="$enable_feature $features"
3254 + disable_feature="$disable_feature $features"
3265 +for p in $do_build; do
3270 +for p in $no_build; do
3279 +for p in $enable_feature; do
3284 +for p in $disable_feature; do
3289 Index: doc/lighttpd.1
3290 ===================================================================
3291 --- doc/lighttpd.1 (.../tags/lighttpd-1.4.22) (revision 2475)
3292 +++ doc/lighttpd.1 (.../branches/lighttpd-1.4.x) (revision 2475)
3294 -.TH LIGHTTPD 1 2003-12-21
3296 -lighttpd - a fast, secure and flexible webserver
3298 -lighttpd -D -f <configfile>
3301 -/etc/lighttpd/lighttpd.conf
3305 -HTTP-Authentification - Basic, Digest
3312 Index: doc/spawn-fcgi.1
3313 ===================================================================
3314 --- doc/spawn-fcgi.1 (.../tags/lighttpd-1.4.22) (revision 2475)
3315 +++ doc/spawn-fcgi.1 (.../branches/lighttpd-1.4.x) (revision 2475)
3317 -.TH SPAWNFCGI 1 2003-12-21
3319 -spawn-fcgi \- spawning FastCGI processes
3321 -spawn-fcgi -f <fastcgi-binary> [-p <port> | -s <socket>] [-C <num-of-php-procs>] [-c <chroot-dir>] [-u <username>] [-g <groupname>]
3325 -spawn-fcgi is used to spawn remote FastCGI processes.
3330 Index: doc/lighttpd.8
3331 ===================================================================
3332 --- doc/lighttpd.8 (.../tags/lighttpd-1.4.22) (revision 0)
3333 +++ doc/lighttpd.8 (.../branches/lighttpd-1.4.x) (revision 2475)
3335 +.TH LIGHTTPD "8" "2009-03-07" "" ""
3338 +lighttpd \- a fast, secure and flexible web server
3341 +\fBlighttpd\fP [\fB\-ptDvVh\fP] \fB\-f\fP \fIconfigfile\fP [\fB\-m\fP \fImoduledir\fP]
3344 +\fBlighttpd\fP (pronounced 'lighty') is an advanced HTTP daemon that aims
3345 +to be secure, fast, compliant and very flexible. It has been optimized for
3346 +high performance. Its feature set includes, but is not limited to, FastCGI,
3347 +CGI, basic and digest HTTP authentication, output compression, URL rewriting.
3349 +This manual page only lists the command line arguments. For details
3350 +on how to configure \fBlighttpd\fP and its modules see the files in the
3354 +The following options are supported:
3356 +\fB\-f\ \fP \fIconfigfile\fP
3357 +Load configuration file \fIconfigfile\fP.
3359 +\fB\-m\ \fP \fImoduledir\fP
3362 +as the directory that contains modules, instead of the default.
3365 +Print the parsed configuration file in its internal form and exit.
3368 +Test the configuration file for syntax errors and exit.
3371 +Do not daemonize (go into background). The default is to daemonize.
3374 +Show version and exit.
3377 +Show compile-time features and exit.
3380 +Show a brief help message and exit.
3384 +/etc/lighttpd/lighttpd.conf
3385 +The standard location for the configuration file.
3387 +/var/run/lighttpd.pid
3388 +The standard location for the PID of the running \fBlighttpd\fP process.
3391 +Online Documentation: http://wiki.lighttpd.net/
3395 +\fIHypertext Transfer Protocol -- HTTP/1.1\fP, RFC 2616.
3397 +\fIHTTP Authentication: Basic and Digest Access Authentication\fP, RFC 2617.
3399 +\fIThe Common Gateway Interface Version 1.1\fP, RFC 3875.
3401 +\fIThe FastCGI specification\fP.
3404 +Jan Kneschke <jan@kneschke.de>
3405 Index: doc/lighttpd.conf
3406 ===================================================================
3407 --- doc/lighttpd.conf (.../tags/lighttpd-1.4.22) (revision 2475)
3408 +++ doc/lighttpd.conf (.../branches/lighttpd-1.4.x) (revision 2475)
3414 # "mod_trigger_b4_dl",
3421 -## a static document-root, for virtual-hosting take look at the
3422 -## server.virtual-* options
3423 +## A static document-root. For virtual hosting take a look at the
3424 +## mod_simple_vhost module.
3425 server.document-root = "/srv/www/htdocs/"
3427 ## where to send error-messages to
3428 @@ -299,11 +298,6 @@
3429 # trigger-before-download.deny-url = "http://127.0.0.1/index.html"
3430 # trigger-before-download.trigger-timeout = 10
3433 -## don't forget to add index.cml to server.indexfiles
3434 -# cml.extension = ".cml"
3435 -# cml.memcache-hosts = ( "127.0.0.1:11211" )
3437 #### variable usage:
3438 ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
3440 Index: doc/Makefile.am
3441 ===================================================================
3442 --- doc/Makefile.am (.../tags/lighttpd-1.4.22) (revision 2475)
3443 +++ doc/Makefile.am (.../branches/lighttpd-1.4.x) (revision 2475)
3445 -dist_man1_MANS=lighttpd.1 spawn-fcgi.1
3446 +dist_man8_MANS=lighttpd.8
3449 DOCS=accesslog.txt \
3450 authentication.txt \
3453 ===================================================================
3455 ===================================================================
3456 --- NEWS (.../tags/lighttpd-1.4.22) (revision 2475)
3457 +++ NEWS (.../branches/lighttpd-1.4.x) (revision 2475)
3464 + * Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
3465 + * New lighttpd man page (moved it to section 8) (fixes #1875)
3466 + * Create rrd file for empty rrdfile in mod_rrdtool (#1788)
3467 + * Fix workaround for incorrect path info/scriptname if fastcgi prefix is "/" (fixes #729)
3468 + * Finally removed spawn-fcgi
3469 + * Allow xattr to overwrite mime type (fixes #1929)
3470 + * Remove link from errormsg about fastcgi apps (fixes #1942)
3471 + * Strip trailing dot from "Host:" header
3472 + * Remove the optional port info from SERVER_NAME (thx Mr_Bond)
3473 + * Fix mod_proxy RoundRobin (off by one problem if only one backend is up)
3474 + * Rename configure.in to configure.ac, with small cleanups (fixes #1932)
3475 + * Add proper SUID bit detection (fixes #416)
3476 + * Check for regular file in mod_cgi, so we don't try to start directories
3477 + * Include mmap.h from chunk.h to fix some problems with #define mmap mmap64 (fixes #1923)
3478 + * Add support for pipe logging for server.errorlog (fixes #296)
3479 + * Add revision number to package version for svn/git checkouts
3480 + * Use server.tag for SERVER_SOFTWARE if configured (fixes #357)
3481 + * Fix trailing zero char in REQUEST_URI after "strip-request-uri" in mod_fastcgi
3482 + * mod_magnet: Add env["request.remote-ip"] (fixes #1740)
3483 + * mod_magnet: Add env["request.path-info"]
3484 + * Change name/version separator back to "/" (affects every place where the version is printed)
3486 +- 1.4.22 - 2009-03-07
3487 * Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)
3488 * Fix default vhost in mod_simple_vhost (fixes #1905)
3489 * Handle EINTR in mod_rrdtool (fixes #604)
3490 Index: CMakeLists.txt
3491 ===================================================================
3493 Property changes on: .
3494 ___________________________________________________________________
3495 Modified: bzr:revision-info
3496 - timestamp: 2009-03-07 14:58:05.338000059 +0100
3497 committer: Stefan Bühler <stbuehler@web.de>
3499 branch-nick: lighttpd-1.4.x
3501 + timestamp: 2009-03-07 22:04:32.213999987 +0100
3502 committer: Stefan Bühler <stbuehler@web.de>
3504 branch-nick: lighttpd-1.4.x
3506 Modified: bzr:file-ids
3508 + doc/lighttpd.8 lighttpd.8-20090307205615-mc312p5ocjwthwte-1
3510 Modified: bzr:revision-id:v3-trunk0
3511 - 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
3512 1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
3513 1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
3514 1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
3515 1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
3516 1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
3517 1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
3518 1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
3519 1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
3520 1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
3521 1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
3522 1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
3523 1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
3524 1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
3525 1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
3526 1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
3527 1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
3528 1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
3529 1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
3530 1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
3531 1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
3532 1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
3533 1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
3534 1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
3535 1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
3536 1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
3537 1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
3538 1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
3539 1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
3540 1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
3541 1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
3542 1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
3543 1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
3544 1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
3545 1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
3546 1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
3547 1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
3548 1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
3549 1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
3550 1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
3551 1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
3552 1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
3553 1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
3554 1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
3555 1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
3556 1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
3557 1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
3558 1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
3559 1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
3560 1176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
3561 1177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
3562 1178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
3563 1179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
3564 1180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
3565 1181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
3566 1182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
3567 1183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
3568 1184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
3569 1185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
3570 1186 stbuehler@web.de-20081001200802-l5og517etnneitk0
3571 1188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
3572 1189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
3573 1191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
3574 1192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
3575 1193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
3576 1195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
3577 1196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
3578 1197 stbuehler@web.de-20081016121114-65quosenmso8frf8
3579 1198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
3580 1199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
3581 1200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
3582 1201 stbuehler@web.de-20081205233903-708beaujtf26gprx
3583 1202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
3584 1203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
3585 1204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
3586 1205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
3587 1206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
3588 1208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
3589 1209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
3590 1210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
3591 1211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
3592 1212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
3593 1213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
3594 1214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
3595 1215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
3596 1216 stbuehler@web.de-20090205105134-6i5key9439wspueq
3597 1217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
3598 1218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3
3599 1219 stbuehler@web.de-20090205215425-vicbc6hzb3at7gj9
3600 1220 stbuehler@web.de-20090205220741-vqz9l1eui3dwnulq
3601 1221 stbuehler@web.de-20090205222705-8179v6jkv2x38l70
3602 1222 stbuehler@web.de-20090210194631-6epujtpen9xfxx5j
3603 1223 stbuehler@web.de-20090216134207-fg99ikt1ds21hx25
3604 1224 stbuehler@web.de-20090217085833-9g5c7j7zdylvezl5
3605 1225 stbuehler@web.de-20090217133414-y80hydn9raqgkgto
3606 1226 stbuehler@web.de-20090217224447-ve7ns45c9otbgz9h
3607 1227 stbuehler@web.de-20090219130703-117t93t4hr4j0e8d
3608 1228 stbuehler@web.de-20090219130728-m8nui64vin0w95b2
3609 1229 stbuehler@web.de-20090219131550-exi19tbqyd8fpa0d
3610 1230 stbuehler@web.de-20090224133046-toewpee0ybw5tuay
3611 1231 stbuehler@web.de-20090228205351-yqjhutdqf30jr66o
3612 1232 stbuehler@web.de-20090228213824-gnwuf6by8705g6zk
3613 1233 stbuehler@web.de-20090303100525-kamra70ocxpji0l5
3614 1234 stbuehler@web.de-20090303100929-p4w2995k61yhxws2
3615 1235 stbuehler@web.de-20090307135056-02q8f6l1e5jehu9y
3616 1236 stbuehler@web.de-20090307135805-z488kad68sgcjtzz
3618 + 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
3619 1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
3620 1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
3621 1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
3622 1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
3623 1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
3624 1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
3625 1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
3626 1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
3627 1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
3628 1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
3629 1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
3630 1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
3631 1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
3632 1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
3633 1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
3634 1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
3635 1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
3636 1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
3637 1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
3638 1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
3639 1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
3640 1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
3641 1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
3642 1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
3643 1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
3644 1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
3645 1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
3646 1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
3647 1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
3648 1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
3649 1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
3650 1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
3651 1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
3652 1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
3653 1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
3654 1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
3655 1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
3656 1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
3657 1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
3658 1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
3659 1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
3660 1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
3661 1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
3662 1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
3663 1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
3664 1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
3665 1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
3666 1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
3667 1176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
3668 1177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
3669 1178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
3670 1179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
3671 1180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
3672 1181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
3673 1182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
3674 1183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
3675 1184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
3676 1185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
3677 1186 stbuehler@web.de-20081001200802-l5og517etnneitk0
3678 1188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
3679 1189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
3680 1191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
3681 1192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
3682 1193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
3683 1195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
3684 1196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
3685 1197 stbuehler@web.de-20081016121114-65quosenmso8frf8
3686 1198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
3687 1199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
3688 1200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
3689 1201 stbuehler@web.de-20081205233903-708beaujtf26gprx
3690 1202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
3691 1203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
3692 1204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
3693 1205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
3694 1206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
3695 1208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
3696 1209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
3697 1210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
3698 1211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
3699 1212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
3700 1213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
3701 1214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
3702 1215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
3703 1216 stbuehler@web.de-20090205105134-6i5key9439wspueq
3704 1217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
3705 1218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3
3706 1219 stbuehler@web.de-20090205215425-vicbc6hzb3at7gj9
3707 1220 stbuehler@web.de-20090205220741-vqz9l1eui3dwnulq
3708 1221 stbuehler@web.de-20090205222705-8179v6jkv2x38l70
3709 1222 stbuehler@web.de-20090210194631-6epujtpen9xfxx5j
3710 1223 stbuehler@web.de-20090216134207-fg99ikt1ds21hx25
3711 1224 stbuehler@web.de-20090217085833-9g5c7j7zdylvezl5
3712 1225 stbuehler@web.de-20090217133414-y80hydn9raqgkgto
3713 1226 stbuehler@web.de-20090217224447-ve7ns45c9otbgz9h
3714 1227 stbuehler@web.de-20090219130703-117t93t4hr4j0e8d
3715 1228 stbuehler@web.de-20090219130728-m8nui64vin0w95b2
3716 1229 stbuehler@web.de-20090219131550-exi19tbqyd8fpa0d
3717 1230 stbuehler@web.de-20090224133046-toewpee0ybw5tuay
3718 1231 stbuehler@web.de-20090228205351-yqjhutdqf30jr66o
3719 1232 stbuehler@web.de-20090228213824-gnwuf6by8705g6zk
3720 1233 stbuehler@web.de-20090303100525-kamra70ocxpji0l5
3721 1234 stbuehler@web.de-20090303100929-p4w2995k61yhxws2
3722 1235 stbuehler@web.de-20090307135056-02q8f6l1e5jehu9y
3723 1236 stbuehler@web.de-20090307135805-z488kad68sgcjtzz
3724 1237 stbuehler@web.de-20090307154555-xybvl7sxrha6vhds
3725 1238 stbuehler@web.de-20090307204326-10m0681831yvhi3k
3726 1239 stbuehler@web.de-20090307204846-seq3cmzn6dy9927i
3727 1240 stbuehler@web.de-20090307205519-ha3s58fcum106yl0
3728 1241 stbuehler@web.de-20090307210432-jdlv5pp9m519vyv2