1 Index: cmake/LighttpdMacros.cmake
2 ===================================================================
3 --- cmake/LighttpdMacros.cmake (.../tags/lighttpd-1.4.20) (revision 0)
4 +++ cmake/LighttpdMacros.cmake (.../branches/lighttpd-1.4.x) (revision 2389)
6 +## our modules are without the "lib" prefix
8 +MACRO(ADD_AND_INSTALL_LIBRARY LIBNAME SRCFILES)
10 + ADD_LIBRARY(${LIBNAME} STATIC ${SRCFILES})
11 + TARGET_LINK_LIBRARIES(lighttpd ${LIBNAME})
13 + ADD_LIBRARY(${LIBNAME} SHARED ${SRCFILES})
14 + SET(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} ${LIBNAME})
15 + ## Windows likes to link it this way back to app!
17 + SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES LINK_FLAGS lighttpd.lib)
21 + SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
24 +ENDMACRO(ADD_AND_INSTALL_LIBRARY)
26 +MACRO(LEMON_PARSER SRCFILE)
27 + GET_FILENAME_COMPONENT(SRCBASE ${SRCFILE} NAME_WE)
28 + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.c ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.h
29 + COMMAND ${CMAKE_BINARY_DIR}/build/lemon
30 + ARGS -q ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
31 + DEPENDS ${CMAKE_BINARY_DIR}/build/lemon ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
32 + COMMENT "Generating ${SRCBASE}.c from ${SRCFILE}"
34 +ENDMACRO(LEMON_PARSER)
36 +MACRO(ADD_TARGET_PROPERTIES _target _name)
38 + FOREACH(_prop ${ARGN})
39 + SET(_properties "${_properties} ${_prop}")
41 + GET_TARGET_PROPERTY(_old_properties ${_target} ${_name})
42 + MESSAGE("adding property to ${_target} ${_name}:" ${_properties})
43 + IF(NOT _old_properties)
44 + # in case it's NOTFOUND
45 + SET(_old_properties)
46 + ENDIF(NOT _old_properties)
47 + SET_TARGET_PROPERTIES(${_target} PROPERTIES ${_name} "${_old_properties} ${_properties}")
48 +ENDMACRO(ADD_TARGET_PROPERTIES)
50 ===================================================================
51 Index: src/configfile-glue.c
52 ===================================================================
53 --- src/configfile-glue.c (.../tags/lighttpd-1.4.20) (revision 2389)
54 +++ src/configfile-glue.c (.../branches/lighttpd-1.4.x) (revision 2389)
63 data_string *ds = (data_string *)du;
65 + /* If the value came from an environment variable, then it is a
66 + * data_string, although it may contain a number in ASCII
67 + * decimal format. We try to interpret the string as a decimal
68 + * short before giving up, in order to support setting numeric
69 + * values with environment variables (eg, port number).
71 + if (ds->value->ptr && *ds->value->ptr) {
73 + long l = strtol(ds->value->ptr, &e, 10);
74 + if (e != ds->value->ptr && !*e && l >=0 && l <= 65535) {
75 + *((unsigned short *)(cv[i].destination)) = l;
81 log_error_write(srv, __FILE__, __LINE__, "ssb", "got a string but expected a short:", cv[i].key, ds->value);
85 ===================================================================
86 --- src/mod_cgi.c (.../tags/lighttpd-1.4.20) (revision 2389)
87 +++ src/mod_cgi.c (.../branches/lighttpd-1.4.x) (revision 2389)
90 cgi_env_add(&env, CONST_STR_LEN("SERVER_PORT"), buf, strlen(buf));
92 + switch (srv_sock->addr.plain.sa_family) {
94 - s = inet_ntop(srv_sock->addr.plain.sa_family,
95 - srv_sock->addr.plain.sa_family == AF_INET6 ?
96 - (const void *) &(srv_sock->addr.ipv6.sin6_addr) :
97 - (const void *) &(srv_sock->addr.ipv4.sin_addr),
100 + s = inet_ntop(srv_sock->addr.plain.sa_family,
101 + (const void *) &(srv_sock->addr.ipv6.sin6_addr),
105 + s = inet_ntop(srv_sock->addr.plain.sa_family,
106 + (const void *) &(srv_sock->addr.ipv4.sin_addr),
110 - s = inet_ntoa(srv_sock->addr.ipv4.sin_addr);
112 + s = inet_ntoa(srv_sock->addr.ipv4.sin_addr);
119 cgi_env_add(&env, CONST_STR_LEN("SERVER_ADDR"), s, strlen(s));
121 s = get_http_method_name(con->request.http_method);
122 @@ -848,15 +860,27 @@
126 + switch (con->dst_addr.plain.sa_family) {
128 - s = inet_ntop(con->dst_addr.plain.sa_family,
129 - con->dst_addr.plain.sa_family == AF_INET6 ?
130 - (const void *) &(con->dst_addr.ipv6.sin6_addr) :
131 - (const void *) &(con->dst_addr.ipv4.sin_addr),
134 + s = inet_ntop(con->dst_addr.plain.sa_family,
135 + (const void *) &(con->dst_addr.ipv6.sin6_addr),
139 + s = inet_ntop(con->dst_addr.plain.sa_family,
140 + (const void *) &(con->dst_addr.ipv4.sin_addr),
144 - s = inet_ntoa(con->dst_addr.ipv4.sin_addr);
146 + s = inet_ntoa(con->dst_addr.ipv4.sin_addr);
153 cgi_env_add(&env, CONST_STR_LEN("REMOTE_ADDR"), s, strlen(s));
157 ===================================================================
158 --- src/base.h (.../tags/lighttpd-1.4.20) (revision 2389)
159 +++ src/base.h (.../branches/lighttpd-1.4.x) (revision 2389)
163 unsigned short enable_cores;
164 + unsigned short reject_expect_100_with_417;
168 Index: src/mod_rewrite.c
169 ===================================================================
170 --- src/mod_rewrite.c (.../tags/lighttpd-1.4.20) (revision 2389)
171 +++ src/mod_rewrite.c (.../branches/lighttpd-1.4.x) (revision 2389)
174 if (!p->conf.rewrite) return HANDLER_GO_ON;
176 - buffer_copy_string_buffer(p->match_buf, con->uri.path);
177 - if (con->uri.query->used > 0) {
178 - buffer_append_string_len(p->match_buf, CONST_STR_LEN("?"));
179 - buffer_append_string_buffer(p->match_buf, con->uri.query);
181 + buffer_copy_string_buffer(p->match_buf, con->request.uri);
183 for (i = 0; i < p->conf.rewrite->used; i++) {
185 Index: src/connections.c
186 ===================================================================
187 --- src/connections.c (.../tags/lighttpd-1.4.20) (revision 2389)
188 +++ src/connections.c (.../branches/lighttpd-1.4.x) (revision 2389)
189 @@ -330,15 +330,13 @@
190 buffer_prepare_copy(b, 4 * 1024);
191 len = recv(con->fd, b->ptr, b->size - 1, 0);
193 - if (ioctl(con->fd, FIONREAD, &toread)) {
194 - log_error_write(srv, __FILE__, __LINE__, "sd",
195 - "unexpected end-of-file:",
198 + if (ioctl(con->fd, FIONREAD, &toread) || toread == 0) {
199 + b = chunkqueue_get_append_buffer(con->read_queue);
200 + buffer_prepare_copy(b, 4 * 1024);
202 + b = chunkqueue_get_append_buffer(con->read_queue);
203 + buffer_prepare_copy(b, toread + 1);
205 - b = chunkqueue_get_append_buffer(con->read_queue);
206 - buffer_prepare_copy(b, toread + 1);
208 len = read(con->fd, b->ptr, b->size - 1);
211 @@ -1066,6 +1064,9 @@
212 if (dst_c->file.fd == -1) {
213 /* this should not happen as we cache the fd, but you never know */
214 dst_c->file.fd = open(dst_c->file.name->ptr, O_WRONLY | O_APPEND);
216 + fcntl(dst_c->file.fd, F_SETFD, FD_CLOEXEC);
220 /* the chunk is too large now, close it */
221 Index: src/mod_alias.c
222 ===================================================================
223 --- src/mod_alias.c (.../tags/lighttpd-1.4.20) (revision 2389)
224 +++ src/mod_alias.c (.../branches/lighttpd-1.4.x) (revision 2389)
227 /* ok, they have same prefix. check position */
228 if (a->sorted[j] < a->sorted[k]) {
229 - fprintf(stderr, "url.alias: `%s' will never match as `%s' matched first\n",
232 + log_error_write(srv, __FILE__, __LINE__, "SBSBS",
233 + "url.alias: `", key, "' will never match as `", prefix, "' matched first");
234 return HANDLER_ERROR;
237 Index: src/configfile.c
238 ===================================================================
239 --- src/configfile.c (.../tags/lighttpd-1.4.20) (revision 2389)
240 +++ src/configfile.c (.../branches/lighttpd-1.4.x) (revision 2389)
242 { "etag.use-inode", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
243 { "etag.use-mtime", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
244 { "etag.use-size", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
245 + { "server.reject-expect-100-with-417", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 52 */
246 { "server.host", "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
247 { "server.docroot", "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
248 { "server.virtual-root", "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
251 cv[43].destination = &(srv->srvconf.max_conns);
252 cv[12].destination = &(srv->srvconf.max_request_size);
253 + cv[52].destination = &(srv->srvconf.reject_expect_100_with_417);
254 srv->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
256 assert(srv->config_storage);
258 s->max_write_idle = 360;
261 - s->ssl_use_sslv2 = 1;
262 + s->ssl_use_sslv2 = 0;
265 s->follow_symlink = 1;
269 int config_parse_cmd(server *srv, config_t *context, const char *cmd) {
270 - proc_handler_t proc;
275 chdir(context->basedir->ptr);
278 - if (0 != proc_open_buffer(&proc, cmd, NULL, out, NULL)) {
279 + if (0 != proc_open_buffer(cmd, NULL, out, NULL)) {
280 log_error_write(srv, __FILE__, __LINE__, "sbss",
281 "opening", source, "failed:", strerror(errno));
283 Index: src/mod_trigger_b4_dl.c
284 ===================================================================
285 --- src/mod_trigger_b4_dl.c (.../tags/lighttpd-1.4.20) (revision 2389)
286 +++ src/mod_trigger_b4_dl.c (.../branches/lighttpd-1.4.x) (revision 2389)
296 return HANDLER_ERROR;
299 + fcntl(gdbm_fdesc(s->db), F_SETFD, FD_CLOEXEC);
303 #if defined(HAVE_PCRE_H)
304 Index: src/mod_mysql_vhost.c
305 ===================================================================
306 --- src/mod_mysql_vhost.c (.../tags/lighttpd-1.4.20) (revision 2389)
307 +++ src/mod_mysql_vhost.c (.../branches/lighttpd-1.4.x) (revision 2389)
309 if (!(buffer_is_empty(s->myuser) ||
310 buffer_is_empty(s->mydb))) {
311 my_bool reconnect = 1;
314 if (NULL == (s->mysql = mysql_init(NULL))) {
315 log_error_write(srv, __FILE__, __LINE__, "s", "mysql_init() failed, exiting...");
316 @@ -267,19 +266,27 @@
317 return HANDLER_ERROR;
322 /* set close_on_exec for mysql the hard way */
323 /* Note: this only works as it is done during startup, */
324 /* otherwise we cannot be sure that mysql is fd i-1 */
325 - if (-1 == (fd = open("/dev/null", 0))) {
327 + if (-1 != (fd = open("/dev/null", 0))) {
330 fcntl(fd-1, F_SETFD, FD_CLOEXEC);
336 + fcntl(s->mysql->net.fd, F_SETFD, FD_CLOEXEC);
344 - return HANDLER_GO_ON;
345 + return HANDLER_GO_ON;
350 ===================================================================
351 --- src/request.c (.../tags/lighttpd-1.4.20) (revision 2389)
352 +++ src/request.c (.../branches/lighttpd-1.4.x) (revision 2389)
353 @@ -894,11 +894,12 @@
357 - con->http_status = 417;
358 - con->keep_alive = 0;
360 - array_insert_unique(con->request.headers, (data_unset *)ds);
362 + if (srv->srvconf.reject_expect_100_with_417 && 0 == buffer_caseless_compare(CONST_BUF_LEN(ds->value), CONST_STR_LEN("100-continue"))) {
363 + con->http_status = 417;
364 + con->keep_alive = 0;
365 + array_insert_unique(con->request.headers, (data_unset *)ds);
368 } else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Host")))) {
369 if (!con->request.http_host) {
370 con->request.http_host = ds->value;
371 Index: src/inet_ntop_cache.c
372 ===================================================================
373 --- src/inet_ntop_cache.c (.../tags/lighttpd-1.4.20) (revision 2389)
374 +++ src/inet_ntop_cache.c (.../branches/lighttpd-1.4.x) (revision 2389)
378 for (i = 0; i < INET_NTOP_CACHE_MAX; i++) {
379 - if (srv->inet_ntop_cache[i].ts != 0) {
380 + if (srv->inet_ntop_cache[i].ts != 0 && srv->inet_ntop_cache[i].family == addr->plain.sa_family) {
381 if (srv->inet_ntop_cache[i].family == AF_INET6 &&
382 0 == memcmp(srv->inet_ntop_cache[i].addr.ipv6.s6_addr, addr->ipv6.sin6_addr.s6_addr, 16)) {
383 /* IPv6 found in cache */
384 Index: src/mod_rrdtool.c
385 ===================================================================
386 --- src/mod_rrdtool.c (.../tags/lighttpd-1.4.20) (revision 2389)
387 +++ src/mod_rrdtool.c (.../branches/lighttpd-1.4.x) (revision 2389)
389 p->read_fd = from_rrdtool_fds[0];
390 p->rrdtool_pid = pid;
393 + fcntl(p->write_fd, F_SETFD, FD_CLOEXEC);
394 + fcntl(p->read_fd, F_SETFD, FD_CLOEXEC);
400 Index: src/response.c
401 ===================================================================
402 --- src/response.c (.../tags/lighttpd-1.4.20) (revision 2389)
403 +++ src/response.c (.../branches/lighttpd-1.4.x) (revision 2389)
405 buffer_append_string(b, get_http_status_name(con->http_status));
407 if (con->request.http_version != HTTP_VERSION_1_1 || con->keep_alive == 0) {
408 - buffer_append_string_len(b, CONST_STR_LEN("\r\nConnection: "));
409 if (con->keep_alive) {
410 - buffer_append_string_len(b, CONST_STR_LEN("keep-alive"));
411 + response_header_overwrite(srv, con, CONST_STR_LEN("Connection"), CONST_STR_LEN("keep-alive"));
413 - buffer_append_string_len(b, CONST_STR_LEN("close"));
414 + response_header_overwrite(srv, con, CONST_STR_LEN("Connection"), CONST_STR_LEN("close"));
418 if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
419 - buffer_append_string_len(b, CONST_STR_LEN("\r\nTransfer-Encoding: chunked"));
420 + response_header_overwrite(srv, con, CONST_STR_LEN("Transfer-Encoding"), CONST_STR_LEN("chunked"));
432 + * - based on the raw URL
436 + switch(r = plugins_call_handle_uri_raw(srv, con)) {
437 + case HANDLER_GO_ON:
439 + case HANDLER_FINISHED:
440 + case HANDLER_COMEBACK:
441 + case HANDLER_WAIT_FOR_EVENT:
442 + case HANDLER_ERROR:
445 + log_error_write(srv, __FILE__, __LINE__, "sd", "handle_uri_raw: unknown return value", r);
451 * - decode url-encodings (e.g. %20 -> ' ')
457 if (con->request.http_method == HTTP_METHOD_OPTIONS &&
458 con->uri.path_raw->ptr[0] == '*' && con->uri.path_raw->ptr[1] == '\0') {
460 @@ -255,32 +276,10 @@
461 log_error_write(srv, __FILE__, __LINE__, "sb", "URI-path : ", con->uri.path);
469 - * - based on the raw URL
473 - switch(r = plugins_call_handle_uri_raw(srv, con)) {
474 - case HANDLER_GO_ON:
476 - case HANDLER_FINISHED:
477 - case HANDLER_COMEBACK:
478 - case HANDLER_WAIT_FOR_EVENT:
479 - case HANDLER_ERROR:
482 - log_error_write(srv, __FILE__, __LINE__, "sd", "handle_uri_raw: unknown return value", r);
490 * - based on the clean URL
494 ===================================================================
495 --- src/buffer.c (.../tags/lighttpd-1.4.20) (revision 2389)
496 +++ src/buffer.c (.../branches/lighttpd-1.4.x) (revision 2389)
500 if (src->used == 0) {
505 return buffer_copy_string_len(b, src->ptr, src->used - 1);
507 if (!s || !b) return -1;
510 + if (s_len > maxlen) s_len = maxlen;
511 buffer_prepare_append(b, maxlen + 1);
514 Index: src/mod_simple_vhost.c
515 ===================================================================
516 --- src/mod_simple_vhost.c (.../tags/lighttpd-1.4.20) (revision 2389)
517 +++ src/mod_simple_vhost.c (.../branches/lighttpd-1.4.x) (revision 2389)
519 return HANDLER_GO_ON;
521 buffer_copy_string_buffer(con->server_name, p->conf.default_host);
522 + /* do not cache default host */
523 + return HANDLER_GO_ON;
526 buffer_copy_string_buffer(con->server_name, con->uri.authority);
527 Index: src/mod_proxy.c
528 ===================================================================
529 --- src/mod_proxy.c (.../tags/lighttpd-1.4.20) (revision 2389)
530 +++ src/mod_proxy.c (.../branches/lighttpd-1.4.x) (revision 2389)
533 if (ds->value->used && ds->key->used) {
534 if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Connection"))) continue;
535 + if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Proxy-Connection"))) continue;
537 buffer_append_string_buffer(b, ds->key);
538 buffer_append_string_len(b, CONST_STR_LEN(": "));
540 buffer_prepare_append(hctx->response, b + 1);
541 hctx->response->used = 1;
543 - buffer_prepare_append(hctx->response, hctx->response->used + b);
544 + buffer_prepare_append(hctx->response, b);
547 if (-1 == (r = read(hctx->fd, hctx->response->ptr + hctx->response->used - 1, b))) {
548 @@ -1198,7 +1199,8 @@
549 host = (data_proxy *)extension->value->data[0];
551 /* Use last_used_ndx from first host in list */
552 - k = ndx = host->last_used_ndx;
553 + k = host->last_used_ndx;
554 + ndx = k + 1; /* use next host after the last one */
555 if (ndx < 0) ndx = 0;
557 /* Search first active host after last_used_ndx */
558 Index: src/config.h.cmake
559 ===================================================================
560 --- src/config.h.cmake (.../tags/lighttpd-1.4.20) (revision 0)
561 +++ src/config.h.cmake (.../branches/lighttpd-1.4.x) (revision 2389)
564 + CMake autogenerated config.h file. Do not edit!
567 +/* Package details */
568 +#define LIGHTTPD_VERSION_ID ${LIGHTTPD_VERSION_ID}
569 +#define PACKAGE_NAME "${PACKAGE_NAME}"
570 +#define PACKAGE_VERSION "${PACKAGE_VERSION}"
571 +#define PACKAGE_BUILD_DATE "${PACKAGE_BUILD_DATE}"
572 +#define LIBRARY_DIR "${LIGHTTPD_LIBRARY_DIR}"
575 +#cmakedefine HAVE_SYS_DEVPOLL_H
576 +#cmakedefine HAVE_SYS_EPOLL_H
577 +#cmakedefine HAVE_SYS_EVENT_H
578 +#cmakedefine HAVE_SYS_MMAN_H
579 +#cmakedefine HAVE_SYS_POLL_H
580 +#cmakedefine HAVE_SYS_PORT_H
581 +#cmakedefine HAVE_SYS_PRCTL_H
582 +#cmakedefine HAVE_SYS_RESOURCE_H
583 +#cmakedefine HAVE_SYS_SENDFILE_H
584 +#cmakedefine HAVE_SYS_SELECT_H
585 +#cmakedefine HAVE_SYS_SYSLIMITS_H
586 +#cmakedefine HAVE_SYS_TYPES_H
587 +#cmakedefine HAVE_SYS_UIO_H
588 +#cmakedefine HAVE_SYS_UN_H
589 +#cmakedefine HAVE_SYS_WAIT_H
590 +#cmakedefine HAVE_SYS_TIME_H
591 +#cmakedefine HAVE_UNISTD_H
592 +#cmakedefine HAVE_PTHREAD_H
593 +#cmakedefine HAVE_INET_ATON
594 +#cmakedefine HAVE_IPV6
597 +#cmakedefine HAVE_ATTR_ATTRIBUTES_H
598 +#cmakedefine HAVE_XATTR
601 +#cmakedefine HAVE_MYSQL_H
602 +#cmakedefine HAVE_MYSQL
605 +#cmakedefine HAVE_OPENSSL_SSL_H
606 +#cmakedefine HAVE_LIBCRYPTO
607 +#cmakedefine OPENSSL_NO_KRB5
608 +#cmakedefine HAVE_LIBSSL
611 +#cmakedefine HAVE_BZLIB_H
612 +#cmakedefine HAVE_LIBBZ2
615 +#cmakedefine HAVE_FAM_H
616 +#cmakedefine HAVE_FAMNOEXISTS
619 +#cmakedefine HAVE_GETOPT_H
621 +#cmakedefine HAVE_INTTYPES_H
624 +#cmakedefine HAVE_LDAP_H
625 +#cmakedefine HAVE_LIBLDAP
626 +#cmakedefine HAVE_LBER_H
627 +#cmakedefine HAVE_LIBLBER
628 +#cmakedefine LDAP_DEPRECATED 1
631 +#cmakedefine HAVE_LIBXML_H
632 +#cmakedefine HAVE_LIBXML
635 +#cmakedefine HAVE_PCRE_H
636 +#cmakedefine HAVE_LIBPCRE
638 +#cmakedefine HAVE_POLL_H
639 +#cmakedefine HAVE_PWD_H
642 +#cmakedefine HAVE_SQLITE3_H
643 +#cmakedefine HAVE_LIBPCRE
645 +#cmakedefine HAVE_STDDEF_H
646 +#cmakedefine HAVE_STDINT_H
647 +#cmakedefine HAVE_SYSLOG_H
650 +#cmakedefine HAVE_UUID_UUID_H
651 +#cmakedefine HAVE_LIBUUID
654 +#cmakedefine HAVE_ZLIB_H
655 +#cmakedefine HAVE_LIBZ
658 +#cmakedefine HAVE_LUA_H
659 +#cmakedefine HAVE_LIBLUA
662 +#cmakedefine HAVE_GDBM_H
663 +#cmakedefine HAVE_GDBM
666 +#cmakedefine HAVE_MEMCACHE_H
669 +#cmakedefine HAVE_INOTIFY_INIT
670 +#cmakedefine HAVE_SYS_INOTIFY_H
673 +#cmakedefine HAVE_SOCKLEN_T
674 +#cmakedefine SIZEOF_LONG ${SIZEOF_LONG}
675 +#cmakedefine SIZEOF_OFF_T ${SIZEOF_OFF_T}
678 +#cmakedefine HAVE_CHROOT
679 +#cmakedefine HAVE_CRYPT
680 +#cmakedefine HAVE_EPOLL_CTL
681 +#cmakedefine HAVE_FORK
682 +#cmakedefine HAVE_GETRLIMIT
683 +#cmakedefine HAVE_GETUID
684 +#cmakedefine HAVE_GMTIME_R
685 +#cmakedefine HAVE_INET_NTOP
686 +#cmakedefine HAVE_KQUEUE
687 +#cmakedefine HAVE_LOCALTIME_R
688 +#cmakedefine HAVE_LSTAT
689 +#cmakedefine HAVE_MADVISE
690 +#cmakedefine HAVE_MEMCPY
691 +#cmakedefine HAVE_MEMSET
692 +#cmakedefine HAVE_MMAP
693 +#cmakedefine HAVE_PATHCONF
694 +#cmakedefine HAVE_POLL
695 +#cmakedefine HAVE_PORT_CREATE
696 +#cmakedefine HAVE_PRCTL
697 +#cmakedefine HAVE_PREAD
698 +#cmakedefine HAVE_POSIX_FADVISE
699 +#cmakedefine HAVE_SELECT
700 +#cmakedefine HAVE_SENDFILE
701 +#cmakedefine HAVE_SEND_FILE
702 +#cmakedefine HAVE_SENDFILE64
703 +#cmakedefine HAVE_SENDFILEV
704 +#cmakedefine HAVE_SIGACTION
705 +#cmakedefine HAVE_SIGNAL
706 +#cmakedefine HAVE_SIGTIMEDWAIT
707 +#cmakedefine HAVE_STRPTIME
708 +#cmakedefine HAVE_SYSLOG
709 +#cmakedefine HAVE_WRITEV
712 +#cmakedefine HAVE_CRYPT_H
713 +#cmakedefine HAVE_LIBCRYPT
716 +#cmakedefine HAVE_FASTCGI_H
717 +#cmakedefine HAVE_FASTCGI_FASTCGI_H
719 +#cmakedefine LIGHTTPD_STATIC
720 Index: src/network_freebsd_sendfile.c
721 ===================================================================
722 --- src/network_freebsd_sendfile.c (.../tags/lighttpd-1.4.20) (revision 2389)
723 +++ src/network_freebsd_sendfile.c (.../branches/lighttpd-1.4.x) (revision 2389)
728 + r = 0; /* try again later */
733 log_error_write(srv, __FILE__, __LINE__, "ssd", "sendfile: ", strerror(errno), errno);
738 - if (r == 0 && (errno != EAGAIN && errno != EINTR)) {
739 - int oerrno = errno;
740 + } else if (r == 0) {
741 /* We got an event to write but we wrote nothing
743 * - the file shrinked -> error
746 if (offset >= sce->st.st_size) {
747 /* file shrinked, close the connection */
757 Index: src/http_auth.c
758 ===================================================================
759 --- src/http_auth.c (.../tags/lighttpd-1.4.20) (revision 2389)
760 +++ src/http_auth.c (.../branches/lighttpd-1.4.x) (revision 2389)
763 static const char base64_pad = '=';
765 +/* "A-Z a-z 0-9 + /" maps to 0-63 */
766 static const short base64_reverse_table[256] = {
767 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
768 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
769 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
770 - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
771 - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
772 - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
773 - -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
774 - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
775 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
776 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
777 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
778 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
779 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
780 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
781 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
782 +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
783 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00 - 0x0F */
784 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x10 - 0x1F */
785 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, /* 0x20 - 0x2F */
786 + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, /* 0x30 - 0x3F */
787 + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 0x40 - 0x4F */
788 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, /* 0x50 - 0x5F */
789 + -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, /* 0x60 - 0x6F */
790 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, /* 0x70 - 0x7F */
791 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x80 - 0x8F */
792 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x90 - 0x9F */
793 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xA0 - 0xAF */
794 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xB0 - 0xBF */
795 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xC0 - 0xCF */
796 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xD0 - 0xDF */
797 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xE0 - 0xEF */
798 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xF0 - 0xFF */
804 } else if (p->conf.auth_backend == AUTH_BACKEND_LDAP) {
808 LDAPMessage *lm, *first;
811 @@ -742,56 +745,45 @@
812 buffer_append_string_buffer(p->ldap_filter, username);
813 buffer_append_string_buffer(p->ldap_filter, p->conf.ldap_filter_post);
817 - if (p->conf.ldap == NULL ||
818 - LDAP_SUCCESS != (ret = ldap_search_s(p->conf.ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
819 - /* try again if ldap was only temporary down */
820 - if (p->conf.ldap == NULL || ret != LDAP_SERVER_DOWN || LDAP_SUCCESS != (ret = ldap_search_s(p->conf.ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
821 - if (auth_ldap_init(srv, &p->conf) != HANDLER_GO_ON)
822 + if (p->anon_conf->ldap == NULL ||
823 + LDAP_SUCCESS != (ret = ldap_search_s(p->anon_conf->ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
825 + /* try again; the ldap library sometimes fails for the first call but reconnects */
826 + if (p->anon_conf->ldap == NULL || ret != LDAP_SERVER_DOWN ||
827 + LDAP_SUCCESS != (ret = ldap_search_s(p->anon_conf->ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
829 + if (auth_ldap_init(srv, p->anon_conf) != HANDLER_GO_ON)
832 - ldap = p->conf.ldap; /* save temporary ldap connection (TODO: redo ldap) */
833 - if (LDAP_SUCCESS != (ret = ldap_search_s(p->conf.ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
834 + if (p->anon_conf->ldap == NULL ||
835 + LDAP_SUCCESS != (ret = ldap_search_s(p->anon_conf->ldap, p->conf.auth_ldap_basedn->ptr, LDAP_SCOPE_SUBTREE, p->ldap_filter->ptr, attrs, 0, &lm))) {
836 log_error_write(srv, __FILE__, __LINE__, "sssb",
837 "ldap:", ldap_err2string(ret), "filter:", p->ldap_filter);
838 - /* destroy temporary ldap connection (TODO: redo ldap) */
839 - ldap_unbind_s(ldap);
845 - if (NULL == (first = ldap_first_entry(p->conf.ldap, lm))) {
846 - /* No matching entry is not an error */
847 - /* log_error_write(srv, __FILE__, __LINE__, "s", "ldap ..."); */
848 + if (NULL == (first = ldap_first_entry(p->anon_conf->ldap, lm))) {
849 + log_error_write(srv, __FILE__, __LINE__, "s", "ldap ...");
853 - /* destroy temporary ldap connection (TODO: redo ldap) */
854 - if (NULL != ldap) {
855 - ldap_unbind_s(ldap);
860 - if (NULL == (dn = ldap_get_dn(p->conf.ldap, first))) {
861 - log_error_write(srv, __FILE__, __LINE__, "s", "ldap: ldap_get_dn failed");
862 + if (NULL == (dn = ldap_get_dn(p->anon_conf->ldap, first))) {
863 + log_error_write(srv, __FILE__, __LINE__, "s", "ldap ...");
867 - /* destroy temporary ldap connection (TODO: redo ldap) */
868 - if (NULL != ldap) {
869 - ldap_unbind_s(ldap);
876 - /* destroy temporary ldap connection (TODO: redo ldap) */
877 - if (NULL != ldap) {
878 - ldap_unbind_s(ldap);
882 if (NULL == (ldap = ldap_init(p->conf.auth_ldap_hostname->ptr, LDAP_PORT))) {
883 Index: src/mod_redirect.c
884 ===================================================================
885 --- src/mod_redirect.c (.../tags/lighttpd-1.4.20) (revision 2389)
886 +++ src/mod_redirect.c (.../branches/lighttpd-1.4.x) (revision 2389)
889 mod_redirect_patch_connection(srv, con, p);
891 - buffer_copy_string_buffer(p->match_buf, con->uri.path);
892 - if (con->uri.query->used > 0) {
893 - buffer_append_string_len(p->match_buf, CONST_STR_LEN("?"));
894 - buffer_append_string_buffer(p->match_buf, con->uri.query);
896 + buffer_copy_string_buffer(p->match_buf, con->request.uri);
898 for (i = 0; i < p->conf.redirect->used; i++) {
900 Index: src/http_auth.h
901 ===================================================================
902 --- src/http_auth.h (.../tags/lighttpd-1.4.20) (revision 2389)
903 +++ src/http_auth.h (.../branches/lighttpd-1.4.x) (revision 2389)
906 mod_auth_plugin_config **config_storage;
908 - mod_auth_plugin_config conf; /* this is only used as long as no handler_ctx is setup */
909 + mod_auth_plugin_config conf, *anon_conf; /* this is only used as long as no handler_ctx is setup */
910 } mod_auth_plugin_data;
912 int http_auth_basic_check(server *srv, connection *con, mod_auth_plugin_data *p, array *req, buffer *url, const char *realm_str);
913 Index: src/mod_webdav.c
914 ===================================================================
915 --- src/mod_webdav.c (.../tags/lighttpd-1.4.20) (revision 2389)
916 +++ src/mod_webdav.c (.../branches/lighttpd-1.4.x) (revision 2389)
917 @@ -1026,6 +1026,8 @@
918 if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
919 log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
920 strerror(errno), c->file.name, c->file.fd);
926 @@ -1723,6 +1725,8 @@
927 if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
928 log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
929 strerror(errno), c->file.name, c->file.fd);
933 return HANDLER_ERROR;
935 Index: src/mod_compress.c
936 ===================================================================
937 --- src/mod_compress.c (.../tags/lighttpd-1.4.20) (revision 2389)
938 +++ src/mod_compress.c (.../branches/lighttpd-1.4.x) (revision 2389)
940 buffer *compress_cache_dir;
942 off_t compress_max_filesize; /** max filesize in kb */
943 + int allowed_encodings;
948 { "compress.cache-dir", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
949 { "compress.filetype", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
950 { "compress.max-filesize", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
951 + { "compress.allowed-encodings", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
952 { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
955 @@ -161,15 +163,18 @@
957 for (i = 0; i < srv->config_context->used; i++) {
959 + array *encodings_arr = array_init();
961 s = calloc(1, sizeof(plugin_config));
962 s->compress_cache_dir = buffer_init();
963 s->compress = array_init();
964 s->compress_max_filesize = 0;
965 + s->allowed_encodings = 0;
967 cv[0].destination = s->compress_cache_dir;
968 cv[1].destination = s->compress;
969 cv[2].destination = &(s->compress_max_filesize);
970 + cv[3].destination = encodings_arr; /* temp array for allowed encodings list */
972 p->config_storage[i] = s;
975 return HANDLER_ERROR;
978 + if (encodings_arr->used) {
980 + for (j = 0; j < encodings_arr->used; j++) {
981 + data_string *ds = (data_string *)encodings_arr->data[j];
983 + if (NULL != strstr(ds->value->ptr, "gzip"))
984 + s->allowed_encodings |= HTTP_ACCEPT_ENCODING_GZIP;
985 + if (NULL != strstr(ds->value->ptr, "deflate"))
986 + s->allowed_encodings |= HTTP_ACCEPT_ENCODING_DEFLATE;
988 + if (NULL != strstr(ds->value->ptr, "compress"))
989 + s->allowed_encodings |= HTTP_ACCEPT_ENCODING_COMPRESS;
993 + if (NULL != strstr(ds->value->ptr, "bzip2"))
994 + s->allowed_encodings |= HTTP_ACCEPT_ENCODING_BZIP2;
998 + /* default encodings */
999 + s->allowed_encodings = 0
1001 + | HTTP_ACCEPT_ENCODING_GZIP | HTTP_ACCEPT_ENCODING_DEFLATE
1004 + | HTTP_ACCEPT_ENCODING_BZIP2
1009 + array_free(encodings_arr);
1011 if (!buffer_is_empty(s->compress_cache_dir)) {
1013 mkdir_recursive(s->compress_cache_dir->ptr);
1015 PATCH(compress_cache_dir);
1017 PATCH(compress_max_filesize);
1018 + PATCH(allowed_encodings);
1020 /* skip the first, the global context */
1021 for (i = 1; i < srv->config_context->used; i++) {
1024 } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.max-filesize"))) {
1025 PATCH(compress_max_filesize);
1026 + } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.allowed-encodings"))) {
1027 + PATCH(allowed_encodings);
1034 stat_cache_entry *sce = NULL;
1035 + buffer *mtime = NULL;
1037 if (con->mode != DIRECT || con->http_status) return HANDLER_GO_ON;
1039 @@ -636,8 +678,30 @@
1041 max_fsize = p->conf.compress_max_filesize;
1043 - stat_cache_get_entry(srv, con, con->physical.path, &sce);
1044 + if (con->conf.log_request_handling) {
1045 + log_error_write(srv, __FILE__, __LINE__, "s", "-- handling file as static file");
1048 + if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
1049 + con->http_status = 403;
1051 + log_error_write(srv, __FILE__, __LINE__, "sbsb",
1052 + "not a regular file:", con->uri.path,
1053 + "->", con->physical.path);
1055 + return HANDLER_FINISHED;
1058 + /* we only handle regular files */
1060 + if ((sce->is_symlink == 1) && !con->conf.follow_symlink) {
1061 + return HANDLER_GO_ON;
1064 + if (!S_ISREG(sce->st.st_mode)) {
1065 + return HANDLER_GO_ON;
1068 /* don't compress files that are too large as we need to much time to handle them */
1069 if (max_fsize && (sce->st.st_size >> 10) > max_fsize) return HANDLER_GO_ON;
1071 @@ -668,27 +732,21 @@
1072 if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Accept-Encoding"))) {
1073 int accept_encoding = 0;
1074 char *value = ds->value->ptr;
1075 - int srv_encodings = 0;
1076 int matched_encodings = 0;
1078 /* get client side support encodings */
1080 if (NULL != strstr(value, "gzip")) accept_encoding |= HTTP_ACCEPT_ENCODING_GZIP;
1081 if (NULL != strstr(value, "deflate")) accept_encoding |= HTTP_ACCEPT_ENCODING_DEFLATE;
1082 if (NULL != strstr(value, "compress")) accept_encoding |= HTTP_ACCEPT_ENCODING_COMPRESS;
1085 if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2;
1087 if (NULL != strstr(value, "identity")) accept_encoding |= HTTP_ACCEPT_ENCODING_IDENTITY;
1089 - /* get server side supported ones */
1091 - srv_encodings |= HTTP_ACCEPT_ENCODING_BZIP2;
1094 - srv_encodings |= HTTP_ACCEPT_ENCODING_GZIP;
1095 - srv_encodings |= HTTP_ACCEPT_ENCODING_DEFLATE;
1098 /* find matching entries */
1099 - matched_encodings = accept_encoding & srv_encodings;
1100 + matched_encodings = accept_encoding & p->conf.allowed_encodings;
1102 if (matched_encodings) {
1103 const char *dflt_gzip = "gzip";
1104 @@ -698,6 +756,17 @@
1105 const char *compression_name = NULL;
1106 int compression_type = 0;
1108 + mtime = strftime_cache_get(srv, sce->st.st_mtime);
1110 + /* try matching original etag of uncompressed version */
1111 + etag_mutate(con->physical.etag, sce->etag);
1112 + if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
1113 + response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1114 + response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
1115 + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
1116 + return HANDLER_FINISHED;
1119 /* select best matching encoding */
1120 if (matched_encodings & HTTP_ACCEPT_ENCODING_BZIP2) {
1121 compression_type = HTTP_ACCEPT_ENCODING_BZIP2;
1122 @@ -710,41 +779,34 @@
1123 compression_name = dflt_deflate;
1127 - if (p->conf.compress_cache_dir->used) {
1128 - if (0 == deflate_file_to_file(srv, con, p,
1129 - con->physical.path, sce, compression_type)) {
1131 + /* try matching etag of compressed version */
1132 + buffer_copy_string_buffer(srv->tmp_buf, sce->etag);
1133 + buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN("-"));
1134 + buffer_append_string(srv->tmp_buf, compression_name);
1135 + etag_mutate(con->physical.etag, srv->tmp_buf);
1137 - response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
1139 - mtime = strftime_cache_get(srv, sce->st.st_mtime);
1140 - response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
1142 - etag_mutate(con->physical.etag, sce->etag);
1143 - response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
1145 - response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1147 - return HANDLER_GO_ON;
1149 - } else if (0 == deflate_file_to_buffer(srv, con, p,
1150 - con->physical.path, sce, compression_type)) {
1153 + if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
1154 response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
1156 - mtime = strftime_cache_get(srv, sce->st.st_mtime);
1157 + response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1158 response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
1160 - etag_mutate(con->physical.etag, sce->etag);
1161 response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
1163 - response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1165 return HANDLER_FINISHED;
1170 + if (p->conf.compress_cache_dir->used) {
1171 + if (0 != deflate_file_to_file(srv, con, p, con->physical.path, sce, compression_type))
1172 + return HANDLER_GO_ON;
1174 + if (0 != deflate_file_to_buffer(srv, con, p, con->physical.path, sce, compression_type))
1175 + return HANDLER_GO_ON;
1177 + response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name));
1178 + response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
1179 + response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
1180 + response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type));
1181 + /* let mod_staticfile handle the cached compressed files, physical path was modified */
1182 + return p->conf.compress_cache_dir->used ? HANDLER_GO_ON : HANDLER_FINISHED;
1186 Index: src/spawn-fcgi.c
1187 ===================================================================
1188 --- src/spawn-fcgi.c (.../tags/lighttpd-1.4.20) (revision 2389)
1189 +++ src/spawn-fcgi.c (.../branches/lighttpd-1.4.x) (revision 2389)
1194 - memset(&fcgi_addr, 0, sizeof(fcgi_addr));
1195 + memset(&fcgi_addr_un, 0, sizeof(fcgi_addr_un));
1197 fcgi_addr_un.sun_family = AF_UNIX;
1198 strcpy(fcgi_addr_un.sun_path, unixsocket);
1200 socket_type = AF_UNIX;
1201 fcgi_addr = (struct sockaddr *) &fcgi_addr_un;
1203 + memset(&fcgi_addr_in, 0, sizeof(fcgi_addr_in));
1204 fcgi_addr_in.sin_family = AF_INET;
1205 - if (addr != NULL) {
1206 - fcgi_addr_in.sin_addr.s_addr = inet_addr(addr);
1208 - fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
1210 + if (addr != NULL) {
1211 + fcgi_addr_in.sin_addr.s_addr = inet_addr(addr);
1213 + fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
1215 fcgi_addr_in.sin_port = htons(port);
1216 servlen = sizeof(fcgi_addr_in);
1218 Index: src/mod_auth.c
1219 ===================================================================
1220 --- src/mod_auth.c (.../tags/lighttpd-1.4.20) (revision 2389)
1221 +++ src/mod_auth.c (.../branches/lighttpd-1.4.x) (revision 2389)
1223 PATCH(auth_ldap_starttls);
1224 PATCH(auth_ldap_allow_empty_pw);
1228 PATCH(ldap_filter_pre);
1229 PATCH(ldap_filter_post);
1232 } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.hostname"))) {
1233 PATCH(auth_ldap_hostname);
1238 } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.base-dn"))) {
1239 PATCH(auth_ldap_basedn);
1244 - switch(s->auth_backend) {
1245 + switch(s->auth_ldap_hostname->used) {
1246 case AUTH_BACKEND_LDAP: {
1247 handler_t ret = auth_ldap_init(srv, s);
1248 if (ret == HANDLER_ERROR)
1252 if (s->auth_ldap_hostname->used) {
1253 + /* free old context */
1254 + if (NULL != s->ldap) ldap_unbind_s(s->ldap);
1256 if (NULL == (s->ldap = ldap_init(s->auth_ldap_hostname->ptr, LDAP_PORT))) {
1257 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno));
1259 Index: src/http-header-glue.c
1260 ===================================================================
1261 --- src/http-header-glue.c (.../tags/lighttpd-1.4.20) (revision 2389)
1262 +++ src/http-header-glue.c (.../branches/lighttpd-1.4.x) (revision 2389)
1264 strncpy(buf, con->request.http_if_modified_since, used_len);
1265 buf[used_len] = '\0';
1268 if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
1269 con->http_status = 412;
1272 strncpy(buf, con->request.http_if_modified_since, used_len);
1273 buf[used_len] = '\0';
1276 if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
1278 * parsing failed, let's get out of here
1279 Index: src/mod_fastcgi.c
1280 ===================================================================
1281 --- src/mod_fastcgi.c (.../tags/lighttpd-1.4.20) (revision 2389)
1282 +++ src/mod_fastcgi.c (.../branches/lighttpd-1.4.x) (revision 2389)
1283 @@ -3252,6 +3252,7 @@
1284 fcgi_connection_close(srv, hctx);
1287 + con->http_status = 0;
1288 con->file_started = 1; /* fcgi_extension won't touch the request afterwards */
1291 @@ -3608,47 +3609,50 @@
1292 "handling it in mod_fastcgi");
1295 - /* the prefix is the SCRIPT_NAME,
1296 - * everything from start to the next slash
1297 - * this is important for check-local = "disable"
1299 - * if prefix = /admin.fcgi
1301 - * /admin.fcgi/foo/bar
1303 - * SCRIPT_NAME = /admin.fcgi
1304 - * PATH_INFO = /foo/bar
1306 - * if prefix = /fcgi-bin/
1308 - * /fcgi-bin/foo/bar
1310 - * SCRIPT_NAME = /fcgi-bin/foo
1311 - * PATH_INFO = /bar
1313 - * if prefix = /, and fix-root-path-name is enable
1315 - * /fcgi-bin/foo/bar
1317 - * SCRIPT_NAME = /fcgi-bin/foo
1318 - * PATH_INFO = /bar
1321 + /* do not split path info for authorizer */
1322 + if (host->mode != FCGI_AUTHORIZER) {
1323 + /* the prefix is the SCRIPT_NAME,
1324 + * everything from start to the next slash
1325 + * this is important for check-local = "disable"
1327 + * if prefix = /admin.fcgi
1329 + * /admin.fcgi/foo/bar
1331 + * SCRIPT_NAME = /admin.fcgi
1332 + * PATH_INFO = /foo/bar
1334 + * if prefix = /fcgi-bin/
1336 + * /fcgi-bin/foo/bar
1338 + * SCRIPT_NAME = /fcgi-bin/foo
1339 + * PATH_INFO = /bar
1341 + * if prefix = /, and fix-root-path-name is enable
1343 + * /fcgi-bin/foo/bar
1345 + * SCRIPT_NAME = /fcgi-bin/foo
1346 + * PATH_INFO = /bar
1350 - /* the rewrite is only done for /prefix/? matches */
1351 - if (extension->key->ptr[0] == '/' &&
1352 - con->uri.path->used > extension->key->used &&
1353 - NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
1354 - /* rewrite uri.path and pathinfo */
1355 + /* the rewrite is only done for /prefix/? matches */
1356 + if (extension->key->ptr[0] == '/' &&
1357 + con->uri.path->used > extension->key->used &&
1358 + NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
1359 + /* rewrite uri.path and pathinfo */
1361 - buffer_copy_string(con->request.pathinfo, pathinfo);
1362 + buffer_copy_string(con->request.pathinfo, pathinfo);
1364 - con->uri.path->used -= con->request.pathinfo->used - 1;
1365 - con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1366 - } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1367 - buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1368 - con->uri.path->used = 1;
1369 - con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1370 + con->uri.path->used -= con->request.pathinfo->used - 1;
1371 + con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1372 + } else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
1373 + buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
1374 + con->uri.path->used = 1;
1375 + con->uri.path->ptr[con->uri.path->used - 1] = '\0';
1380 Index: src/CMakeLists.txt
1381 ===================================================================
1382 --- src/CMakeLists.txt (.../tags/lighttpd-1.4.20) (revision 0)
1383 +++ src/CMakeLists.txt (.../branches/lighttpd-1.4.x) (revision 2389)
1385 +INCLUDE(CheckCSourceCompiles)
1386 +INCLUDE(CheckIncludeFiles)
1387 +INCLUDE(CheckFunctionExists)
1388 +INCLUDE(CheckVariableExists)
1389 +INCLUDE(CheckTypeSize)
1390 +INCLUDE(CheckLibraryExists)
1391 +INCLUDE(CMakeDetermineCCompiler)
1392 +INCLUDE(FindThreads)
1393 +INCLUDE(FindPkgConfig)
1395 +INCLUDE(LighttpdMacros)
1397 +ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES)
1399 +OPTION(WITH_XATTR "with xattr-support for the stat-cache [default: off]")
1400 +OPTION(WITH_MYSQL "with mysql-support for the mod_sql_vhost [default: off]")
1401 +# OPTION(WITH_POSTGRESQL "with postgress-support for the mod_sql_vhost [default: off]")
1402 +OPTION(WITH_OPENSSL "with openssl-support [default: off]")
1403 +OPTION(WITH_PCRE "with regex support [default: on]" ON)
1404 +OPTION(WITH_WEBDAV_PROPS "with property-support for mod_webdav [default: off]")
1405 +OPTION(WITH_WEBDAV_LOCKS "locks in webdav [default: off]")
1406 +OPTION(WITH_BZIP "with bzip2-support for mod_compress [default: off]")
1407 +OPTION(WITH_ZLIB "with deflate-support for mod_compress [default: on]" ON)
1408 +OPTION(WITH_LDAP "with LDAP-support for the mod_auth [default: off]")
1409 +OPTION(WITH_LUA "with lua 5.1 for mod_magnet [default: off]")
1410 +# OPTION(WITH_VALGRIND "with internal support for valgrind [default: off]")
1411 +# OPTION(WITH_KERBEROS5 "use Kerberos5 support with OpenSSL [default: off]")
1412 +OPTION(WITH_FAM "fam/gamin for reducing number of stat() calls [default: off]")
1413 +OPTION(WITH_GDBM "gdbm storage for mod_trigger_b4_dl [default: off]")
1414 +OPTION(WITH_MEMCACHE "memcached storage for mod_trigger_b4_dl [default: off]")
1416 +OPTION(BUILD_STATIC "build a static lighttpd with all modules added")
1419 + SET(LIGHTTPD_STATIC 1)
1421 + SET(CMAKE_SHARED_LIBRARY_PREFIX "")
1422 +ENDIF(BUILD_STATIC)
1424 +IF(WITH_WEBDAV_PROPS)
1426 + SET(WITH_SQLITE3 1)
1428 +ENDIF(WITH_WEBDAV_PROPS)
1430 +CHECK_INCLUDE_FILES(sys/devpoll.h HAVE_SYS_DEVPOLL_H)
1431 +CHECK_INCLUDE_FILES(sys/epoll.h HAVE_SYS_EPOLL_H)
1432 +CHECK_INCLUDE_FILES(sys/event.h HAVE_SYS_EVENT_H)
1433 +CHECK_INCLUDE_FILES(sys/mman.h HAVE_SYS_MMAN_H)
1434 +CHECK_INCLUDE_FILES(sys/poll.h HAVE_SYS_POLL_H)
1435 +CHECK_INCLUDE_FILES(sys/port.h HAVE_SYS_PORT_H)
1436 +CHECK_INCLUDE_FILES(sys/prctl.h HAVE_SYS_PRCTL_H)
1437 +CHECK_INCLUDE_FILES(sys/resource.h HAVE_SYS_RESOURCE_H)
1438 +CHECK_INCLUDE_FILES(sys/sendfile.h HAVE_SYS_SENDFILE_H)
1439 +CHECK_INCLUDE_FILES(sys/select.h HAVE_SYS_SELECT_H)
1440 +CHECK_INCLUDE_FILES(sys/syslimits.h HAVE_SYS_SYSLIMITS_H)
1441 +CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
1442 +CHECK_INCLUDE_FILES(sys/uio.h HAVE_SYS_UIO_H)
1443 +CHECK_INCLUDE_FILES(sys/un.h HAVE_SYS_UN_H)
1444 +CHECK_INCLUDE_FILES(sys/wait.h HAVE_SYS_WAIT_H)
1445 +CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
1446 +CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
1447 +CHECK_INCLUDE_FILES(pthread.h HAVE_PTHREAD_H)
1448 +CHECK_INCLUDE_FILES(getopt.h HAVE_GETOPT_H)
1449 +CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
1450 +CHECK_INCLUDE_FILES(poll.h HAVE_POLL_H)
1451 +CHECK_INCLUDE_FILES(pwd.h HAVE_PWD_H)
1452 +CHECK_INCLUDE_FILES(stddef.h HAVE_STDDEF_H)
1453 +CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
1454 +CHECK_INCLUDE_FILES(syslog.h HAVE_SYSLOG_H)
1456 +# check for fastcgi lib, for the tests only
1457 +CHECK_INCLUDE_FILES(fastcgi.h HAVE_FASTCGI_H)
1458 +CHECK_INCLUDE_FILES(fastcgi/fastcgi.h HAVE_FASTCGI_FASTCGI_H)
1460 +CHECK_INCLUDE_FILES(crypt.h HAVE_CRYPT_H)
1462 + ## check if we need libcrypt for crypt()
1463 + CHECK_LIBRARY_EXISTS(crypt crypt "" HAVE_LIBCRYPT)
1464 +ENDIF(HAVE_CRYPT_H)
1466 +CHECK_INCLUDE_FILES(sys/inotify.h HAVE_SYS_INOTIFY_H)
1467 +IF(HAVE_SYS_INOTIFY_H)
1468 + CHECK_FUNCTION_EXISTS(inotify_init HAVE_INOTIFY_INIT)
1469 +ENDIF(HAVE_SYS_INOTIFY_H)
1471 +SET(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
1472 +CHECK_TYPE_SIZE(socklen_t HAVE_SOCKLEN_T)
1473 +SET(CMAKE_EXTRA_INCLUDE_FILES)
1475 +CHECK_TYPE_SIZE(long SIZEOF_LONG)
1476 +CHECK_TYPE_SIZE(off_t SIZEOF_OFF_T)
1478 +CHECK_FUNCTION_EXISTS(chroot HAVE_CHROOT)
1479 +CHECK_FUNCTION_EXISTS(crypt HAVE_CRYPT)
1480 +CHECK_FUNCTION_EXISTS(epoll_ctl HAVE_EPOLL_CTL)
1481 +CHECK_FUNCTION_EXISTS(fork HAVE_FORK)
1482 +CHECK_FUNCTION_EXISTS(getrlimit HAVE_GETRLIMIT)
1483 +CHECK_FUNCTION_EXISTS(getuid HAVE_GETUID)
1484 +CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R)
1485 +CHECK_FUNCTION_EXISTS(inet_ntop HAVE_INET_NTOP)
1486 +CHECK_FUNCTION_EXISTS(kqueue HAVE_KQUEUE)
1487 +CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R)
1488 +CHECK_FUNCTION_EXISTS(lstat HAVE_LSTAT)
1489 +CHECK_FUNCTION_EXISTS(madvise HAVE_MADVISE)
1490 +CHECK_FUNCTION_EXISTS(memcpy HAVE_MEMCPY)
1491 +CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET)
1492 +CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
1493 +CHECK_FUNCTION_EXISTS(pathconf HAVE_PATHCONF)
1494 +CHECK_FUNCTION_EXISTS(poll HAVE_POLL)
1495 +CHECK_FUNCTION_EXISTS(port_create HAVE_PORT_CREATE)
1496 +CHECK_FUNCTION_EXISTS(prctl HAVE_PRCTL)
1497 +CHECK_FUNCTION_EXISTS(pread HAVE_PREAD)
1498 +CHECK_FUNCTION_EXISTS(posix_fadvise HAVE_POSIX_FADVISE)
1499 +CHECK_FUNCTION_EXISTS(select HAVE_SELECT)
1500 +CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE)
1501 +CHECK_FUNCTION_EXISTS(send_file HAVE_SEND_FILE)
1502 +CHECK_FUNCTION_EXISTS(sendfile64 HAVE_SENDFILE64)
1503 +CHECK_FUNCTION_EXISTS(sendfilev HAVE_SENDFILEV)
1504 +CHECK_FUNCTION_EXISTS(sigaction HAVE_SIGACTION)
1505 +CHECK_FUNCTION_EXISTS(signal HAVE_SIGNAL)
1506 +CHECK_FUNCTION_EXISTS(sigtimedwait HAVE_SIGTIMEDWAIT)
1507 +CHECK_FUNCTION_EXISTS(strptime HAVE_STRPTIME)
1508 +CHECK_FUNCTION_EXISTS(syslog HAVE_SYSLOG)
1509 +CHECK_FUNCTION_EXISTS(writev HAVE_WRITEV)
1510 +CHECK_FUNCTION_EXISTS(inet_aton HAVE_INET_ATON)
1511 +CHECK_C_SOURCE_COMPILES("
1512 + #include <sys/types.h>
1513 + #include <sys/socket.h>
1514 + #include <netinet/in.h>
1517 + struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;
1522 +MACRO(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
1523 +# reset the variables at the beginning
1524 + SET(${_include_DIR})
1526 + SET(${_link_FLAGS})
1529 + FIND_PROGRAM(${_package}CONFIG_EXECUTABLE NAMES ${_package} PATHS /usr/local/bin )
1531 + # if pkg-config has been found
1532 + IF(${_package}CONFIG_EXECUTABLE)
1533 + SET(XCONFIG_EXECUTABLE "${${_package}CONFIG_EXECUTABLE}")
1534 + MESSAGE(STATUS "found ${_package}: ${XCONFIG_EXECUTABLE}")
1536 + EXEC_PROGRAM(${XCONFIG_EXECUTABLE} ARGS --libs OUTPUT_VARIABLE __link_FLAGS)
1537 + STRING(REPLACE "\n" "" ${_link_FLAGS} ${__link_FLAGS})
1538 + EXEC_PROGRAM(${XCONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE __cflags)
1539 + STRING(REPLACE "\n" "" ${_cflags} ${__cflags})
1541 + ELSE(${_package}CONFIG_EXECUTABLE)
1542 + MESSAGE(STATUS "found ${_package}: no")
1543 + ENDIF(${_package}CONFIG_EXECUTABLE)
1544 +ENDMACRO(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
1547 + CHECK_INCLUDE_FILES(attr/attributes.h HAVE_ATTR_ATTRIBUTES_H)
1548 + CHECK_LIBRARY_EXISTS(attr attr_get "" HAVE_XATTR)
1552 + XCONFIG(mysql_config MYSQL_INCDIR MYSQL_LIBDIR MYSQL_LDFLAGS MYSQL_CFLAGS)
1554 + SET(CMAKE_REQUIRED_INCLUDES /usr/include/mysql)
1555 + CHECK_INCLUDE_FILES(mysql.h HAVE_MYSQL_H)
1556 + SET(CMAKE_REQUIRED_INCLUDES)
1558 + CHECK_LIBRARY_EXISTS(mysqlclient mysql_real_connect "" HAVE_MYSQL)
1559 + ENDIF(HAVE_MYSQL_H)
1563 + CHECK_INCLUDE_FILES(openssl/ssl.h HAVE_OPENSSL_SSL_H)
1564 + IF(HAVE_OPENSSL_SSL_H)
1565 + CHECK_LIBRARY_EXISTS(crypto BIO_f_base64 "" HAVE_LIBCRYPTO)
1566 + IF(HAVE_LIBCRYPTO)
1567 + SET(OPENSSL_NO_KRB5 1)
1568 + CHECK_LIBRARY_EXISTS(ssl SSL_new "" HAVE_LIBSSL)
1569 + ENDIF(HAVE_LIBCRYPTO)
1570 + ENDIF(HAVE_OPENSSL_SSL_H)
1571 +ENDIF(WITH_OPENSSL)
1574 + ## if we have pcre-config, use it
1575 + XCONFIG(pcre-config PCRE_INCDIR PCRE_LIBDIR PCRE_LDFLAGS PCRE_CFLAGS)
1576 + IF(PCRE_LDFLAGS OR PCRE_CFLAGS)
1577 + MESSAGE(STATUS "found pcre at: LDFLAGS: ${PCRE_LDFLAGS} CFLAGS: ${PCRE_CFLAGS}")
1579 + IF(NOT PCRE_CFLAGS STREQUAL "\n")
1580 + ## if it is empty we'll get newline returned
1581 + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PCRE_CFLAGS}")
1582 + ENDIF(NOT PCRE_CFLAGS STREQUAL "\n")
1584 + SET(HAVE_PCRE_H 1)
1585 + SET(HAVE_LIBPCRE 1)
1586 + ELSE(PCRE_LDFLAGS OR PCRE_CFLAGS)
1588 + CHECK_INCLUDE_FILES(pcre.h HAVE_PCRE_H)
1589 + CHECK_LIBRARY_EXISTS(pcre pcre_exec "" HAVE_LIBPCRE)
1590 + SET(PCRE_LDFLAGS -lpcre)
1592 + FIND_PATH(PCRE_INCLUDE_DIR pcre.h
1593 + /usr/local/include
1597 + SET(PCRE_NAMES pcre)
1598 + FIND_LIBRARY(PCRE_LIBRARY
1599 + NAMES ${PCRE_NAMES}
1600 + PATHS /usr/lib /usr/local/lib
1603 + IF(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
1604 + SET(CMAKE_REQUIRED_INCLUDES ${PCRE_INCLUDE_DIR})
1605 + SET(CMAKE_REQUIRED_LIBRARIES ${PCRE_LIBRARY})
1606 + CHECK_INCLUDE_FILES(pcre.h HAVE_PCRE_H)
1607 + CHECK_LIBRARY_EXISTS(pcre pcre_exec "" HAVE_LIBPCRE)
1608 + SET(CMAKE_REQUIRED_INCLUDES)
1609 + SET(CMAKE_REQUIRED_LIBRARIES)
1610 + INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR})
1611 + ENDIF(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
1613 + ENDIF(PCRE_LDFLAGS OR PCRE_CFLAGS)
1615 + IF(NOT HAVE_PCRE_H)
1616 + MESSAGE(FATAL_ERROR "pcre.h couldn't be found")
1617 + ENDIF(NOT HAVE_PCRE_H)
1618 + IF(NOT HAVE_LIBPCRE)
1619 + MESSAGE(FATAL_ERROR "libpcre couldn't be found")
1620 + ENDIF(NOT HAVE_LIBPCRE)
1626 + XCONFIG(xml2-config XML2_INCDIR XML2_LIBDIR XML2_LDFLAGS XML2_CFLAGS)
1627 + IF(XML2_LDFLAGS OR XML2_CFLAGS)
1628 + MESSAGE(STATUS "found xml2 at: LDFLAGS: ${XML2_LDFLAGS} CFLAGS: ${XML2_CFLAGS}")
1630 + ## if it is empty we'll get newline returned
1631 + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XML2_CFLAGS}")
1633 + CHECK_INCLUDE_FILES(libxml/tree.h HAVE_LIBXML_H)
1635 + SET(CMAKE_REQUIRED_FLAGS ${XML2_LDFLAGS})
1636 + CHECK_LIBRARY_EXISTS(xml2 xmlParseChunk "" HAVE_LIBXML)
1637 + SET(CMAKE_REQUIRED_FLAGS)
1638 + ELSE(XML2_LDFLAGS OR XML2_CFLAGS)
1639 + CHECK_INCLUDE_FILES(libxml.h HAVE_LIBXML_H)
1640 + CHECK_LIBRARY_EXISTS(xml2 xmlParseChunk "" HAVE_LIBXML)
1641 + ENDIF(XML2_LDFLAGS OR XML2_CFLAGS)
1643 + IF(NOT HAVE_LIBXML_H)
1644 + MESSAGE(FATAL_ERROR "libxml/tree.h couldn't be found")
1645 + ENDIF(NOT HAVE_LIBXML_H)
1646 + IF(NOT HAVE_LIBXML)
1647 + MESSAGE(FATAL_ERROR "libxml2 couldn't be found")
1648 + ENDIF(NOT HAVE_LIBXML)
1653 + CHECK_INCLUDE_FILES(sqlite3.h HAVE_SQLITE3_H)
1654 + CHECK_LIBRARY_EXISTS(sqlite3 sqlite3_reset "" HAVE_SQLITE3)
1655 +ENDIF(WITH_SQLITE3)
1658 + CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_UUID_H)
1659 + CHECK_LIBRARY_EXISTS(uuid uuid_generate "" NEED_LIBUUID)
1660 + IF(NOT NEED_LIBUUID)
1661 + CHECK_FUNCTION_EXISTS(uuid_generate HAVE_LIBUUID)
1662 + ELSE(NOT NEED_LIBUUID)
1663 + SET(HAVE_LIBUUID 1)
1664 + ENDIF(NOT NEED_LIBUUID)
1669 + CHECK_INCLUDE_FILES(zlib.h HAVE_ZLIB_H)
1670 + CHECK_LIBRARY_EXISTS(z deflate "" HAVE_LIBZ)
1671 + SET(ZLIB_LIBRARY z)
1673 + FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
1674 + /usr/local/include
1678 + SET(ZLIB_NAMES z zlib zdll)
1679 + FIND_LIBRARY(ZLIB_LIBRARY
1680 + NAMES ${ZLIB_NAMES}
1681 + PATHS /usr/lib /usr/local/lib
1685 + IF(ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
1686 + SET(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIR})
1687 + SET(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY})
1688 + GET_FILENAME_COMPONENT(ZLIB_NAME ${ZLIB_LIBRARY} NAME)
1689 + CHECK_INCLUDE_FILES(zlib.h HAVE_ZLIB_H)
1690 + CHECK_LIBRARY_EXISTS(${ZLIB_NAME} deflate "" HAVE_LIBZ)
1691 + SET(CMAKE_REQUIRED_INCLUDES)
1692 + SET(CMAKE_REQUIRED_LIBRARIES)
1693 + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
1695 + ENDIF(ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
1700 + CHECK_INCLUDE_FILES(bzlib.h HAVE_BZLIB_H)
1701 + CHECK_LIBRARY_EXISTS(bz2 BZ2_bzCompress "" HAVE_LIBBZ2)
1705 + CHECK_INCLUDE_FILES(ldap.h HAVE_LDAP_H)
1706 + CHECK_LIBRARY_EXISTS(ldap ldap_bind "" HAVE_LIBLDAP)
1707 + CHECK_INCLUDE_FILES(lber.h HAVE_LBER_H)
1708 + CHECK_LIBRARY_EXISTS(lber ber_printf "" HAVE_LIBLBER)
1709 + SET(LDAP_DEPRECATED 1) # Using deprecated ldap api
1713 + pkg_search_module(LUA REQUIRED lua lua5.1)
1714 + MESSAGE(STATUS "found lua at: INCDIR: ${LUA_INCLUDE_DIRS} LIBDIR: ${LUA_LIBRARY_DIRS} LDFLAGS: ${LUA_LDFLAGS} CFLAGS: ${LUA_CFLAGS}")
1715 + SET(HAVE_LIBLUA 1 "Have liblua")
1716 + SET(HAVE_LUA_H 1 "Have liblua header")
1720 + CHECK_INCLUDE_FILES(fam.h HAVE_FAM_H)
1721 + CHECK_LIBRARY_EXISTS(fam FAMOpen2 "" HAVE_LIBFAM)
1723 + SET(CMAKE_REQUIRED_LIBRARIES fam)
1724 + CHECK_FUNCTION_EXISTS(FAMNoExists HAVE_FAMNOEXISTS)
1725 + ENDIF(HAVE_LIBFAM)
1729 + CHECK_INCLUDE_FILES(gdbm.h HAVE_GDBM_H)
1730 + CHECK_LIBRARY_EXISTS(gdbm gdbm_open "" HAVE_GDBM)
1734 + CHECK_INCLUDE_FILES(memcache.h HAVE_MEMCACHE_H)
1735 + CHECK_LIBRARY_EXISTS(memcache mc_new "" HAVE_MEMCACHE)
1736 +ENDIF(WITH_MEMCACHE)
1738 +IF(NOT BUILD_STATIC)
1739 + CHECK_INCLUDE_FILES(dlfcn.h HAVE_DLFCN_H)
1740 +ENDIF(NOT BUILD_STATIC)
1743 + CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
1744 +ENDIF(HAVE_DLFCN_H)
1746 +SET(LIGHTTPD_VERSION_ID 10400)
1747 +SET(PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
1748 +SET(PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
1749 +EXEC_PROGRAM(date ARGS "'+%b %d %Y %H:%M:%S UTC'" OUTPUT_VARIABLE PACKAGE_BUILD_DATE)
1752 + SET(SBINDIR "sbin")
1755 +IF(NOT LIGHTTPD_MODULES_DIR)
1756 + SET(LIGHTTPD_MODULES_DIR "lib${LIB_SUFFIX}/lighttpd")
1757 +ENDIF(NOT LIGHTTPD_MODULES_DIR)
1760 + SET(LIGHTTPD_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/${LIGHTTPD_MODULES_DIR}")
1762 + ## We use relative path in windows
1763 + SET(LIGHTTPD_LIBRARY_DIR "lib")
1766 +## Write out config.h
1767 +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
1769 +ADD_DEFINITIONS(-DHAVE_CONFIG_H)
1771 +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
1775 + keyvalue.c chunk.c
1776 + http_chunk.c stream.c fdevent.c
1777 + stat_cache.c plugin.c joblist.c etag.c array.c
1778 + data_string.c data_count.c data_array.c
1779 + data_integer.c md5.c data_fastcgi.c
1780 + fdevent_select.c fdevent_linux_rtsig.c
1781 + fdevent_poll.c fdevent_linux_sysepoll.c
1782 + fdevent_solaris_devpoll.c fdevent_freebsd_kqueue.c
1783 + data_config.c bitset.c
1784 + inet_ntop_cache.c crc32.c
1785 + connections-glue.c
1787 + http-header-glue.c
1788 + splaytree.c network_writev.c
1789 + network_write.c network_linux_sendfile.c
1790 + network_freebsd_sendfile.c
1791 + network_solaris_sendfilev.c network_openssl.c
1796 + MESSAGE(STATUS "Adding local getopt implementation.")
1797 + SET(COMMON_SRC ${COMMON_SRC} xgetopt.c)
1800 +ADD_EXECUTABLE(lemon lemon.c)
1802 +## Build parsers by using lemon...
1803 +LEMON_PARSER(configparser.y)
1804 +LEMON_PARSER(mod_ssi_exprparser.y)
1806 +SET(L_INSTALL_TARGETS)
1808 +ADD_EXECUTABLE(spawn-fcgi spawn-fcgi.c)
1809 +SET(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} spawn-fcgi)
1811 +ADD_EXECUTABLE(lighttpd
1822 +SET(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} lighttpd)
1824 +ADD_AND_INSTALL_LIBRARY(mod_access mod_access.c)
1825 +ADD_AND_INSTALL_LIBRARY(mod_accesslog mod_accesslog.c)
1826 +ADD_AND_INSTALL_LIBRARY(mod_alias mod_alias.c)
1827 +ADD_AND_INSTALL_LIBRARY(mod_auth "mod_auth.c;http_auth_digest.c;http_auth.c")
1829 +ADD_AND_INSTALL_LIBRARY(mod_cgi mod_cgi.c)
1831 +ADD_AND_INSTALL_LIBRARY(mod_cml "mod_cml.c;mod_cml_lua.c;mod_cml_funcs.c")
1832 +ADD_AND_INSTALL_LIBRARY(mod_compress mod_compress.c)
1833 +ADD_AND_INSTALL_LIBRARY(mod_dirlisting mod_dirlisting.c)
1834 +ADD_AND_INSTALL_LIBRARY(mod_evasive mod_evasive.c)
1835 +ADD_AND_INSTALL_LIBRARY(mod_evhost mod_evhost.c)
1836 +ADD_AND_INSTALL_LIBRARY(mod_expire mod_expire.c)
1837 +ADD_AND_INSTALL_LIBRARY(mod_extforward mod_extforward.c)
1838 +ADD_AND_INSTALL_LIBRARY(mod_fastcgi mod_fastcgi.c)
1839 +ADD_AND_INSTALL_LIBRARY(mod_flv_streaming mod_flv_streaming.c)
1840 +ADD_AND_INSTALL_LIBRARY(mod_indexfile mod_indexfile.c)
1841 +ADD_AND_INSTALL_LIBRARY(mod_magnet "mod_magnet.c;mod_magnet_cache.c")
1842 +ADD_AND_INSTALL_LIBRARY(mod_mysql_vhost mod_mysql_vhost.c)
1843 +ADD_AND_INSTALL_LIBRARY(mod_proxy mod_proxy.c)
1844 +ADD_AND_INSTALL_LIBRARY(mod_redirect mod_redirect.c)
1845 +ADD_AND_INSTALL_LIBRARY(mod_rewrite mod_rewrite.c)
1846 +ADD_AND_INSTALL_LIBRARY(mod_rrdtool mod_rrdtool.c)
1847 +ADD_AND_INSTALL_LIBRARY(mod_scgi mod_scgi.c)
1848 +ADD_AND_INSTALL_LIBRARY(mod_secdownload mod_secure_download.c)
1849 +ADD_AND_INSTALL_LIBRARY(mod_setenv mod_setenv.c)
1850 +ADD_AND_INSTALL_LIBRARY(mod_simple_vhost mod_simple_vhost.c)
1851 +ADD_AND_INSTALL_LIBRARY(mod_ssi "mod_ssi_exprparser.c;mod_ssi_expr.c;mod_ssi.c")
1852 +ADD_AND_INSTALL_LIBRARY(mod_staticfile mod_staticfile.c)
1853 +ADD_AND_INSTALL_LIBRARY(mod_status mod_status.c)
1854 +ADD_AND_INSTALL_LIBRARY(mod_trigger_b4_dl mod_trigger_b4_dl.c)
1855 +ADD_AND_INSTALL_LIBRARY(mod_uploadprogress mod_uploadprogress.c)
1856 +ADD_AND_INSTALL_LIBRARY(mod_userdir mod_userdir.c)
1857 +ADD_AND_INSTALL_LIBRARY(mod_usertrack mod_usertrack.c)
1858 +ADD_AND_INSTALL_LIBRARY(mod_webdav mod_webdav.c)
1861 + ADD_TARGET_PROPERTIES(lighttpd LINK_FLAGS ${PCRE_LDFLAGS})
1862 + ADD_TARGET_PROPERTIES(lighttpd COMPILE_FLAGS ${PCRE_CFLAGS})
1863 + ADD_TARGET_PROPERTIES(mod_rewrite LINK_FLAGS ${PCRE_LDFLAGS})
1864 + ADD_TARGET_PROPERTIES(mod_rewrite COMPILE_FLAGS ${PCRE_CFLAGS})
1865 + ADD_TARGET_PROPERTIES(mod_dirlisting LINK_FLAGS ${PCRE_LDFLAGS})
1866 + ADD_TARGET_PROPERTIES(mod_dirlisting COMPILE_FLAGS ${PCRE_CFLAGS})
1867 + ADD_TARGET_PROPERTIES(mod_redirect LINK_FLAGS ${PCRE_LDFLAGS})
1868 + ADD_TARGET_PROPERTIES(mod_redirect COMPILE_FLAGS ${PCRE_CFLAGS})
1869 + ADD_TARGET_PROPERTIES(mod_ssi LINK_FLAGS ${PCRE_LDFLAGS})
1870 + ADD_TARGET_PROPERTIES(mod_ssi COMPILE_FLAGS ${PCRE_CFLAGS})
1871 + ADD_TARGET_PROPERTIES(mod_trigger_b4_dl LINK_FLAGS ${PCRE_LDFLAGS})
1872 + ADD_TARGET_PROPERTIES(mod_trigger_b4_dl COMPILE_FLAGS ${PCRE_CFLAGS})
1875 +ADD_TARGET_PROPERTIES(mod_magnet LINK_FLAGS ${LUA_LDFLAGS})
1876 +ADD_TARGET_PROPERTIES(mod_magnet COMPILE_FLAGS ${LUA_CFLAGS})
1878 +ADD_TARGET_PROPERTIES(mod_cml LINK_FLAGS ${LUA_LDFLAGS})
1879 +ADD_TARGET_PROPERTIES(mod_cml COMPILE_FLAGS ${LUA_CFLAGS})
1881 +IF(HAVE_MYSQL_H AND HAVE_LIBMYSQL)
1882 + TARGET_LINK_LIBRARIES(mod_mysql_vhost mysqlclient)
1883 + INCLUDE_DIRECTORIES(/usr/include/mysql)
1884 +ENDIF(HAVE_MYSQL_H AND HAVE_LIBMYSQL)
1888 + SET(L_MOD_WEBDAV ${L_MOD_WEBDAV} sqlite3)
1889 +ENDIF(HAVE_SQLITE3_H)
1891 + SET_TARGET_PROPERTIES(mod_webdav PROPERTIES LINK_FLAGS ${XML2_LDFLAGS})
1892 +ENDIF(HAVE_LIBXML_H)
1895 + SET(L_MOD_WEBDAV ${L_MOD_WEBDAV} uuid)
1896 + ENDIF(NEED_LIBUUID)
1899 +TARGET_LINK_LIBRARIES(mod_webdav ${L_MOD_WEBDAV})
1903 + SET(L_MOD_AUTH ${L_MOD_AUTH} crypt)
1904 +ENDIF(HAVE_LIBCRYPT)
1907 + SET(L_MOD_AUTH ${L_MOD_AUTH} ldap lber)
1909 +TARGET_LINK_LIBRARIES(mod_auth ${L_MOD_AUTH})
1913 + TARGET_LINK_LIBRARIES(mod_compress ${ZLIB_LIBRARY} bz2)
1914 + ELSE(HAVE_BZLIB_H)
1915 + TARGET_LINK_LIBRARIES(mod_compress ${ZLIB_LIBRARY})
1916 + ENDIF(HAVE_BZLIB_H)
1920 + TARGET_LINK_LIBRARIES(lighttpd fam)
1924 + TARGET_LINK_LIBRARIES(mod_trigger_b4_dl gdbm)
1927 +IF(HAVE_MEMCACHE_H)
1928 + TARGET_LINK_LIBRARIES(mod_trigger_b4_dl memcache)
1929 +ENDIF(HAVE_MEMCACHE_H)
1931 +IF(CMAKE_COMPILER_IS_GNUCC)
1932 + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -g -Wshadow -W -pedantic")
1933 + SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
1934 + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
1935 + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2")
1936 + ADD_DEFINITIONS(-D_GNU_SOURCE)
1937 +ENDIF(CMAKE_COMPILER_IS_GNUCC)
1939 +SET_TARGET_PROPERTIES(lighttpd PROPERTIES CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
1942 + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVALGRIND")
1943 + ADD_TARGET_PROPERTIES(lighttpd COMPILE_FLAGS "-DLI_DECLARE_EXPORTS")
1944 + TARGET_LINK_LIBRARIES(lighttpd ws2_32)
1945 + TARGET_LINK_LIBRARIES(mod_proxy ws2_32)
1946 + TARGET_LINK_LIBRARIES(mod_fcgi ws2_32)
1947 + TARGET_LINK_LIBRARIES(mod_scgi ws2_32)
1948 + TARGET_LINK_LIBRARIES(mod_ssi ws2_32)
1951 + TARGET_LINK_LIBRARIES(lighttpd msvcr70)
1952 + ADD_TARGET_PROPERTIES(lighttpd LINK_FLAGS "-Wl,-subsystem,console")
1956 +IF(NOT BUILD_STATIC)
1958 + TARGET_LINK_LIBRARIES(lighttpd dl)
1960 +ENDIF(NOT BUILD_STATIC)
1962 +IF(HAVE_LIBSSL AND HAVE_LIBCRYPTO)
1963 + TARGET_LINK_LIBRARIES(lighttpd ssl)
1964 + TARGET_LINK_LIBRARIES(lighttpd crypto)
1965 +ENDIF(HAVE_LIBSSL AND HAVE_LIBCRYPTO)
1968 +INSTALL(TARGETS ${L_INSTALL_TARGETS}
1969 + RUNTIME DESTINATION ${SBINDIR}
1970 + LIBRARY DESTINATION ${LIGHTTPD_MODULES_DIR}
1971 + ARCHIVE DESTINATION ${LIGHTTPD_MODULES_DIR}/static)
1973 +## HACK to make win32 to install our libraries in desired directory..
1974 +INSTALL(TARGETS lighttpd
1975 + RUNTIME DESTINATION ${SBINDIR}
1976 + ARCHIVE DESTINATION lib/static)
1977 +LIST(REMOVE_ITEM L_INSTALL_TARGETS lighttpd)
1978 +INSTALL(TARGETS ${L_INSTALL_TARGETS}
1979 + RUNTIME DESTINATION ${SBINDIR}/lib
1980 + LIBRARY DESTINATION lib
1981 + ARCHIVE DESTINATION lib/static)
1983 Index: src/mod_accesslog.c
1984 ===================================================================
1985 --- src/mod_accesslog.c (.../tags/lighttpd-1.4.20) (revision 2389)
1986 +++ src/mod_accesslog.c (.../branches/lighttpd-1.4.x) (revision 2389)
1987 @@ -169,13 +169,13 @@
1988 if (fields->size == 0) {
1991 - fields->ptr = malloc(fields->size * sizeof(format_fields * ));
1992 + fields->ptr = malloc(fields->size * sizeof(format_field * ));
1993 } else if (fields->used == fields->size) {
1995 - fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_fields * ));
1996 + fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * ));
1999 - fields->ptr[fields->used] = malloc(sizeof(format_fields));
2000 + fields->ptr[fields->used] = malloc(sizeof(format_field));
2001 fields->ptr[fields->used]->type = FIELD_STRING;
2002 fields->ptr[fields->used]->string = buffer_init();
2004 @@ -189,10 +189,10 @@
2005 if (fields->size == 0) {
2008 - fields->ptr = malloc(fields->size * sizeof(format_fields * ));
2009 + fields->ptr = malloc(fields->size * sizeof(format_field * ));
2010 } else if (fields->used == fields->size) {
2012 - fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_fields * ));
2013 + fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * ));
2016 /* search for the terminating command */
2021 - fields->ptr[fields->used] = malloc(sizeof(format_fields));
2022 + fields->ptr[fields->used] = malloc(sizeof(format_field));
2023 fields->ptr[fields->used]->type = FIELD_FORMAT;
2024 fields->ptr[fields->used]->field = fmap[j].type;
2025 fields->ptr[fields->used]->string = NULL;
2030 - fields->ptr[fields->used] = malloc(sizeof(format_fields));
2031 + fields->ptr[fields->used] = malloc(sizeof(format_field));
2032 fields->ptr[fields->used]->type = FIELD_FORMAT;
2033 fields->ptr[fields->used]->field = fmap[j].type;
2034 fields->ptr[fields->used]->string = buffer_init();
2039 - fields->ptr[fields->used] = malloc(sizeof(format_fields));
2040 + fields->ptr[fields->used] = malloc(sizeof(format_field));
2041 fields->ptr[fields->used]->type = FIELD_FORMAT;
2042 fields->ptr[fields->used]->field = fmap[j].type;
2043 fields->ptr[fields->used]->string = NULL;
2044 @@ -321,13 +321,13 @@
2045 if (fields->size == 0) {
2048 - fields->ptr = malloc(fields->size * sizeof(format_fields * ));
2049 + fields->ptr = malloc(fields->size * sizeof(format_field * ));
2050 } else if (fields->used == fields->size) {
2052 - fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_fields * ));
2053 + fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * ));
2056 - fields->ptr[fields->used] = malloc(sizeof(format_fields));
2057 + fields->ptr[fields->used] = malloc(sizeof(format_field));
2058 fields->ptr[fields->used]->type = FIELD_STRING;
2059 fields->ptr[fields->used]->string = buffer_init();
2063 return HANDLER_ERROR;
2066 fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
2071 return HANDLER_GO_ON;
2074 return HANDLER_ERROR;
2077 + fcntl(s->log_access_fd, F_SETFD, FD_CLOEXEC);
2082 Index: src/fdevent_linux_sysepoll.c
2083 ===================================================================
2084 --- src/fdevent_linux_sysepoll.c (.../tags/lighttpd-1.4.20) (revision 2389)
2085 +++ src/fdevent_linux_sysepoll.c (.../branches/lighttpd-1.4.x) (revision 2389)
2087 if (e & EPOLLHUP) events |= FDEVENT_HUP;
2088 if (e & EPOLLPRI) events |= FDEVENT_PRI;
2094 static int fdevent_linux_sysepoll_event_get_fd(fdevents *ev, size_t ndx) {
2096 ===================================================================
2097 --- src/server.c (.../tags/lighttpd-1.4.20) (revision 2389)
2098 +++ src/server.c (.../branches/lighttpd-1.4.x) (revision 2389)
2100 srv->srvconf.modules_dir = buffer_init_string(LIBRARY_DIR);
2101 srv->srvconf.network_backend = buffer_init();
2102 srv->srvconf.upload_tempdirs = array_init();
2103 + srv->srvconf.reject_expect_100_with_417 = 1;
2106 srv->errorlog_fd = -1;
2107 @@ -844,15 +845,16 @@
2111 - if (srv->srvconf.max_conns > srv->max_fds) {
2112 - /* we can't have more connections than max-fds */
2113 - srv->max_conns = srv->max_fds;
2114 + if (srv->srvconf.max_conns > srv->max_fds/2) {
2115 + /* we can't have more connections than max-fds/2 */
2116 + log_error_write(srv, __FILE__, __LINE__, "sdd", "can't have more connections than fds/2: ", srv->srvconf.max_conns, srv->max_fds);
2117 + srv->max_conns = srv->max_fds/2;
2118 } else if (srv->srvconf.max_conns) {
2119 /* otherwise respect the wishes of the user */
2120 srv->max_conns = srv->srvconf.max_conns;
2122 - /* or use the default */
2123 - srv->max_conns = srv->max_fds;
2124 + /* or use the default: we really don't want to hit max-fds */
2125 + srv->max_conns = srv->max_fds/3;
2128 if (HANDLER_GO_ON != plugins_call_init(srv)) {
2129 @@ -1295,8 +1297,8 @@
2130 if (srv->sockets_disabled) {
2131 /* our server sockets are disabled, why ? */
2133 - if ((srv->cur_fds + srv->want_fds < srv->max_fds * 0.8) && /* we have enough unused fds */
2134 - (srv->conns->used < srv->max_conns * 0.9) &&
2135 + if ((srv->cur_fds + srv->want_fds < srv->max_fds * 8 / 10) && /* we have enough unused fds */
2136 + (srv->conns->used <= srv->max_conns * 9 / 10) &&
2137 (0 == graceful_shutdown)) {
2138 for (i = 0; i < srv->srv_sockets.used; i++) {
2139 server_socket *srv_socket = srv->srv_sockets.ptr[i];
2140 @@ -1308,8 +1310,8 @@
2141 srv->sockets_disabled = 0;
2144 - if ((srv->cur_fds + srv->want_fds > srv->max_fds * 0.9) || /* out of fds */
2145 - (srv->conns->used > srv->max_conns) || /* out of connections */
2146 + if ((srv->cur_fds + srv->want_fds > srv->max_fds * 9 / 10) || /* out of fds */
2147 + (srv->conns->used >= srv->max_conns) || /* out of connections */
2148 (graceful_shutdown)) { /* graceful_shutdown */
2150 /* disable server-fds */
2151 @@ -1348,7 +1350,7 @@
2153 if (graceful_shutdown) {
2154 log_error_write(srv, __FILE__, __LINE__, "s", "[note] graceful shutdown started");
2155 - } else if (srv->conns->used > srv->max_conns) {
2156 + } else if (srv->conns->used >= srv->max_conns) {
2157 log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets disabled, connection limit reached");
2159 log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets disabled, out-of-fds");
2161 ===================================================================
2162 --- src/log.c (.../tags/lighttpd-1.4.20) (revision 2389)
2163 +++ src/log.c (.../branches/lighttpd-1.4.x) (revision 2389)
2164 @@ -146,6 +146,10 @@
2165 /* ok, new log is open, close the old one */
2166 close(srv->errorlog_fd);
2167 srv->errorlog_fd = new_fd;
2169 + /* close fd on exec (cgi) */
2170 + fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
2175 Index: src/proc_open.c
2176 ===================================================================
2177 --- src/proc_open.c (.../tags/lighttpd-1.4.20) (revision 2389)
2178 +++ src/proc_open.c (.../branches/lighttpd-1.4.x) (revision 2389)
2179 @@ -287,32 +287,33 @@
2182 /* {{{ proc_open_buffer */
2183 -int proc_open_buffer(proc_handler_t *proc, const char *command, buffer *in, buffer *out, buffer *err) {
2184 +int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err) {
2185 + proc_handler_t proc;
2189 - if (proc_open(proc, command) != 0) {
2190 + if (proc_open(&proc, command) != 0) {
2195 - if (write(proc->in.fd, (void *)in->ptr, in->used) < 0) {
2196 + if (write(proc.in.fd, (void *)in->ptr, in->used) < 0) {
2197 perror("error writing pipe");
2201 - pipe_close(&proc->in);
2202 + pipe_close(&proc.in);
2205 - proc_read_fd_to_buffer(proc->out.fd, out);
2206 + proc_read_fd_to_buffer(proc.out.fd, out);
2208 - pipe_close(&proc->out);
2209 + pipe_close(&proc.out);
2212 - proc_read_fd_to_buffer(proc->err.fd, err);
2213 + proc_read_fd_to_buffer(proc.err.fd, err);
2215 - pipe_close(&proc->err);
2216 + pipe_close(&proc.err);
2218 + proc_close(&proc);
2226 fprintf(stdout, "test: echo 321 with read\n"); fflush(stdout);
2227 - if (proc_open_buffer(&proc, "echo 321", NULL, out, err) != 0) {
2228 + if (proc_open_buffer("echo 321", NULL, out, err) != 0) {
2231 fprintf(stdout, "result: ->%s<-\n\n", out->ptr); fflush(stdout);
2234 fprintf(stdout, "test: echo 123 | " CMD_CAT "\n"); fflush(stdout);
2235 buffer_copy_string_len(in, CONST_STR_LEN("123\n"));
2236 - if (proc_open_buffer(&proc, CMD_CAT, in, out, err) != 0) {
2237 + if (proc_open_buffer(CMD_CAT, in, out, err) != 0) {
2240 fprintf(stdout, "result: ->%s<-\n\n", out->ptr); fflush(stdout);
2241 Index: src/proc_open.h
2242 ===================================================================
2243 --- src/proc_open.h (.../tags/lighttpd-1.4.20) (revision 2389)
2244 +++ src/proc_open.h (.../branches/lighttpd-1.4.x) (revision 2389)
2247 int proc_close(proc_handler_t *ht);
2248 int proc_open(proc_handler_t *ht, const char *command);
2249 -int proc_open_buffer(proc_handler_t *ht, const char *command, buffer *in, buffer *out, buffer *err);
2250 +int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err);
2251 Index: tests/mod-proxy.t
2252 ===================================================================
2253 --- tests/mod-proxy.t (.../tags/lighttpd-1.4.20) (revision 2389)
2254 +++ tests/mod-proxy.t (.../branches/lighttpd-1.4.x) (revision 2389)
2259 -use Test::More tests => 6;
2260 +use Test::More tests => 9;
2263 my $tf_real = LightyTest->new();
2264 my $tf_proxy = LightyTest->new();
2267 +my $php_child = -1;
2269 +my $phpbin = (defined $ENV{'PHP'} ? $ENV{'PHP'} : '/usr/bin/php-cgi');
2270 +$ENV{'PHP'} = $phpbin;
2273 + skip "PHP already running on port 1026", 1 if $tf_real->listening_on(1026);
2274 + skip "no php binary found", 1 unless -x $phpbin;
2275 + ok(-1 != ($php_child = $tf_real->spawnfcgi($phpbin, 1026)), "Spawning php");
2278 ## we need two procs
2279 ## 1. the real webserver
2280 ## 2. the proxy server
2282 $tf_proxy->{PORT} = 2050;
2283 $tf_proxy->{CONFIGFILE} = 'proxy.conf';
2285 -ok($tf_real->start_proc == 0, "Starting lighttpd") or die();
2286 +ok($tf_real->start_proc == 0, "Starting lighttpd") or goto cleanup;
2288 -ok($tf_proxy->start_proc == 0, "Starting lighttpd as proxy") or die();
2289 +ok($tf_proxy->start_proc == 0, "Starting lighttpd as proxy") or goto cleanup;
2291 $t->{REQUEST} = ( <<EOF
2292 GET /index.html HTTP/1.0
2294 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Server' => 'Apache 1.3.29' } ];
2295 ok($tf_proxy->handle_http($t) == 0, 'drop Server from real server');
2298 + skip "no PHP running on port 1026", 1 unless $tf_real->listening_on(1026);
2299 + $t->{REQUEST} = ( <<EOF
2300 +GET /rewrite/all/some+test%3axxx%20with%20space HTTP/1.0
2301 +Host: www.example.org
2304 + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/some+test%3axxx%20with%20space' } ];
2305 + ok($tf_proxy->handle_http($t) == 0, 'rewrited urls work with encoded path');
2308 ok($tf_proxy->stop_proc == 0, "Stopping lighttpd proxy");
2310 ok($tf_real->stop_proc == 0, "Stopping lighttpd");
2313 + skip "PHP not started, cannot stop it", 1 unless $php_child != -1;
2314 + ok(0 == $tf_real->endspawnfcgi($php_child), "Stopping php");
2322 +$tf_real->endspawnfcgi($php_child) if $php_child != -1;
2325 Index: tests/CMakeLists.txt
2326 ===================================================================
2327 --- tests/CMakeLists.txt (.../tags/lighttpd-1.4.20) (revision 0)
2328 +++ tests/CMakeLists.txt (.../branches/lighttpd-1.4.x) (revision 2389)
2333 + core-404-handler.t
2339 + core-var-include.t
2358 +FOREACH(it ${T_FILES})
2359 + ADD_TEST(${it} "${lighttpd_SOURCE_DIR}/tests/wrapper.sh"
2360 + "${lighttpd_SOURCE_DIR}/tests"
2361 + "${lighttpd_BINARY_DIR}"
2362 + "${lighttpd_SOURCE_DIR}/tests/${it}")
2364 Index: tests/SConscript
2365 ===================================================================
2366 --- tests/SConscript (.../tags/lighttpd-1.4.20) (revision 2389)
2367 +++ tests/SConscript (.../branches/lighttpd-1.4.x) (revision 2389)
2372 + mod-compress.conf \
2376 Index: tests/mod-compress.conf
2377 ===================================================================
2378 --- tests/mod-compress.conf (.../tags/lighttpd-1.4.20) (revision 0)
2379 +++ tests/mod-compress.conf (.../branches/lighttpd-1.4.x) (revision 2389)
2381 +debug.log-request-handling = "enable"
2382 +debug.log-response-header = "disable"
2383 +debug.log-request-header = "disable"
2385 +server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
2386 +server.pid-file = env.SRCDIR + "/tmp/lighttpd/lighttpd.pid"
2388 +## bind to port (default: 80)
2391 +## bind to localhost (default: all interfaces)
2392 +server.bind = "localhost"
2393 +server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
2394 +server.name = "www.example.org"
2400 +######################## MODULE CONFIG ############################
2402 +mimetype.assign = (
2403 + ".html" => "text/html",
2404 + ".txt" => "text/plain",
2407 +$HTTP["host"] == "cache.example.org" {
2408 + compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
2410 +compress.filetype = ("text/plain", "text/html")
2412 +compress.allowed-encodings = ( "gzip", "deflate" )
2413 Index: tests/mod-fastcgi.t
2414 ===================================================================
2415 --- tests/mod-fastcgi.t (.../tags/lighttpd-1.4.20) (revision 2389)
2416 +++ tests/mod-fastcgi.t (.../branches/lighttpd-1.4.x) (revision 2389)
2421 -use Test::More tests => 49;
2422 +use Test::More tests => 50;
2425 my $tf = LightyTest->new();
2430 - skip "no fcgi-auth found", 4 unless -x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe";
2431 + skip "no fcgi-auth found", 5 unless -x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe";
2433 $tf->{CONFIGFILE} = 'fastcgi-auth.conf';
2434 ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
2435 @@ -235,6 +235,14 @@
2436 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
2437 ok($tf->handle_http($t) == 0, 'FastCGI - Auth');
2439 + $t->{REQUEST} = ( <<EOF
2440 +GET /expire/access.txt?ok HTTP/1.0
2441 +Host: www.example.org
2444 + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
2445 + ok($tf->handle_http($t) == 0, 'FastCGI - Auth in subdirectory');
2447 ok($tf->stop_proc == 0, "Stopping lighttpd");
2450 Index: tests/mod-rewrite.t
2451 ===================================================================
2452 --- tests/mod-rewrite.t (.../tags/lighttpd-1.4.20) (revision 2389)
2453 +++ tests/mod-rewrite.t (.../branches/lighttpd-1.4.x) (revision 2389)
2458 -use Test::More tests => 8;
2459 +use Test::More tests => 7;
2462 my $tf = LightyTest->new();
2465 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '' } ];
2466 ok($tf->handle_http($t) == 0, 'valid request');
2469 $t->{REQUEST} = ( <<EOF
2470 GET /rewrite/foo?a=b HTTP/1.0
2471 Host: www.example.org
2473 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'bar&a=b' } ];
2474 ok($tf->handle_http($t) == 0, 'valid request');
2476 - $t->{REQUEST} = ( <<EOF
2477 -GET %2Frewrite/f%6Fo?a=b HTTP/1.0
2478 -Host: www.example.org
2481 - $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'a=b' } ];
2482 - ok($tf->handle_http($t) == 0, 'valid request with url encoded characters');
2484 ok($tf->stop_proc == 0, "Stopping lighttpd");
2487 Index: tests/lighttpd.conf
2488 ===================================================================
2489 --- tests/lighttpd.conf (.../tags/lighttpd-1.4.20) (revision 2389)
2490 +++ tests/lighttpd.conf (.../branches/lighttpd-1.4.x) (revision 2389)
2493 $HTTP["host"] == "etag.example.org" {
2494 static-file.etags = "disable"
2495 + compress.filetype = ()
2497 Index: tests/fastcgi-auth.conf
2498 ===================================================================
2499 --- tests/fastcgi-auth.conf (.../tags/lighttpd-1.4.20) (revision 2389)
2500 +++ tests/fastcgi-auth.conf (.../branches/lighttpd-1.4.x) (revision 2389)
2502 "bin-path" => env.SRCDIR + "/fcgi-auth",
2503 "mode" => "authorizer",
2504 "docroot" => env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/",
2505 + "check-local" => "disable",
2509 Index: tests/proxy.conf
2510 ===================================================================
2511 --- tests/proxy.conf (.../tags/lighttpd-1.4.20) (revision 2389)
2512 +++ tests/proxy.conf (.../branches/lighttpd-1.4.x) (revision 2389)
2514 url.redirect = ( "^/redirect/$" => "http://localhost:2048/" )
2516 url.rewrite = ( "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1",
2517 - "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1" )
2518 + "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1",
2519 + "^/rewrite/all(/.*)$" => "/indexfile/rewrite.php?$1" )
2521 expire.url = ( "/expire/access" => "access 2 hours",
2522 "/expire/modification" => "access plus 1 seconds 2 minutes")
2523 Index: tests/Makefile.am
2524 ===================================================================
2525 --- tests/Makefile.am (.../tags/lighttpd-1.4.20) (revision 2389)
2526 +++ tests/Makefile.am (.../branches/lighttpd-1.4.x) (revision 2389)
2531 + mod-compress.conf \
2535 Index: tests/mod-compress.t
2536 ===================================================================
2537 --- tests/mod-compress.t (.../tags/lighttpd-1.4.20) (revision 2389)
2538 +++ tests/mod-compress.t (.../branches/lighttpd-1.4.x) (revision 2389)
2543 -use Test::More tests => 10;
2544 +use Test::More tests => 11;
2547 my $tf = LightyTest->new();
2550 +$tf->{CONFIGFILE} = 'mod-compress.conf';
2552 ok($tf->start_proc == 0, "Starting lighttpd") or die();
2554 $t->{REQUEST} = ( <<EOF
2556 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Type' => "text/plain" } ];
2557 ok($tf->handle_http($t) == 0, 'Empty Accept-Encoding');
2559 +$t->{REQUEST} = ( <<EOF
2560 +GET /index.txt HTTP/1.0
2561 +Accept-Encoding: bzip2, gzip, deflate
2562 +Host: cache.example.org
2565 +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Encoding' => 'gzip', 'Content-Type' => "text/plain" } ];
2566 +ok($tf->handle_http($t) == 0, 'bzip2 requested but disabled');
2569 ok($tf->stop_proc == 0, "Stopping lighttpd");
2570 Index: doc/redirect.txt
2571 ===================================================================
2572 --- doc/redirect.txt (.../tags/lighttpd-1.4.20) (revision 2389)
2573 +++ doc/redirect.txt (.../branches/lighttpd-1.4.x) (revision 2389)
2575 $HTTP["host"] =~ "^www\.(.*)" {
2576 url.redirect = ( "^/(.*)" => "http://%1/$1" )
2582 +Do NOT use mod_redirect to protect specific urls, as the original url passed from the client
2583 +is matched against your rules, for example strings like "/abc/../xyz%2f/path".
2584 Index: doc/compress.txt
2585 ===================================================================
2586 --- doc/compress.txt (.../tags/lighttpd-1.4.20) (revision 2389)
2587 +++ doc/compress.txt (.../branches/lighttpd-1.4.x) (revision 2389)
2589 Module: mod_compress
2590 --------------------
2592 -:Author: Jan Kneschke
2594 -:Revision: $Revision$
2597 - a nice, short abstrace about the module
2600 :keywords: lighttpd, compress
2605 Output compression reduces the network load and can improve the overall
2606 -throughput of the webserver.
2607 +throughput of the webserver. All major http-clients support compression by
2608 +announcing it in the Accept-Encoding header. This is used to negotiate the
2609 +most suitable compression method. We support deflate, gzip and bzip2.
2611 -Only static content is supported up to now.
2612 +deflate (RFC1950, RFC1951) and gzip (RFC1952) depend on zlib while bzip2
2613 +depends on libbzip2. bzip2 is only supported by lynx and some other console
2616 -The server negotiates automaticly which compression method is used.
2617 -Supported are gzip, deflate, bzip.
2618 +We currently limit to compression support to static files.
2623 +mod_compress can store compressed files on disk to optimize the compression
2624 +on a second request away. As soon as compress.cache-dir is set the files are
2627 +(You will need to create the cache directory if it doesn't already exist. The web server will not do this for you. The directory will also need the proper ownership. For Debian/Ubuntu the user and group ids should both be www-data.)
2629 +The names of the cache files are made of the filename, the compression method
2630 +and the etag associated to the file.
2632 +Cleaning the cache is left to the user. A cron job deleting files older than
2633 +10 days could do it: ::
2635 + find /var/www/cache -type f -mtime +10 | xargs -r rm
2640 +The module limits the compression of files to files smaller than 128 MByte and
2641 +larger than 128 Byte.
2643 +The lower limit is set as small files tend to become larger by compressing due
2644 +to the compression headers, the upper limit is set to work sensibly with
2645 +memory and cpu-time.
2647 +Directories containing a tilde ('~') are not created automatically (See ticket
2648 +#113). To enable compression for user dirs you have to create the directories
2649 +by hand in the cache directory.
2654 +compress.allowed-encodings
2655 + override default set of allowed encodings
2659 + compress.allowed-encodings = ("bzip2", "gzip", "deflate")
2662 name of the directory where compressed content will be cached
2664 @@ -47,20 +82,111 @@
2665 Default: not set, compress the file for every request
2668 - mimetypes where might get compressed
2669 + mimetypes which might get compressed
2673 compress.filetype = ("text/plain", "text/html")
2675 + Keep in mind that compressed JavaScript and CSS files are broken in some
2676 + browsers. Not setting any filetypes will result in no files being compressed.
2678 + NOTE: You have to specify the full mime-type! If you also define a charset, for example, you have to use "text/plain; charset=utf-8" instead of just "text/plain".
2682 +compress.max-filesize
2683 + maximum size of the original file to be compressed kBytes.
2685 + This is meant to protect the server against DoSing as compressing large
2686 + (let's say 1Gbyte) takes a lot of time and would delay the whole operation
2689 + There is a hard upper limit of 128Mbyte.
2691 + Default: unlimited (== hard-limit of 128MByte)
2693 +Display compressed files
2694 +========================
2696 +If you enable mod_compress, and you want to force clients to uncompress and display compressed text files, please force mimetype to nothing.
2698 +If you want to add headers for uncompress and display diff.gz files , add this section in your conf : ::
2700 + $HTTP["url"] =~ "\.diff\.gz" {
2701 + setenv.add-response-header = ( "Content-Encoding" => "gzip" )
2702 + mimetype.assign = ()
2706 Compressing Dynamic Content
2707 ===========================
2712 To compress dynamic content with PHP please enable ::
2714 zlib.output_compression = 1
2715 + zlib.output_handler = On
2717 in the php.ini as PHP provides compression support by itself.
2719 +mod_compress of lighttpd 1.5 r1992 may not set correct Content-Encoding with php-fcgi. A solution to that problem would be:
2721 +1.disable mod_compress when request a php file::
2723 + $HTTP["url"] !~ "\.php$" {
2724 + compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml")
2727 +2.enable mod_setenv of your lighttpd::
2729 + server.modules += ( "mod_setenv" )
2731 +3.manually set Content-Encoding::
2733 + $HTTP["url"] =~ "\.php$" {
2734 + setenv.add-response-header = ( "Content-Encoding" => "gzip")
2741 +To compress dynamic content with TurboGears please enable ::
2744 + gzip_filter.on = True
2745 + gzip_filter.mime_types = ["application/x-javascript", "text/javascript", "text/html", "text/css", "text/plain"]
2747 +in the config/app.cfg file in your TurboGears application. The above lines should already be in the file. You just need to remove the comment symbol in front of the lines to make them active.
2752 +To compress dynamic content with Django please enable the GZipMiddleware ::
2754 + MIDDLEWARE_CLASSES = (
2755 + 'django.middleware.gzip.GZipMiddleware',
2759 +in the settings.py file in your Django project.
2764 +To compress dynamic content with Perl/Catalyst, simply use the Catalyst::Plugin::Compress::Gzip module available on CPAN ::
2771 +in your main package (MyApp.pm). Further configuration is not required.
2777 Index: doc/rewrite.txt
2778 ===================================================================
2779 --- doc/rewrite.txt (.../tags/lighttpd-1.4.20) (revision 2389)
2780 +++ doc/rewrite.txt (.../branches/lighttpd-1.4.x) (revision 2389)
2782 The options ``url.rewrite`` and ``url.rewrite-final`` were mapped to ``url.rewrite-once``
2788 +Do NOT use mod_rewrite to protect specific urls, as the original url passed from the client
2789 +is matched against your rules, for example strings like "/abc/../xyz%2f/path".
2795 ===================================================================
2796 --- SConstruct (.../tags/lighttpd-1.4.20) (revision 2389)
2797 +++ SConstruct (.../branches/lighttpd-1.4.x) (revision 2389)
2801 package = 'lighttpd'
2805 def checkCHeaders(autoconf, hdrs):
2806 p = re.compile('[^A-Z0-9]')
2808 ===================================================================
2809 --- Makefile.am (.../tags/lighttpd-1.4.20) (revision 2389)
2810 +++ Makefile.am (.../branches/lighttpd-1.4.x) (revision 2389)
2812 -SUBDIRS=src doc tests cygwin openwrt
2813 +SUBDIRS=src doc tests
2815 EXTRA_DIST=autogen.sh SConstruct
2818 ===================================================================
2819 --- NEWS (.../tags/lighttpd-1.4.20) (revision 2389)
2820 +++ NEWS (.../branches/lighttpd-1.4.x) (revision 2389)
2828 + * Fix base64 decoding in mod_auth (#1757, thx guido)
2829 + * Fix mod_cgi segfault when bound to unix domain socket (#653)
2830 + * Do not rely on ioctl FIONREAD (#673)
2831 + * Now really fix mod auth ldap (#1066)
2832 + * Fix leaving zombie process with include_shell (#1777)
2833 + * Removed debian/, openwrt/ and cygwin/; they weren't kept up-to-date, and we decided to remove dist. specific stuff
2834 + * Try to convert string options to shorts for numeric options in config file; allows to use env-vars for numeric options. (#1159, thx andrewb)
2835 + * Do not cache default vhost in mod_simple_vhost (#709)
2836 + * Trust pcre-config, do not check for pcre manually (#1769)
2837 + * Fix fastcgi authorization in subdirectories with check-local=disabled; don't split pathinfo for authorizer. (#963)
2838 + * Add possibility to disable methods in mod_compress (#1773)
2839 + * Fix duplicate connection keep-alive/transfer-encoding headers (#960)
2840 + * Fixed fix for round-robin in mod_proxy (forgot to increment the index) (#1715)
2841 + * Fix fastcgi-authorizer handling; Status: 200 is now accepted as the doc requests
2842 + * Compare address family in inet_ntop_cache
2843 + * Revert CVE-2008-4359 (#1720) fix "encoding+simplifying urls for rewrite/redirect": too many regressions.
2844 + * Use FD_CLOEXEC if possible (fixes #1821)
2845 + * Optimized buffer usage in mod_proxy (fixes #1850)
2846 + * Fix uninitialized value in time struct after strptime
2847 + * Do not pass Proxy-Connection: header from client to backend http server in mod_proxy (#1877)
2848 + * Fix wrong malloc sizes in mod_accesslog (probably nothing bad happened...) (fixes #1855, thx ycheng)
2849 + * Some small buffer.c fixes (closes #1837)
2850 + * Remove floating point math from server.c (fixes #1402)
2851 + * Disable SSLv2 by default
2852 + * Use/enforce sane max-connection values (fixes #1803)
2853 + * Allow mod_compress to return 304 (Not Modified); compress ignores the static-file.etags option.(fixes #1884)
2854 + * Add option to ignore the "Expect: 100-continue" header instead of returning 417 Expectation failed (closes #1017)
2855 + * Use modified etags in mod_compress (fixes #1800)
2856 + * Fix max-connection limit handling/100% cpu usage (fixes #1436)
2857 + * Fix error handling in freebsd-sendfile (fixes #1813)
2859 +- 1.4.20 - 2008-09-30
2861 * Fix mod_compress to compile with old gcc version (#1592)
2862 * Fix mod_extforward to compile with old gcc version (#1591)
2863 * Update documentation for #1587
2865 * allow digits in [s]cgi env vars (#1712)
2866 * fixed dropping last character of evhost pattern (#161)
2867 * print helpful error message on conditionals in global block (#1550)
2868 - * decode url before matching in mod_rewrite (#1720)
2869 + * decode url before matching in mod_rewrite (#1720) -- (reverted for 1.4.21)
2870 * fixed conditional patching of ldap filter (#1564)
2871 - * Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server)
2872 - * fixed bug with case-insensitive filenames in mod_userdir (#1589), spotted by "anders1"
2873 + * Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server) [2281]
2874 + * fixed bug with case-insensitive filenames in mod_userdir (#1589), spotted by "anders1" (CVE-2008-4360)
2875 * fixed format string bugs in mod_accesslog for SYSLOG
2876 * replaced fprintf with log_error_write in fastcgi debug
2877 * fixed mem leak in ssi expression parser (#1753), thx Take5k
2879 * fix splitting of auth-ldap filter
2880 * workaround ldap connection leak if a ldap connection failed (restarting ldap)
2881 * fix auth.backend.ldap.bind-dn/pw problems (only read from global context for temporary ldap reconnects, thx ruskie)
2882 - * fix memleak in request header parsing (#1774, thx qhy)
2883 + * fix memleak in request header parsing (#1774, thx qhy) (CVE-2008-4298)
2884 * fix mod_rewrite memleak/endless loop detection (#1775, thx phy - again!)
2885 - * use decoded url for matching in mod_redirect (#1720)
2886 + * use decoded url for matching in mod_redirect (#1720) (CVE-2008-4359) -- (reverted for 1.4.21)
2888 - 1.4.19 - 2008-03-10
2890 Index: CMakeLists.txt
2891 ===================================================================
2892 --- CMakeLists.txt (.../tags/lighttpd-1.4.20) (revision 0)
2893 +++ CMakeLists.txt (.../branches/lighttpd-1.4.x) (revision 2389)
2895 +PROJECT(lighttpd C)
2897 +CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0 FATAL_ERROR)
2899 +SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
2905 +SET(CPACK_PACKAGE_VERSION_MAJOR 1)
2906 +SET(CPACK_PACKAGE_VERSION_MINOR 4)
2907 +SET(CPACK_PACKAGE_VERSION_PATCH 21)
2908 +SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
2910 +SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
2911 +SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README")
2912 +SET(CPACK_PACKAGE_VENDOR "jan@kneschke.de")
2914 +SET(CPACK_SOURCE_GENERATOR "TGZ")
2915 +SET(CPACK_SOURCE_IGNORE_FILES "/\\\\.;~$;/_;build/;CMakeFiles/;CMakeCache;gz$;Makefile\\\\.;trace;Testing/;foo;autom4te;cmake_install;CPack;\\\\.pem;ltmain.sh;configure;libtool;/config\\\\.;missing;autogen.sh;install-sh;Dart;aclocal;log$;Makefile$")
2917 +SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
2919 +ADD_SUBDIRECTORY(src build)
2920 +#ADD_SUBDIRECTORY(doc)
2921 +ADD_SUBDIRECTORY(tests)
2923 Property changes on: .
2924 ___________________________________________________________________
2925 Modified: bzr:revision-info
2926 - timestamp: 2008-09-23 21:04:22.819999933 +0200
2927 committer: Stefan Bühler <stbuehler@web.de>
2929 branch-nick: lighttpd-1.4.x
2931 + timestamp: 2009-02-05 12:44:42.130000114 +0100
2932 committer: Stefan Bühler <stbuehler@web.de>
2934 branch-nick: lighttpd-1.4.x
2936 Modified: bzr:revision-id:v3-trunk0
2937 - 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
2938 1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
2939 1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
2940 1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
2941 1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
2942 1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
2943 1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
2944 1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
2945 1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
2946 1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
2947 1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
2948 1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
2949 1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
2950 1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
2951 1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
2952 1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
2953 1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
2954 1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
2955 1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
2956 1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
2957 1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
2958 1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
2959 1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
2960 1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
2961 1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
2962 1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
2963 1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
2964 1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
2965 1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
2966 1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
2967 1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
2968 1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
2969 1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
2970 1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
2971 1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
2972 1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
2973 1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
2974 1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
2975 1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
2976 1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
2977 1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
2978 1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
2979 1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
2980 1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
2981 1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
2982 1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
2983 1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
2984 1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
2985 1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
2987 + 1127 stbuehler@web.de-20080728081644-j4cxnhduw8kbt8um
2988 1128 stbuehler@web.de-20080728084246-axvxdtjsrratxixs
2989 1129 stbuehler@web.de-20080729211700-s8v6nq2cu06qesls
2990 1130 stbuehler@web.de-20080729211726-4yxb6e5dva1cn0lz
2991 1131 stbuehler@web.de-20080729211750-4ulzigswx17uciyu
2992 1132 stbuehler@web.de-20080729211850-nliz3kd0m576ztuu
2993 1133 stbuehler@web.de-20080730163440-dg2y2sbf0u4grmn4
2994 1134 stbuehler@web.de-20080730173952-kiutzg6geqy7mick
2995 1135 stbuehler@web.de-20080730193616-9kc2ms7rrhv1lkn7
2996 1136 stbuehler@web.de-20080730211457-z4a6uth1y29glbqh
2997 1137 stbuehler@web.de-20080730213517-b6sjcrdwbmipl334
2998 1138 stbuehler@web.de-20080731102617-2xw8unjfqic7lsew
2999 1139 stbuehler@web.de-20080731102703-q4tu5a6em9y8xdg0
3000 1140 stbuehler@web.de-20080731102729-l6vn5b05w9swqbg5
3001 1141 stbuehler@web.de-20080731102756-oj3d4tnk0l90mj77
3002 1142 stbuehler@web.de-20080731204442-blw14cj2fkr3l8ly
3003 1143 stbuehler@web.de-20080731204508-imtfnurf922mg7tj
3004 1144 stbuehler@web.de-20080801112347-girnwswdkwm8wuip
3005 1145 stbuehler@web.de-20080801161245-kx1temr529o7xko9
3006 1146 stbuehler@web.de-20080801175332-oc9e7x8edn1owcc0
3007 1147 stbuehler@web.de-20080801183454-5i66v0gsdv0cgmia
3008 1148 stbuehler@web.de-20080801192849-6zklfbb832sx0hvr
3009 1149 stbuehler@web.de-20080801203119-o16elp8w854s6lol
3010 1150 stbuehler@web.de-20080802162146-a4v57svc788pwdsv
3011 1151 stbuehler@web.de-20080802162202-9udlc1wuwt09pyh2
3012 1152 stbuehler@web.de-20080804135803-yuor9ze06px7qta4
3013 1153 stbuehler@web.de-20080812194728-fupt781o6q058unh
3014 1154 stbuehler@web.de-20080818162116-piz0ukqsaecv2li2
3015 1155 stbuehler@web.de-20080818235700-94t0xc6ml70zojwq
3016 1156 stbuehler@web.de-20080819163650-1qhwsqszr78cr4xx
3017 1157 stbuehler@web.de-20080819163757-1qq3t1f1wj69t8xs
3018 1158 stbuehler@web.de-20080819163914-rklhkurg8apv85l2
3019 1159 stbuehler@web.de-20080819163953-tlqew751e43phf5b
3020 1160 stbuehler@web.de-20080819164108-8ogh68sm1uyteawe
3021 1161 stbuehler@web.de-20080819173911-w5bqpb7cp9jmdqye
3022 1162 stbuehler@web.de-20080819222242-c0ta5gnli9p3j35a
3023 1163 stbuehler@web.de-20080820100730-g1bwdh4nqb53ag9u
3024 1164 stbuehler@web.de-20080820100752-9pggugdyfnnps8qu
3025 1165 stbuehler@web.de-20080820164258-v2j00motsrsc5esp
3026 1166 stbuehler@web.de-20080827144628-hi9hf4ch3n1wf9ao
3027 1167 stbuehler@web.de-20080827144903-tfxu4yehlyu5kegc
3028 1168 stbuehler@web.de-20080827155155-7mt92orehbxkh2lh
3029 1169 stbuehler@web.de-20080917142048-zbcwpk39q9ewd516
3030 1170 stbuehler@web.de-20080917142300-16gzt21x4nbjtj87
3031 1171 stbuehler@web.de-20080919160134-385anjnd3txxdw3x
3032 1172 stbuehler@web.de-20080920134142-fvvwaw2ys51dg4rj
3033 1173 stbuehler@web.de-20080921153311-1f7rn01atdilmxmy
3034 1174 stbuehler@web.de-20080922101346-wel327kjmykkpvmp
3035 1175 stbuehler@web.de-20080923190422-uow06l38ndue36o4
3036 1176 stbuehler@web.de-20080930112012-53jby2m8xslmd1hm
3037 1177 stbuehler@web.de-20080930134824-j9q72rwuiczzof5k
3038 1178 stbuehler@web.de-20080930142037-32pb6m3zjcwryw1w
3039 1179 stbuehler@web.de-20080930142756-ueovgoshyb996bce
3040 1180 stbuehler@web.de-20080930152935-1zfy67brol3xdbc0
3041 1181 stbuehler@web.de-20080930193919-13n2q4c6fbgw0dkx
3042 1182 stbuehler@web.de-20080930211152-4hmgs95wyg2deol7
3043 1183 stbuehler@web.de-20081001132402-hxnyu6yzyk3mjf4d
3044 1184 stbuehler@web.de-20081001155102-qf0mmu2kkpgr7xf0
3045 1185 stbuehler@web.de-20081001160009-n67ss0vzlac2y60k
3046 1186 stbuehler@web.de-20081001200802-l5og517etnneitk0
3047 1188 stbuehler@web.de-20081004160711-ygaohrecmutiqlla
3048 1189 stbuehler@web.de-20081004211932-vq16u26mthbeed7d
3049 1191 stbuehler@web.de-20081005224446-1bztt6zqrjh8w8fd
3050 1192 stbuehler@web.de-20081012114652-ihgz590f0gl5gxpw
3051 1193 stbuehler@web.de-20081012114716-jnzljhexi4z2gh92
3052 1195 stbuehler@web.de-20081016120614-kz39vxtz1pebho0o
3053 1196 stbuehler@web.de-20081016121103-trug4hts0o62d1ut
3054 1197 stbuehler@web.de-20081016121114-65quosenmso8frf8
3055 1198 stbuehler@web.de-20081016121421-xjjb7fb53pxu6odj
3056 1199 stbuehler@web.de-20081205222033-6qok7y19pwp3kxm9
3057 1200 stbuehler@web.de-20081205222811-49izmzxui0y9ncq6
3058 1201 stbuehler@web.de-20081205233903-708beaujtf26gprx
3059 1202 stbuehler@web.de-20081207151631-yv9bdf94zw83jxpv
3060 1203 stbuehler@web.de-20081207151822-mhyg0gkedmttdqvd
3061 1204 stbuehler@web.de-20081207151835-1m3yta2fjc4pgb8y
3062 1205 stbuehler@web.de-20081218221139-w8los43bjbhy9urh
3063 1206 stbuehler@web.de-20081218222305-5wz7000a62iqa81r
3064 1208 stbuehler@web.de-20090203201352-ivan8lsb3nkv1go5
3065 1209 stbuehler@web.de-20090203204231-03zjmk7qiol9yxgq
3066 1210 stbuehler@web.de-20090203210157-bx1e59fqple5oj3v
3067 1211 stbuehler@web.de-20090203221006-qd6w80m7lmeqgrjh
3068 1212 stbuehler@web.de-20090203225303-3dwmialad2u720h8
3069 1213 stbuehler@web.de-20090204102521-jl3vo2ftp5rsbx9y
3070 1214 stbuehler@web.de-20090204151616-n56of74dydkqdkgh
3071 1215 stbuehler@web.de-20090204172956-6wzsv0nm5nxcgfym
3072 1216 stbuehler@web.de-20090205105134-6i5key9439wspueq
3073 1217 stbuehler@web.de-20090205114017-0voscqjd5bdm9mwv
3074 1218 stbuehler@web.de-20090205114442-peekxwpevjl3t7j3