Skip to content

Commit

Permalink
lighttpd: lighttpd 1.4.77
Browse files Browse the repository at this point in the history
  • Loading branch information
gstrauss committed Jan 20, 2025
1 parent 1994dc6 commit 567caa4
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 219 deletions.
2 changes: 1 addition & 1 deletion lighttpd/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIGHTTPD="lighttpd-1.4.53"
LIGHTTPD="lighttpd-1.4.77"
PKG_URL="https://download.lighttpd.net/lighttpd/releases-1.4.x/${LIGHTTPD}.tar.gz"
PKG_MIRROR_URL="https://files.phoesys.com/ports/${LIGHTTPD}.tar.gz"

Expand Down
16 changes: 16 additions & 0 deletions lighttpd/patches/HTTP2-post.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/src/request.c b/src/request.c
index 3a22e110..e684f7c6 100644
--- a/src/request.c
+++ b/src/request.c
@@ -1222,9 +1222,10 @@ http_request_parse (request_st * const restrict r, const int scheme_port)
}

if (0 == r->reqbody_length) {
- /* POST requires Content-Length (or Transfer-Encoding)
+ /* POST generally expects Content-Length (or Transfer-Encoding)
* (-1 == r->reqbody_length when Transfer-Encoding: chunked)*/
if (HTTP_METHOD_POST == r->http_method
+ && r->http_version <= HTTP_VERSION_1_1
&& !light_btst(r->rqst_htags, HTTP_HEADER_CONTENT_LENGTH)) {
return http_request_header_line_invalid(r, 411, "POST-request, but content-length missing -> 411");
}
54 changes: 54 additions & 0 deletions lighttpd/patches/SSI-exec.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
diff --git a/src/mod_ssi.c b/src/mod_ssi.c
index 11659927..bc0ee3b8 100644
--- a/src/mod_ssi.c
+++ b/src/mod_ssi.c
@@ -1160,6 +1160,9 @@ static int process_ssi_stmt(request_st * const r, handler_ctx * const p, const c
/* send cmd output to a temporary file */
if (0 != chunkqueue_append_mem_to_tempfile(cq, "", 0, errh)) break;
c = cq->last;
+ off_t flen = c->file.length;
+ if (flen && flen != lseek(c->file.fd, flen, SEEK_SET))
+ log_perror(errh, __FILE__, __LINE__, "lseek failed");

int status = 0;
struct stat stb;
@@ -1184,7 +1187,7 @@ static int process_ssi_stmt(request_st * const r, handler_ctx * const p, const c
if (0 == fstat(c->file.fd, &stb)) {
}
}
- chunkqueue_update_file(cq, c, stb.st_size);
+ chunkqueue_update_file(cq, c, stb.st_size - flen);
break;
}
case SSI_IF: {
diff --git a/src/t/test_mod_ssi.c b/src/t/test_mod_ssi.c
index 622e29ea..32d5b01d 100644
--- a/src/t/test_mod_ssi.c
+++ b/src/t/test_mod_ssi.c
@@ -87,20 +87,22 @@ test_mod_ssi_read_fd (request_st * const r, handler_ctx * const hctx)
assert(NULL == cq->first);

#ifndef _WIN32 /* TODO: command for cmd.exe */
+ const char ssi_exec2[] =
+ "result: <!--#exec cmd=\"expr 1 + 1\"-->";
hctx->conf.ssi_exec = 1;
- test_mod_ssi_write_testfile(fd, ssi_exec, sizeof(ssi_exec)-1);
+ test_mod_ssi_write_testfile(fd, ssi_exec2, sizeof(ssi_exec2)-1);
test_mod_ssi_reset(r, hctx);
mod_ssi_read_fd(r, hctx, &st, fd);
assert(cq->first);
assert(cq->first->type == FILE_CHUNK);
- assert(2 == chunkqueue_length(cq));
+ assert(10 == chunkqueue_length(cq));
char buf[80];
if (0 != lseek(cq->first->file.fd, 0, SEEK_SET)
- || 2 != read(cq->first->file.fd, buf, sizeof(buf))) {
+ || 10 != read(cq->first->file.fd, buf, sizeof(buf))) {
perror("lseek(),read()");
exit(1);
}
- assert(0 == memcmp(buf, "2\n", 2));
+ assert(0 == memcmp(buf, "result: 2\n", 10));
hctx->conf.ssi_exec = 0;
#endif

12 changes: 0 additions & 12 deletions lighttpd/patches/arpa_inet_include.patch

This file was deleted.

16 changes: 0 additions & 16 deletions lighttpd/patches/fdevent_del_bug_fix.patch

This file was deleted.

17 changes: 0 additions & 17 deletions lighttpd/patches/fionread_bug.patch

This file was deleted.

102 changes: 0 additions & 102 deletions lighttpd/patches/makefile_wstunnel.patch

This file was deleted.

16 changes: 0 additions & 16 deletions lighttpd/patches/mod_cgi_mmap_fix.patch

This file was deleted.

39 changes: 0 additions & 39 deletions lighttpd/patches/mod_compress_fix.patch

This file was deleted.

16 changes: 0 additions & 16 deletions lighttpd/patches/stream_mmap_fix.patch

This file was deleted.

0 comments on commit 567caa4

Please sign in to comment.