]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd-branch.diff
- update to 2054
[packages/lighttpd.git] / lighttpd-branch.diff
1 Index: configure.in
2 ===================================================================
3 Index: src/configfile-glue.c
4 ===================================================================
5 --- src/configfile-glue.c       (.../tags/lighttpd-1.4.18)      (revision 2054)
6 +++ src/configfile-glue.c       (.../branches/lighttpd-1.4.x)   (revision 2054)
7 @@ -341,6 +341,10 @@
8                 }
9                 break;
10         }
11 +       case COMP_HTTP_SCHEME:
12 +               l = con->uri.scheme;
13 +               break;
14 +
15         case COMP_HTTP_URL:
16                 l = con->uri.path;
17                 break;
18 Index: src/base.h
19 ===================================================================
20 --- src/base.h  (.../tags/lighttpd-1.4.18)      (revision 2054)
21 +++ src/base.h  (.../branches/lighttpd-1.4.x)   (revision 2054)
22 @@ -515,6 +515,7 @@
23  #ifdef USE_OPENSSL
24         SSL_CTX *ssl_ctx;
25  #endif
26 +       unsigned short is_proxy_ssl;
27  } server_socket;
28  
29  typedef struct {
30 Index: src/array.h
31 ===================================================================
32 --- src/array.h (.../tags/lighttpd-1.4.18)      (revision 2054)
33 +++ src/array.h (.../branches/lighttpd-1.4.x)   (revision 2054)
34 @@ -90,6 +90,7 @@
35         COMP_HTTP_COOKIE,
36         COMP_HTTP_REMOTEIP,
37         COMP_HTTP_QUERYSTRING,
38 +       COMP_HTTP_SCHEME,
39  
40         COMP_LAST_ELEMENT
41  } comp_key_t;
42 Index: src/mod_staticfile.c
43 ===================================================================
44 --- src/mod_staticfile.c        (.../tags/lighttpd-1.4.18)      (revision 2054)
45 +++ src/mod_staticfile.c        (.../branches/lighttpd-1.4.x)   (revision 2054)
46 @@ -483,8 +483,24 @@
47                         /* if the value is the same as our ETag, we do a Range-request,
48                          * otherwise a full 200 */
49  
50 -                       if (!buffer_is_equal(ds->value, con->physical.etag)) {
51 +                       if (ds->value->ptr[0] == '"') {
52 +                               /**
53 +                                * client wants a ETag
54 +                                */
55 +                               if (!con->physical.etag) {
56 +                                       do_range_request = 0;
57 +                               } else if (!buffer_is_equal(ds->value, con->physical.etag)) {
58 +                                       do_range_request = 0;
59 +                               }
60 +                       } else if (!mtime) {
61 +                               /**
62 +                                * we don't have a Last-Modified and can match the If-Range: 
63 +                                *
64 +                                * sending all
65 +                                */
66                                 do_range_request = 0;
67 +                       } else if (!buffer_is_equal(ds->value, mtime)) {
68 +                               do_range_request = 0;
69                         }
70                 }
71  
72 Index: src/mod_scgi.c
73 ===================================================================
74 --- src/mod_scgi.c      (.../tags/lighttpd-1.4.18)      (revision 2054)
75 +++ src/mod_scgi.c      (.../branches/lighttpd-1.4.x)   (revision 2054)
76 @@ -2694,8 +2694,9 @@
77                 if (s_len < ct_len) continue;
78  
79                 /* check extension in the form "/scgi_pattern" */
80 -               if (*(extension->key->ptr) == '/' && strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
81 -                       break;
82 +               if (*(extension->key->ptr) == '/') {
83 +                       if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0)
84 +                               break;
85                 } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
86                         /* check extension in the form ".fcg" */
87                         break;
88 Index: src/response.c
89 ===================================================================
90 --- src/response.c      (.../tags/lighttpd-1.4.18)      (revision 2054)
91 +++ src/response.c      (.../branches/lighttpd-1.4.x)   (revision 2054)
92 @@ -59,7 +59,8 @@
93                 ds = (data_string *)con->response.headers->data[i];
94  
95                 if (ds->value->used && ds->key->used &&
96 -                   0 != strncmp(ds->key->ptr, "X-LIGHTTPD-", sizeof("X-LIGHTTPD-") - 1)) {
97 +                   0 != strncmp(ds->key->ptr, "X-LIGHTTPD-", sizeof("X-LIGHTTPD-") - 1) &&
98 +                       0 != strncmp(ds->key->ptr, "X-Sendfile", sizeof("X-Sendfile") - 1)) {
99                         if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Date"))) have_date = 1;
100                         if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Server"))) have_server = 1;
101  
102 @@ -180,6 +181,7 @@
103                 buffer_copy_string_buffer(con->uri.authority, con->request.http_host);
104                 buffer_to_lower(con->uri.authority);
105  
106 +               config_patch_connection(srv, con, COMP_HTTP_SCHEME);    /* Scheme:      */
107                 config_patch_connection(srv, con, COMP_HTTP_HOST);      /* Host:        */
108                 config_patch_connection(srv, con, COMP_HTTP_REMOTEIP);  /* Client-IP */
109                 config_patch_connection(srv, con, COMP_HTTP_REFERER);   /* Referer:     */
110 Index: src/mod_proxy.c
111 ===================================================================
112 --- src/mod_proxy.c     (.../tags/lighttpd-1.4.18)      (revision 2054)
113 +++ src/mod_proxy.c     (.../branches/lighttpd-1.4.x)   (revision 2054)
114 @@ -1093,15 +1093,17 @@
115                 if (s_len < ct_len) continue;
116  
117                 /* check extension in the form "/proxy_pattern" */
118 -               if (*(extension->key->ptr) == '/' && strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
119 -                       if (s_len > ct_len + 1) {
120 -                               char *pi_offset;
121 +               if (*(extension->key->ptr) == '/') {
122 +                       if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
123 +                               if (s_len > ct_len + 1) {
124 +                                       char *pi_offset;
125  
126 -                               if (0 != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
127 -                                       path_info_offset = pi_offset - fn->ptr;
128 +                                       if (0 != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
129 +                                               path_info_offset = pi_offset - fn->ptr;
130 +                                       }
131                                 }
132 +                               break;
133                         }
134 -                       break;
135                 } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
136                         /* check extension in the form ".fcg" */
137                         break;
138 Index: src/mod_extforward.c
139 ===================================================================
140 --- src/mod_extforward.c        (.../tags/lighttpd-1.4.18)      (revision 2054)
141 +++ src/mod_extforward.c        (.../branches/lighttpd-1.4.x)   (revision 2054)
142 @@ -379,9 +379,15 @@
143  
144         if (real_remote_addr != NULL) { /* parsed */
145                 sock_addr sock;
146 -
147                 struct addrinfo *addrs_left;
148 +               server_socket *srv_sock = con->srv_socket;
149 +               data_string *forwarded_proto = (data_string *) array_get_element(con->request.headers,"X-Forwarded-Proto");
150  
151 +               if (forwarded_proto && !strcmp(forwarded_proto->value->ptr, "https"))
152 +                       srv_sock->is_proxy_ssl = 1;
153 +               else
154 +                       srv_sock->is_proxy_ssl = 0;
155 +
156                 if (con->conf.log_request_handling) {
157                         log_error_write(srv, __FILE__, __LINE__, "ss",
158                                         "using address:", real_remote_addr);
159 Index: src/Makefile.am
160 ===================================================================
161 --- src/Makefile.am     (.../tags/lighttpd-1.4.18)      (revision 2054)
162 +++ src/Makefile.am     (.../branches/lighttpd-1.4.x)   (revision 2054)
163 @@ -281,4 +281,4 @@
164  #ajp_SOURCES = ajp.c
165  
166  noinst_HEADERS   = $(hdr)
167 -EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c
168 +EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c SConscript
169 Index: src/configparser.y
170 ===================================================================
171 --- src/configparser.y  (.../tags/lighttpd-1.4.18)      (revision 2054)
172 +++ src/configparser.y  (.../branches/lighttpd-1.4.x)   (revision 2054)
173 @@ -422,6 +422,7 @@
174        { COMP_HTTP_COOKIE,        CONST_STR_LEN("HTTP[\"cookie\"]"     ) },
175        { COMP_HTTP_REMOTEIP,      CONST_STR_LEN("HTTP[\"remoteip\"]"   ) },
176        { COMP_HTTP_QUERYSTRING,   CONST_STR_LEN("HTTP[\"querystring\"]") },
177 +      { COMP_HTTP_SCHEME,        CONST_STR_LEN("HTTP[\"scheme\"]"     ) },
178        { COMP_UNSET, NULL, 0 },
179      };
180      size_t i;
181 Index: src/mod_status.c
182 ===================================================================
183 --- src/mod_status.c    (.../tags/lighttpd-1.4.18)      (revision 2054)
184 +++ src/mod_status.c    (.../branches/lighttpd-1.4.x)   (revision 2054)
185 @@ -560,6 +560,8 @@
186         double avg;
187         time_t ts;
188         char buf[32];
189 +       unsigned int k;
190 +       unsigned int l;
191  
192         b = chunkqueue_get_append_buffer(con->write_queue);
193  
194 @@ -588,6 +590,22 @@
195         buffer_append_long(b, srv->conns->used);
196         BUFFER_APPEND_STRING_CONST(b, "\n");
197  
198 +       BUFFER_APPEND_STRING_CONST(b, "IdleServers: ");
199 +       buffer_append_long(b, srv->conns->size - srv->conns->used);
200 +       BUFFER_APPEND_STRING_CONST(b, "\n");
201 +
202 +       /* output scoreboard */
203 +       BUFFER_APPEND_STRING_CONST(b, "Scoreboard: ");
204 +       for (k = 0; k < srv->conns->used; k++) {
205 +               connection *c = srv->conns->ptr[k];
206 +               const char *state = connection_get_short_state(c->state);
207 +               buffer_append_string_len(b, state, 1);
208 +       }
209 +       for (l = 0; l < srv->conns->size - srv->conns->used; l++) {
210 +               BUFFER_APPEND_STRING_CONST(b, "_");
211 +       }
212 +       BUFFER_APPEND_STRING_CONST(b, "\n");
213 +
214         /* set text/plain output */
215  
216         response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/plain"));
217 Index: src/mod_ssi.c
218 ===================================================================
219 --- src/mod_ssi.c       (.../tags/lighttpd-1.4.18)      (revision 2054)
220 +++ src/mod_ssi.c       (.../branches/lighttpd-1.4.x)   (revision 2054)
221 @@ -36,6 +36,11 @@
222  #include <sys/filio.h>
223  #endif
224  
225 +#include "etag.h"
226 +
227 +/* The newest modified time of included files for include statement */
228 +static volatile time_t include_file_last_mtime = 0;
229 +
230  /* init the plugin data */
231  INIT_FUNC(mod_ssi_init) {
232         plugin_data *p;
233 @@ -575,6 +580,11 @@
234                                 break;
235                         case SSI_INCLUDE:
236                                 chunkqueue_append_file(con->write_queue, p->stat_fn, 0, st.st_size);
237 +
238 +                               /* Keep the newest mtime of included files */
239 +                               if (st.st_mtime > include_file_last_mtime)
240 +                                 include_file_last_mtime = st.st_mtime;
241 +
242                                 break;
243                         }
244                 } else {
245 @@ -912,6 +922,9 @@
246         build_ssi_cgi_vars(srv, con, p);
247         p->if_is_false = 0;
248  
249 +       /* Reset the modified time of included files */
250 +       include_file_last_mtime = 0;
251 +
252         if (-1 == stream_open(&s, con->physical.path)) {
253                 log_error_write(srv, __FILE__, __LINE__, "sb",
254                                 "stream-open: ", con->physical.path);
255 @@ -1010,6 +1023,30 @@
256  
257         response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"));
258  
259 +       {
260 +       /* Generate "ETag" & "Last-Modified" headers */
261 +
262 +               stat_cache_entry *sce = NULL;
263 +               time_t lm_time = 0;
264 +               buffer *mtime = NULL;
265 +
266 +               stat_cache_get_entry(srv, con, con->physical.path, &sce);
267 +
268 +               etag_mutate(con->physical.etag, sce->etag);
269 +               response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag));
270 +
271 +               if (sce->st.st_mtime > include_file_last_mtime)
272 +                       lm_time = sce->st.st_mtime;
273 +               else
274 +                       lm_time = include_file_last_mtime;
275 +
276 +               mtime = strftime_cache_get(srv, lm_time);
277 +               response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime));
278 +       }
279 +
280 +       /* Reset the modified time of included files */
281 +       include_file_last_mtime = 0;
282 +
283         /* reset physical.path */
284         buffer_reset(con->physical.path);
285  
286 Index: src/spawn-fcgi.c
287 ===================================================================
288 --- src/spawn-fcgi.c    (.../tags/lighttpd-1.4.18)      (revision 2054)
289 +++ src/spawn-fcgi.c    (.../branches/lighttpd-1.4.x)   (revision 2054)
290 @@ -37,7 +37,7 @@
291  #endif
292  
293  #ifdef HAVE_SYS_UN_H
294 -int fcgi_spawn_connection(char *appPath, char *addr, unsigned short port, const char *unixsocket, int child_count, int pid_fd, int nofork) {
295 +int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int child_count, int pid_fd, int nofork) {
296         int fcgi_fd;
297         int socket_type, status;
298         struct timeval tv = { 0, 100 * 1000 };
299 @@ -137,11 +137,10 @@
300                 switch (child) {
301                 case 0: {
302                         char cgi_childs[64];
303 -                       char *b;
304  
305                         int i = 0;
306  
307 -                       /* is save as we limit to 256 childs */
308 +                       /* is safe as we limit to 256 childs */
309                         sprintf(cgi_childs, "PHP_FCGI_CHILDREN=%d", child_count);
310  
311                         if(fcgi_fd != FCGI_LISTENSOCK_FILENO) {
312 @@ -160,13 +159,18 @@
313                         putenv(cgi_childs);
314  
315                         /* fork and replace shell */
316 -                       b = malloc(strlen("exec ") + strlen(appPath) + 1);
317 -                       strcpy(b, "exec ");
318 -                       strcat(b, appPath);
319 +                       if (appArgv) {
320 +                               execv(appArgv[0], appArgv);
321  
322 -                       /* exec the cgi */
323 -                       execl("/bin/sh", "sh", "-c", b, (char *)NULL);
324 +                       } else {
325 +                               char *b = malloc(strlen("exec ") + strlen(appPath) + 1);
326 +                               strcpy(b, "exec ");
327 +                               strcat(b, appPath);
328  
329 +                               /* exec the cgi */
330 +                               execl("/bin/sh", "sh", "-c", b, (char *)NULL);
331 +                       }
332 +
333                         exit(errno);
334  
335                         break;
336 @@ -239,9 +243,12 @@
337  }
338  
339  void show_help () {
340 -       char *b = "spawn-fcgi" "-" PACKAGE_VERSION \
341 -" - spawns fastcgi processes\n" \
342 -"usage:\n" \
343 +       char *b = \
344 +"Usage: spawn-fcgi [options] -- <fcgiapp> [fcgi app arguments]\n" \
345 +"\n" \
346 +"spawn-fcgi v" PACKAGE_VERSION " - spawns fastcgi processes\n" \
347 +"\n" \
348 +"Options:\n" \
349  " -f <fcgiapp> filename of the fcgi-application\n" \
350  " -a <addr>    bind to ip address\n" \
351  " -p <port>    bind to tcp-port\n" \
352 @@ -264,6 +271,7 @@
353         char *fcgi_app = NULL, *changeroot = NULL, *username = NULL,
354                 *groupname = NULL, *unixsocket = NULL, *pid_file = NULL,
355                  *addr = NULL;
356 +       char **fcgi_app_argv = { NULL };
357         unsigned short port = 0;
358         int child_count = 5;
359         int i_am_root, o;
360 @@ -274,7 +282,7 @@
361  
362         i_am_root = (getuid() == 0);
363  
364 -       while(-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:s:P:"))) {
365 +       while(-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:s:P:"))) {
366                 switch(o) {
367                 case 'f': fcgi_app = optarg; break;
368                 case 'a': addr = optarg;/* ip addr */ break;
369 @@ -294,7 +302,11 @@
370                 }
371         }
372  
373 -       if (fcgi_app == NULL || (port == 0 && unixsocket == NULL)) {
374 +       if (optind < argc) {
375 +               fcgi_app_argv = &argv[optind];
376 +       }
377 +
378 +       if ((fcgi_app == NULL && fcgi_app_argv == NULL) || (port == 0 && unixsocket == NULL)) {
379                 show_help();
380                 return -1;
381         }
382 @@ -404,6 +416,18 @@
383                         }
384                 }
385  
386 +               /*
387 +                * Change group before chroot, when we have access
388 +                * to /etc/group
389 +                */
390 +               if (groupname) {
391 +                       setgid(grp->gr_gid);
392 +                       setgroups(0, NULL);
393 +                       if (username) {
394 +                               initgroups(username, grp->gr_gid);
395 +                       }
396 +               }
397 +
398                 if (changeroot) {
399                         if (-1 == chroot(changeroot)) {
400                                 fprintf(stderr, "%s.%d: %s %s\n",
401 @@ -420,18 +444,12 @@
402                 }
403  
404                 /* drop root privs */
405 -               if (groupname) {
406 -                       setgid(grp->gr_gid);
407 -               }
408                 if (username) {
409 -                       if (groupname) {
410 -                               initgroups(username, grp->gr_gid);
411 -                       }
412                         setuid(pwd->pw_uid);
413                 }
414         }
415  
416 -       return fcgi_spawn_connection(fcgi_app, addr, port, unixsocket, child_count, pid_fd, nofork);
417 +       return fcgi_spawn_connection(fcgi_app, fcgi_app_argv, addr, port, unixsocket, child_count, pid_fd, nofork);
418  }
419  #else
420  int main() {
421 Index: src/mod_auth.c
422 ===================================================================
423 --- src/mod_auth.c      (.../tags/lighttpd-1.4.18)      (revision 2054)
424 +++ src/mod_auth.c      (.../branches/lighttpd-1.4.x)   (revision 2054)
425 @@ -238,13 +238,13 @@
426                         int auth_type_len = auth_realm - http_authorization;
427  
428                         if ((auth_type_len == 5) &&
429 -                           (0 == strncmp(http_authorization, "Basic", auth_type_len))) {
430 +                           (0 == strncasecmp(http_authorization, "Basic", auth_type_len))) {
431  
432                                 if (0 == strcmp(method->value->ptr, "basic")) {
433                                         auth_satisfied = http_auth_basic_check(srv, con, p, req, con->uri.path, auth_realm+1);
434                                 }
435                         } else if ((auth_type_len == 6) &&
436 -                                  (0 == strncmp(http_authorization, "Digest", auth_type_len))) {
437 +                                  (0 == strncasecmp(http_authorization, "Digest", auth_type_len))) {
438                                 if (0 == strcmp(method->value->ptr, "digest")) {
439                                         if (-1 == (auth_satisfied = http_auth_digest_check(srv, con, p, req, con->uri.path, auth_realm+1))) {
440                                                 con->http_status = 400;
441 Index: src/mod_fastcgi.c
442 ===================================================================
443 --- src/mod_fastcgi.c   (.../tags/lighttpd-1.4.18)      (revision 2054)
444 +++ src/mod_fastcgi.c   (.../branches/lighttpd-1.4.x)   (revision 2054)
445 @@ -162,8 +162,8 @@
446          * if host is one of the local IP adresses the
447          * whole connection is local
448          *
449 -        * if tcp/ip should be used host AND port have
450 -        * to be specified
451 +        * if port is not 0, and host is not specified,
452 +        * "localhost" (INADDR_LOOPBACK) is assumed.
453          *
454          */
455         buffer *host;
456 @@ -823,12 +823,12 @@
457                 fcgi_addr_in.sin_family = AF_INET;
458  
459                 if (buffer_is_empty(host->host)) {
460 -                       fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
461 +                       fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
462                 } else {
463                         struct hostent *he;
464  
465                         /* set a useful default */
466 -                       fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ANY);
467 +                       fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
468  
469  
470                         if (NULL == (he = gethostbyname(host->host->ptr))) {
471 @@ -858,7 +858,11 @@
472                 fcgi_addr = (struct sockaddr *) &fcgi_addr_in;
473  
474                 buffer_copy_string(proc->connection_name, "tcp:");
475 -               buffer_append_string_buffer(proc->connection_name, host->host);
476 +               if (!buffer_is_empty(host->host)) {
477 +                       buffer_append_string_buffer(proc->connection_name, host->host);
478 +               } else {
479 +                       buffer_append_string(proc->connection_name, "localhost");
480 +               }
481                 buffer_append_string(proc->connection_name, ":");
482                 buffer_append_long(proc->connection_name, proc->port);
483         }
484 @@ -1687,12 +1691,16 @@
485  #endif
486         } else {
487                 fcgi_addr_in.sin_family = AF_INET;
488 -               if (0 == inet_aton(host->host->ptr, &(fcgi_addr_in.sin_addr))) {
489 -                       log_error_write(srv, __FILE__, __LINE__, "sbs",
490 -                                       "converting IP address failed for", host->host,
491 -                                       "\nBe sure to specify an IP address here");
492 -
493 -                       return -1;
494 +               if (!buffer_is_empty(host->host)) {
495 +                       if (0 == inet_aton(host->host->ptr, &(fcgi_addr_in.sin_addr))) {
496 +                               log_error_write(srv, __FILE__, __LINE__, "sbs",
497 +                                               "converting IP address failed for", host->host,
498 +                                               "\nBe sure to specify an IP address here");
499 +       
500 +                               return -1;
501 +                       }
502 +               } else {
503 +                       fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
504                 }
505                 fcgi_addr_in.sin_port = htons(proc->port);
506                 servlen = sizeof(fcgi_addr_in);
507 @@ -1702,7 +1710,11 @@
508                 if (buffer_is_empty(proc->connection_name)) {
509                         /* on remote spawing we have to set the connection-name now */
510                         buffer_copy_string(proc->connection_name, "tcp:");
511 -                       buffer_append_string_buffer(proc->connection_name, host->host);
512 +                       if (!buffer_is_empty(host->host)) {
513 +                               buffer_append_string_buffer(proc->connection_name, host->host);
514 +                       } else {
515 +                               buffer_append_string(proc->connection_name, "localhost");
516 +                       }
517                         buffer_append_string(proc->connection_name, ":");
518                         buffer_append_long(proc->connection_name, proc->port);
519                 }
520 @@ -2045,13 +2057,10 @@
521         s = get_http_version_name(con->request.http_version);
522         FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_PROTOCOL"), s, strlen(s)),con)
523  
524 -#ifdef USE_OPENSSL
525 -       if (srv_sock->is_ssl) {
526 +    if (srv_sock->is_ssl || srv_sock->is_proxy_ssl) {
527                 FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("HTTPS"), CONST_STR_LEN("on")),con)
528         }
529 -#endif
530  
531 -
532         FCGI_ENV_ADD_CHECK(fcgi_env_add_request_headers(srv, con, p), con);
533  
534         fcgi_header(&(header), FCGI_PARAMS, request_id, p->fcgi_env->used, 0);
535 @@ -2530,15 +2539,28 @@
536                                 }
537  
538                                 if (host->allow_xsendfile &&
539 -                                   NULL != (ds = (data_string *) array_get_element(con->response.headers, "X-LIGHTTPD-send-file"))) {
540 +                                   (NULL != (ds = (data_string *) array_get_element(con->response.headers, "X-LIGHTTPD-send-file"))
541 +                                         || NULL != (ds = (data_string *) array_get_element(con->response.headers, "X-Sendfile")))) {
542                                         stat_cache_entry *sce;
543  
544                                         if (HANDLER_ERROR != stat_cache_get_entry(srv, con, ds->value, &sce)) {
545 +                                               data_string *dcls = data_string_init();
546                                                 /* found */
547 -
548                                                 http_chunk_append_file(srv, con, ds->value, 0, sce->st.st_size);
549                                                 hctx->send_content_body = 0; /* ignore the content */
550                                                 joblist_append(srv, con);
551 +
552 +                                               buffer_copy_string_len(dcls->key, "Content-Length", sizeof("Content-Length")-1);
553 +                                               buffer_copy_long(dcls->value, sce->st.st_size);
554 +                                               dcls = (data_string*) array_replace(con->response.headers, (data_unset *)dcls);
555 +                                               if (dcls) dcls->free((data_unset*)dcls);
556 +
557 +                                               con->parsed_response |= HTTP_CONTENT_LENGTH;
558 +                                               con->response.content_length = sce->st.st_size;
559 +                                       } else {
560 +                                               log_error_write(srv, __FILE__, __LINE__, "sb",
561 +                                                       "send-file error: couldn't get stat_cache entry for:",
562 +                                                       ds->value);
563                                         }
564                                 }
565  
566 @@ -2719,9 +2741,14 @@
567  
568         int ret;
569  
570 -       /* sanity check */
571 +       /* sanity check:
572 +        *  - host != NULL
573 +        *  - either:
574 +        *     - tcp socket (do not check host->host->uses, as it may be not set which means INADDR_LOOPBACK)
575 +        *     - unix socket
576 +        */
577         if (!host ||
578 -           ((!host->host->used || !host->port) && !host->unixsocket->used)) {
579 +           (!host->port && !host->unixsocket->used)) {
580                 log_error_write(srv, __FILE__, __LINE__, "sxddd",
581                                 "write-req: error",
582                                 host,
583 @@ -3456,8 +3483,9 @@
584                         if (s_len < ct_len) continue;
585  
586                         /* check extension in the form "/fcgi_pattern" */
587 -                       if (*(extension->key->ptr) == '/' && strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
588 -                               break;
589 +                       if (*(extension->key->ptr) == '/') {
590 +                               if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0)
591 +                                       break;
592                         } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
593                                 /* check extension in the form ".fcg" */
594                                 break;
595 @@ -3473,7 +3501,7 @@
596         for (k = 0; k < extension->used; k++) {
597                 host = extension->hosts[k];
598  
599 -               /* we should have at least one proc that can do somthing */
600 +               /* we should have at least one proc that can do something */
601                 if (host->active_procs == 0) {
602                         host = NULL;
603  
604 Index: src/server.c
605 ===================================================================
606 --- src/server.c        (.../tags/lighttpd-1.4.18)      (revision 2054)
607 +++ src/server.c        (.../branches/lighttpd-1.4.x)   (revision 2054)
608 @@ -759,6 +759,19 @@
609  
610                         return -1;
611                 }
612 +#ifdef HAVE_PWD_H
613 +               /* 
614 +                * Change group before chroot, when we have access
615 +                * to /etc/group
616 +                * */
617 +               if (srv->srvconf.groupname->used) {
618 +                       setgid(grp->gr_gid);
619 +                       setgroups(0, NULL);
620 +                       if (srv->srvconf.username->used) {
621 +                               initgroups(srv->srvconf.username->ptr, grp->gr_gid);
622 +                       }
623 +               }
624 +#endif
625  #ifdef HAVE_CHROOT
626                 if (srv->srvconf.changeroot->used) {
627                         tzset();
628 @@ -775,15 +788,7 @@
629  #endif
630  #ifdef HAVE_PWD_H
631                 /* drop root privs */
632 -               if (srv->srvconf.groupname->used) {
633 -                       setgid(grp->gr_gid);
634 -                       setgroups(0, NULL);
635 -               }
636 -
637                 if (srv->srvconf.username->used) {
638 -                       if (srv->srvconf.groupname->used) {
639 -                               initgroups(srv->srvconf.username->ptr, grp->gr_gid);
640 -                       }
641                         setuid(pwd->pw_uid);
642                 }
643  #endif
644 @@ -891,6 +896,17 @@
645                 pid_fd = -1;
646         }
647  
648 +       // Close stderr ASAP in the child process to make sure that nothing
649 +       // is being written to that fd which may not be valid anymore.
650 +       if (-1 == log_error_open(srv)) {
651 +               log_error_write(srv, __FILE__, __LINE__, "s", "Opening errorlog failed. Going down.");
652 +
653 +               plugins_free(srv);
654 +               network_close(srv);
655 +               server_free(srv);
656 +               return -1;
657 +       }
658 +
659         if (HANDLER_GO_ON != plugins_call_set_defaults(srv)) {
660                 log_error_write(srv, __FILE__, __LINE__, "s", "Configuration of plugins failed. Going down.");
661  
662 @@ -941,15 +957,7 @@
663                 return -1;
664         }
665  
666 -       if (-1 == log_error_open(srv)) {
667 -               log_error_write(srv, __FILE__, __LINE__, "s",
668 -                               "opening errorlog failed, dying");
669  
670 -               plugins_free(srv);
671 -               network_close(srv);
672 -               server_free(srv);
673 -               return -1;
674 -       }
675  
676  
677  #ifdef HAVE_SIGACTION
678 Index: tests/mod-access.t
679 ===================================================================
680 --- tests/mod-access.t  (.../tags/lighttpd-1.4.18)      (revision 2054)
681 +++ tests/mod-access.t  (.../branches/lighttpd-1.4.x)   (revision 2054)
682 @@ -1,9 +1,9 @@
683  #!/usr/bin/env perl
684  BEGIN {
685 -    # add current source dir to the include-path
686 -    # we need this for make distcheck
687 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
688 -   unshift @INC, $srcdir;
689 +       # add current source dir to the include-path
690 +       # we need this for make distcheck
691 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
692 +       unshift @INC, $srcdir;
693  }
694  
695  use strict;
696 Index: tests/mod-auth.t
697 ===================================================================
698 --- tests/mod-auth.t    (.../tags/lighttpd-1.4.18)      (revision 2054)
699 +++ tests/mod-auth.t    (.../branches/lighttpd-1.4.x)   (revision 2054)
700 @@ -1,14 +1,14 @@
701  #!/usr/bin/env perl
702  BEGIN {
703 -    # add current source dir to the include-path
704 -    # we need this for make distcheck
705 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
706 -   unshift @INC, $srcdir;
707 +       # add current source dir to the include-path
708 +       # we need this for make distcheck
709 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
710 +       unshift @INC, $srcdir;
711  }
712  
713  use strict;
714  use IO::Socket;
715 -use Test::More tests => 13;
716 +use Test::More tests => 14;
717  use LightyTest;
718  
719  my $tf = LightyTest->new();
720 @@ -48,6 +48,16 @@
721  $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
722  ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (des)');
723  
724 +$t->{REQUEST}  = ( <<EOF
725 +GET /server-config HTTP/1.0
726 +Host: auth-htpasswd.example.org
727 +Authorization: basic ZGVzOmRlcw==
728 +EOF
729 + );
730 +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
731 +ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (des) (lowercase)');
732 +
733 +
734  SKIP: {
735         skip "no md5 for crypt under cygwin", 1 if $^O eq 'cygwin';
736  $t->{REQUEST}  = ( <<EOF
737 Index: tests/mod-secdownload.t
738 ===================================================================
739 Index: tests/core-response.t
740 ===================================================================
741 --- tests/core-response.t       (.../tags/lighttpd-1.4.18)      (revision 2054)
742 +++ tests/core-response.t       (.../branches/lighttpd-1.4.x)   (revision 2054)
743 @@ -1,10 +1,9 @@
744  #!/usr/bin/env perl
745 -
746  BEGIN {
747 -    # add current source dir to the include-path
748 -    # we need this for make distcheck
749 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
750 -   unshift @INC, $srcdir;
751 +       # add current source dir to the include-path
752 +       # we need this for make distcheck
753 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
754 +       unshift @INC, $srcdir;
755  }
756  
757  use strict;
758 Index: tests/mod-extforward.conf
759 ===================================================================
760 --- tests/mod-extforward.conf   (.../tags/lighttpd-1.4.18)      (revision 0)
761 +++ tests/mod-extforward.conf   (.../branches/lighttpd-1.4.x)   (revision 2054)
762 @@ -0,0 +1,30 @@
763 +debug.log-request-handling   = "enable"
764 +debug.log-response-header   = "enable"
765 +debug.log-request-header   = "enable"
766 +
767 +server.document-root         = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
768 +server.pid-file              = env.SRCDIR + "/tmp/lighttpd/lighttpd.pid"
769 +
770 +## bind to port (default: 80)
771 +server.port                 = 2048
772 +
773 +## bind to localhost (default: all interfaces)
774 +server.bind                = "localhost"
775 +server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
776 +server.name                = "www.example.org"
777 +server.tag                 = "Apache 1.3.29"
778 +
779 +server.modules = (
780 +       "mod_cgi",
781 +       "mod_extforward"
782 +)
783 +
784 +######################## MODULE CONFIG ############################
785 +
786 +mimetype.assign             = ( ".html" => "text/html" )
787 +
788 +cgi.assign = (".pl" => "/usr/bin/perl" )
789 +
790 +extforward.forwarder = (
791 +       "127.0.0.1" => "trust",
792 +)
793 Index: tests/symlink.t
794 ===================================================================
795 Index: tests/request.t
796 ===================================================================
797 --- tests/request.t     (.../tags/lighttpd-1.4.18)      (revision 2054)
798 +++ tests/request.t     (.../branches/lighttpd-1.4.x)   (revision 2054)
799 @@ -1,9 +1,9 @@
800  #!/usr/bin/env perl
801  BEGIN {
802 -    # add current source dir to the include-path
803 -    # we need this for make distcheck
804 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
805 -   unshift @INC, $srcdir;
806 +       # add current source dir to the include-path
807 +       # we need this for make distcheck
808 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
809 +       unshift @INC, $srcdir;
810  }
811  
812  use strict;
813 Index: tests/mod-userdir.t
814 ===================================================================
815 --- tests/mod-userdir.t (.../tags/lighttpd-1.4.18)      (revision 2054)
816 +++ tests/mod-userdir.t (.../branches/lighttpd-1.4.x)   (revision 2054)
817 @@ -1,9 +1,9 @@
818  #!/usr/bin/env perl
819  BEGIN {
820 -    # add current source dir to the include-path
821 -    # we need this for make distcheck
822 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
823 -   unshift @INC, $srcdir;
824 +       # add current source dir to the include-path
825 +       # we need this for make distcheck
826 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
827 +       unshift @INC, $srcdir;
828  }
829  
830  use strict;
831 Index: tests/core-keepalive.t
832 ===================================================================
833 --- tests/core-keepalive.t      (.../tags/lighttpd-1.4.18)      (revision 2054)
834 +++ tests/core-keepalive.t      (.../branches/lighttpd-1.4.x)   (revision 2054)
835 @@ -1,10 +1,9 @@
836  #!/usr/bin/env perl
837 -
838  BEGIN {
839 -    # add current source dir to the include-path
840 -    # we need this for make distcheck
841 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
842 -   unshift @INC, $srcdir;
843 +       # add current source dir to the include-path
844 +       # we need this for make distcheck
845 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
846 +       unshift @INC, $srcdir;
847  }
848  
849  use strict;
850 Index: tests/mod-proxy.t
851 ===================================================================
852 Index: tests/env-variables.t
853 ===================================================================
854 Index: tests/core-var-include.t
855 ===================================================================
856 --- tests/core-var-include.t    (.../tags/lighttpd-1.4.18)      (revision 2054)
857 +++ tests/core-var-include.t    (.../branches/lighttpd-1.4.x)   (revision 2054)
858 @@ -1,9 +1,9 @@
859  #!/usr/bin/env perl
860  BEGIN {
861 -    # add current source dir to the include-path
862 -    # we need this for make distcheck
863 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
864 -   unshift @INC, $srcdir;
865 +       # add current source dir to the include-path
866 +       # we need this for make distcheck
867 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
868 +       unshift @INC, $srcdir;
869  }
870  
871  use strict;
872 Index: tests/mod-extforward.t
873 ===================================================================
874 --- tests/mod-extforward.t      (.../tags/lighttpd-1.4.18)      (revision 0)
875 +++ tests/mod-extforward.t      (.../branches/lighttpd-1.4.x)   (revision 2054)
876 @@ -0,0 +1,41 @@
877 +#!/usr/bin/env perl
878 +BEGIN {
879 +       # add current source dir to the include-path
880 +       # we need this for make distcheck
881 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
882 +       unshift @INC, $srcdir;
883 +}
884 +
885 +use strict;
886 +use IO::Socket;
887 +use Test::More tests => 2;
888 +use LightyTest;
889 +
890 +my $tf = LightyTest->new();
891 +my $t;
892 +
893 +$tf->{CONFIGFILE} = 'mod-extforward.conf';
894 +
895 +ok($tf->start_proc == 0, "Starting lighttpd") or die();
896 +
897 +## check if If-Modified-Since, If-None-Match works
898 +
899 +$t->{REQUEST} = ( <<EOF
900 +GET /ip.pl HTTP/1.0
901 +Host: www.example.org
902 +X-Forwarded-For: 127.0.10.1
903 +EOF
904 +);
905 +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '127.0.10.1' } ];
906 +ok($tf->handle_http($t) == 0, 'expect 127.0.10.1');
907 +
908 +$t->{REQUEST} = ( <<EOF
909 +GET /ip.pl HTTP/1.0
910 +Host: www.example.org
911 +X-Forwarded-For: 127.0.10.1, 127.0.20.1
912 +EOF
913 +);
914 +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '127.0.20.1' } ];
915 +ok($tf->handle_http($t) == 0, 'expect 127.0.20.1');
916 +
917 +ok($tf->stop_proc == 0, "Stopping lighttpd");
918
919 Property changes on: tests/mod-extforward.t
920 ___________________________________________________________________
921 Name: svn:executable
922    + *
923
924 Index: tests/core-request.t
925 ===================================================================
926 --- tests/core-request.t        (.../tags/lighttpd-1.4.18)      (revision 2054)
927 +++ tests/core-request.t        (.../branches/lighttpd-1.4.x)   (revision 2054)
928 @@ -1,9 +1,9 @@
929  #!/usr/bin/env perl
930  BEGIN {
931 -    # add current source dir to the include-path
932 -    # we need this for make distcheck
933 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
934 -   unshift @INC, $srcdir;
935 +       # add current source dir to the include-path
936 +       # we need this for make distcheck
937 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
938 +       unshift @INC, $srcdir;
939  }
940  
941  use strict;
942 Index: tests/mod-redirect.t
943 ===================================================================
944 --- tests/mod-redirect.t        (.../tags/lighttpd-1.4.18)      (revision 2054)
945 +++ tests/mod-redirect.t        (.../branches/lighttpd-1.4.x)   (revision 2054)
946 @@ -1,9 +1,9 @@
947  #!/usr/bin/env perl
948  BEGIN {
949 -    # add current source dir to the include-path
950 -    # we need this for make distcheck
951 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
952 -   unshift @INC, $srcdir;
953 +       # add current source dir to the include-path
954 +       # we need this for make distcheck
955 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
956 +       unshift @INC, $srcdir;
957  }
958  
959  use strict;
960 Index: tests/mod-cgi.t
961 ===================================================================
962 --- tests/mod-cgi.t     (.../tags/lighttpd-1.4.18)      (revision 2054)
963 +++ tests/mod-cgi.t     (.../branches/lighttpd-1.4.x)   (revision 2054)
964 @@ -1,9 +1,9 @@
965  #!/usr/bin/env perl
966  BEGIN {
967 -    # add current source dir to the include-path
968 -    # we need this for make distcheck
969 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
970 -   unshift @INC, $srcdir;
971 +       # add current source dir to the include-path
972 +       # we need this for make distcheck
973 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
974 +       unshift @INC, $srcdir;
975  }
976  
977  use strict;
978 Index: tests/mod-setenv.t
979 ===================================================================
980 --- tests/mod-setenv.t  (.../tags/lighttpd-1.4.18)      (revision 2054)
981 +++ tests/mod-setenv.t  (.../branches/lighttpd-1.4.x)   (revision 2054)
982 @@ -1,10 +1,9 @@
983  #!/usr/bin/env perl
984 -
985  BEGIN {
986 -    # add current source dir to the include-path
987 -    # we need this for make distcheck
988 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
989 -   unshift @INC, $srcdir;
990 +       # add current source dir to the include-path
991 +       # we need this for make distcheck
992 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
993 +       unshift @INC, $srcdir;
994  }
995  
996  use strict;
997 Index: tests/cachable.t
998 ===================================================================
999 --- tests/cachable.t    (.../tags/lighttpd-1.4.18)      (revision 2054)
1000 +++ tests/cachable.t    (.../branches/lighttpd-1.4.x)   (revision 2054)
1001 @@ -1,9 +1,9 @@
1002  #!/usr/bin/env perl
1003  BEGIN {
1004 -    # add current source dir to the include-path
1005 -    # we need this for make distcheck
1006 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
1007 -   unshift @INC, $srcdir;
1008 +       # add current source dir to the include-path
1009 +       # we need this for make distcheck
1010 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
1011 +       unshift @INC, $srcdir;
1012  }
1013  
1014  use strict;
1015 Index: tests/lowercase.t
1016 ===================================================================
1017 --- tests/lowercase.t   (.../tags/lighttpd-1.4.18)      (revision 2054)
1018 +++ tests/lowercase.t   (.../branches/lighttpd-1.4.x)   (revision 2054)
1019 @@ -1,9 +1,9 @@
1020  #!/usr/bin/env perl
1021  BEGIN {
1022 -    # add current source dir to the include-path
1023 -    # we need this for make distcheck
1024 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
1025 -   unshift @INC, $srcdir;
1026 +       # add current source dir to the include-path
1027 +       # we need this for make distcheck
1028 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
1029 +       unshift @INC, $srcdir;
1030  }
1031  
1032  use strict;
1033 Index: tests/core.t
1034 ===================================================================
1035 --- tests/core.t        (.../tags/lighttpd-1.4.18)      (revision 2054)
1036 +++ tests/core.t        (.../branches/lighttpd-1.4.x)   (revision 2054)
1037 @@ -1,10 +1,9 @@
1038  #!/usr/bin/env perl
1039 -
1040  BEGIN {
1041 -    # add current source dir to the include-path
1042 -    # we need this for make distcheck
1043 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
1044 -   unshift @INC, $srcdir;
1045 +       # add current source dir to the include-path
1046 +       # we need this for make distcheck
1047 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
1048 +       unshift @INC, $srcdir;
1049  }
1050  
1051  use strict;
1052 Index: tests/mod-fastcgi.t
1053 ===================================================================
1054 --- tests/mod-fastcgi.t (.../tags/lighttpd-1.4.18)      (revision 2054)
1055 +++ tests/mod-fastcgi.t (.../branches/lighttpd-1.4.x)   (revision 2054)
1056 @@ -1,9 +1,9 @@
1057  #!/usr/bin/env perl
1058  BEGIN {
1059 -    # add current source dir to the include-path
1060 -    # we need this for make distcheck
1061 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
1062 -   unshift @INC, $srcdir;
1063 +       # add current source dir to the include-path
1064 +       # we need this for make distcheck
1065 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
1066 +       unshift @INC, $srcdir;
1067  }
1068  
1069  use strict;
1070 Index: tests/mod-rewrite.t
1071 ===================================================================
1072 --- tests/mod-rewrite.t (.../tags/lighttpd-1.4.18)      (revision 2054)
1073 +++ tests/mod-rewrite.t (.../branches/lighttpd-1.4.x)   (revision 2054)
1074 @@ -1,9 +1,9 @@
1075  #!/usr/bin/env perl
1076  BEGIN {
1077 -    # add current source dir to the include-path
1078 -    # we need this for make distcheck
1079 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
1080 -   unshift @INC, $srcdir;
1081 +       # add current source dir to the include-path
1082 +       # we need this for make distcheck
1083 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
1084 +       unshift @INC, $srcdir;
1085  }
1086  
1087  use strict;
1088 Index: tests/docroot/www/ip.pl
1089 ===================================================================
1090 --- tests/docroot/www/ip.pl     (.../tags/lighttpd-1.4.18)      (revision 0)
1091 +++ tests/docroot/www/ip.pl     (.../branches/lighttpd-1.4.x)   (revision 2054)
1092 @@ -0,0 +1,5 @@
1093 +#!/usr/bin/perl
1094 +print "Content-Type: text/html\r\n\r\n";
1095 +print $ENV{'REMOTE_ADDR'};
1096 +
1097 +0;
1098
1099 Property changes on: tests/docroot/www/ip.pl
1100 ___________________________________________________________________
1101 Name: svn:executable
1102    + *
1103
1104 Index: tests/Makefile.am
1105 ===================================================================
1106 --- tests/Makefile.am   (.../tags/lighttpd-1.4.18)      (revision 2054)
1107 +++ tests/Makefile.am   (.../branches/lighttpd-1.4.x)   (revision 2054)
1108 @@ -31,14 +31,20 @@
1109        core-response.t \
1110        core-keepalive.t \
1111        core.t \
1112 +         mod-proxy.t \
1113 +         proxy.conf \
1114 +         mod-secdownload.t \
1115        mod-access.t \
1116        mod-auth.t \
1117        mod-cgi.t \
1118        mod-compress.t \
1119        mod-fastcgi.t \
1120        mod-redirect.t \
1121 +      mod-rewrite.t \
1122        mod-userdir.t \
1123 -      mod-rewrite.t \
1124 +         env-variables.t \
1125 +         env-variables.conf \
1126 +         symlink.t \
1127        request.t \
1128        mod-ssi.t \
1129        LightyTest.pm \
1130 @@ -49,12 +55,12 @@
1131        core-404-handler.t \
1132        404-handler.conf
1133  
1134 -
1135  TESTS_ENVIRONMENT=$(srcdir)/wrapper.sh $(srcdir) $(top_builddir)
1136  
1137  EXTRA_DIST=wrapper.sh lighttpd.conf \
1138         lighttpd.user \
1139         lighttpd.htpasswd \
1140 +       SConscript \
1141         $(CONFS) \
1142         $(TESTS)
1143  
1144 Index: tests/core-404-handler.t
1145 ===================================================================
1146 --- tests/core-404-handler.t    (.../tags/lighttpd-1.4.18)      (revision 2054)
1147 +++ tests/core-404-handler.t    (.../branches/lighttpd-1.4.x)   (revision 2054)
1148 @@ -10,10 +10,10 @@
1149  #   returning no status -> 200
1150  #
1151  BEGIN {
1152 -    # add current source dir to the include-path
1153 -    # we need this for make distcheck
1154 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
1155 -   unshift @INC, $srcdir;
1156 +       # add current source dir to the include-path
1157 +       # we need this for make distcheck
1158 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
1159 +       unshift @INC, $srcdir;
1160  }
1161  
1162  use strict;
1163 Index: tests/mod-compress.t
1164 ===================================================================
1165 --- tests/mod-compress.t        (.../tags/lighttpd-1.4.18)      (revision 2054)
1166 +++ tests/mod-compress.t        (.../branches/lighttpd-1.4.x)   (revision 2054)
1167 @@ -1,9 +1,9 @@
1168  #!/usr/bin/env perl
1169  BEGIN {
1170 -    # add current source dir to the include-path
1171 -    # we need this for make distcheck
1172 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
1173 -   unshift @INC, $srcdir;
1174 +       # add current source dir to the include-path
1175 +       # we need this for make distcheck
1176 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
1177 +       unshift @INC, $srcdir;
1178  }
1179  
1180  use strict;
1181 Index: tests/mod-ssi.t
1182 ===================================================================
1183 --- tests/mod-ssi.t     (.../tags/lighttpd-1.4.18)      (revision 2054)
1184 +++ tests/mod-ssi.t     (.../branches/lighttpd-1.4.x)   (revision 2054)
1185 @@ -1,9 +1,9 @@
1186  #!/usr/bin/env perl
1187  BEGIN {
1188 -    # add current source dir to the include-path
1189 -    # we need this for make distcheck
1190 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
1191 -   unshift @INC, $srcdir;
1192 +       # add current source dir to the include-path
1193 +       # we need this for make distcheck
1194 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
1195 +       unshift @INC, $srcdir;
1196  }
1197  
1198  use strict;
1199 Index: tests/core-condition.t
1200 ===================================================================
1201 --- tests/core-condition.t      (.../tags/lighttpd-1.4.18)      (revision 2054)
1202 +++ tests/core-condition.t      (.../branches/lighttpd-1.4.x)   (revision 2054)
1203 @@ -1,9 +1,9 @@
1204  #!/usr/bin/env perl
1205  BEGIN {
1206 -    # add current source dir to the include-path
1207 -    # we need this for make distcheck
1208 -   (my $srcdir = $0) =~ s#/[^/]+$#/#;
1209 -   unshift @INC, $srcdir;
1210 +       # add current source dir to the include-path
1211 +       # we need this for make distcheck
1212 +       (my $srcdir = $0) =~ s,/[^/]+$,/,;
1213 +       unshift @INC, $srcdir;
1214  }
1215  
1216  use strict;
1217 Index: doc/configuration.txt
1218 ===================================================================
1219 --- doc/configuration.txt       (.../tags/lighttpd-1.4.18)      (revision 2054)
1220 +++ doc/configuration.txt       (.../branches/lighttpd-1.4.x)   (revision 2054)
1221 @@ -85,6 +85,8 @@
1222  
1223  $HTTP["cookie"]
1224    match on cookie
1225 +$HTTP["scheme"]
1226 +  match on scheme
1227  $HTTP["host"]
1228    match on host
1229  $HTTP["useragent"]
1230 Index: doc/lighttpd.conf
1231 ===================================================================
1232 --- doc/lighttpd.conf   (.../tags/lighttpd-1.4.18)      (revision 2054)
1233 +++ doc/lighttpd.conf   (.../branches/lighttpd-1.4.x)   (revision 2054)
1234 @@ -72,6 +72,7 @@
1235    ".ogg"          =>      "application/ogg",
1236    ".wav"          =>      "audio/x-wav",
1237    ".gif"          =>      "image/gif",
1238 +  ".jar"          =>      "application/x-java-archive",
1239    ".jpg"          =>      "image/jpeg",
1240    ".jpeg"         =>      "image/jpeg",
1241    ".png"          =>      "image/png",
1242 Index: SConstruct
1243 ===================================================================
1244 Index: Makefile.am
1245 ===================================================================
1246 --- Makefile.am (.../tags/lighttpd-1.4.18)      (revision 2054)
1247 +++ Makefile.am (.../branches/lighttpd-1.4.x)   (revision 2054)
1248 @@ -1,3 +1,3 @@
1249  SUBDIRS=src doc tests cygwin openwrt
1250  
1251 -EXTRA_DIST=lighttpd.spec
1252 +EXTRA_DIST=lighttpd.spec autogen.sh SConstruct
1253 Index: NEWS
1254 ===================================================================
1255 --- NEWS        (.../tags/lighttpd-1.4.18)      (revision 2054)
1256 +++ NEWS        (.../branches/lighttpd-1.4.x)   (revision 2054)
1257 @@ -3,6 +3,23 @@
1258  NEWS
1259  ====
1260  
1261 +- 1.4.19 -
1262 +
1263 +  * added support for If-Range: <date> (#1346)
1264 +  * added support for matching $HTTP["scheme"] in configs
1265 +  * fixed initgroups() called after chroot (#1384)
1266 +  * fixed case-sensitive check for Auth-Method (#1456)
1267 +  * execute fcgi app without /bin/sh if used as argument to spawn-fcgi (#1428)
1268 +  * fixed a bug that made /-prefixed extensions being handled also when
1269 +    matching the end of the uri in fcgi,scgi and proxy modules (#1489)
1270 +  * print error if X-LIGHTTPD-send-file cannot be done; reset header
1271 +    Content-Length for send-file. Patches by Stefan Buhler
1272 +  * prevent crash in certain php-fcgi configurations (#841)
1273 +  * add IdleServers and Scoreboard directives in ?auto mode for mod_status (#1507)
1274 +  * open log immediately after daemonizing, fixes SIGPIPEs on startup  (#165)
1275 +  * HTTPS env var should be "on" when using mod_extforward and the X-Forwarded-Proto header is set. (#1499)
1276 +  * generate ETag and Last-Modified headers for mod_ssi based on newest modified include (#1491)
1277 +
1278  - 1.4.18 - 2007-09-09
1279  
1280    * fixed compile error on IRIX 6.5.x on prctl() (#1333)
1281 Index: lighttpd.spec.in
1282 ===================================================================
1283 --- lighttpd.spec.in    (.../tags/lighttpd-1.4.18)      (revision 2054)
1284 +++ lighttpd.spec.in    (.../branches/lighttpd-1.4.x)   (revision 2054)
1285 @@ -6,21 +6,19 @@
1286  Packager: Jan Kneschke <jan@kneschke.de>
1287  License: BSD
1288  Group: Networking/Daemons
1289 -URL: http://jan.kneschke.de/projects/lighttpd/
1290 +URL: http://www.lighttpd.net/
1291  Requires: pcre >= 3.1 zlib
1292 -BuildPrereq: libtool zlib-devel
1293 +BuildRequires: libtool zlib-devel
1294  BuildRoot: %{_tmppath}/%{name}-root
1295  
1296 -
1297  %description
1298  lighttpd is intented to be a frontend for ad-servers which have to deliver
1299  small files concurrently to many connections.
1300  
1301 -Available rpmbuild rebuild options :
1302 ---with : ssl mysql lua memcache
1303 +Available rpmbuild rebuild options:
1304 +--with: ssl mysql lua memcache
1305  
1306  %prep
1307 -
1308  %setup -q
1309  
1310  %build
1311 @@ -33,14 +31,13 @@
1312  make
1313  
1314  %install
1315 -
1316  %makeinstall
1317  
1318  mkdir -p %{buildroot}%{_sysconfdir}/{init.d,sysconfig}
1319 -if test -f /etc/redhat-release -o -f /etc/fedora-release; then
1320 -  install -m 755 doc/rc.lighttpd.redhat %{buildroot}%{_sysconfdir}/init.d/lighttpd
1321 +if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then
1322 +       install -m 755 doc/rc.lighttpd.redhat %{buildroot}%{_sysconfdir}/init.d/lighttpd
1323  else
1324 -  install -m 755 doc/rc.lighttpd %{buildroot}%{_sysconfdir}/init.d/lighttpd
1325 +       install -m 755 doc/rc.lighttpd %{buildroot}%{_sysconfdir}/init.d/lighttpd
1326  fi
1327  install -m 644 doc/sysconfig.lighttpd %{buildroot}%{_sysconfdir}/sysconfig/lighttpd
1328  
1329 @@ -49,16 +46,16 @@
1330  
1331  %post
1332  ## read http://www.fedora.us/docs/spec.html next time :)
1333 -if test "$1" = "1"; then
1334 -  # real install, not upgrade
1335 -  /sbin/chkconfig --add lighttpd
1336 +if [ "$1" = "1" ]; then
1337 +       # real install, not upgrade
1338 +       /sbin/chkconfig --add lighttpd
1339  fi
1340  
1341  %preun
1342 -if test "$1" = "0"; then
1343 -  # real uninstall, not upgrade
1344 -  %{_sysconfdir}/init.d/lighttpd stop
1345 -  /sbin/chkconfig --del lighttpd
1346 +if [ "$1" = "0"]; then
1347 +       # real uninstall, not upgrade
1348 +       %{_sysconfdir}/init.d/lighttpd stop
1349 +       /sbin/chkconfig --del lighttpd
1350  fi
1351  
1352  %files
This page took 0.305558 seconds and 4 git commands to generate.