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