summaryrefslogtreecommitdiffstats
path: root/patches/boa-0.94.14rc21
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2010-02-01 14:05:36 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2010-02-26 21:04:12 +0100
commit04f568a341c27a2c3e2042e1e766534f787497c4 (patch)
treefb2bffefd9e99804cdfa973ff7cb2d8904ee4c6a /patches/boa-0.94.14rc21
parent9dfb84e9a91f6e20b5cd57e6f02cc5a55404841e (diff)
downloadptxdist-04f568a341c27a2c3e2042e1e766534f787497c4.tar.gz
ptxdist-04f568a341c27a2c3e2042e1e766534f787497c4.tar.xz
[boa] new package
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> [mkl: update to boa-0.94, import debian patches] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'patches/boa-0.94.14rc21')
-rw-r--r--patches/boa-0.94.14rc21/0001-config.diff.patch26
-rw-r--r--patches/boa-0.94.14rc21/0002-sendfile_ENOSYS.diff.patch28
-rw-r--r--patches/boa-0.94.14rc21/0003-Makefile.in.diff.patch26
-rw-r--r--patches/boa-0.94.14rc21/0004-allow_8bit.diff.patch29
-rw-r--r--patches/boa-0.94.14rc21/0005-lfs_support.diff.patch480
-rw-r--r--patches/boa-0.94.14rc21/0006-buffer_escape.diff.patch39
-rw-r--r--patches/boa-0.94.14rc21/series6
7 files changed, 634 insertions, 0 deletions
diff --git a/patches/boa-0.94.14rc21/0001-config.diff.patch b/patches/boa-0.94.14rc21/0001-config.diff.patch
new file mode 100644
index 000000000..115d12d1f
--- /dev/null
+++ b/patches/boa-0.94.14rc21/0001-config.diff.patch
@@ -0,0 +1,26 @@
+From 92358cce7b7b863c05379e73f178fc4f420198d5 Mon Sep 17 00:00:00 2001
+From: debian.org <debian.org>
+Date: Mon, 22 Feb 2010 23:14:34 +0100
+Subject: [PATCH 1/6] config.diff
+
+http://ftp.de.debian.org/debian/pool/main/b/boa/boa_0.94.14rc21-3.1.diff.gz
+---
+ examples/boa.conf | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/examples/boa.conf b/examples/boa.conf
+index d7bc588..a47c2b1 100644
+--- a/examples/boa.conf
++++ b/examples/boa.conf
+@@ -232,7 +232,7 @@ CGIPath /bin:/usr/bin:/usr/local/bin
+ # Aliases: Aliases one path to another.
+ # Example: Alias /path1/bar /path2/foo
+
+-Alias /doc /usr/doc
++Alias /doc /usr/share/doc
+
+ # ScriptAlias: Maps a virtual path to a directory for serving scripts
+ # Example: ScriptAlias /htbin/ /www/htbin/
+--
+1.7.0
+
diff --git a/patches/boa-0.94.14rc21/0002-sendfile_ENOSYS.diff.patch b/patches/boa-0.94.14rc21/0002-sendfile_ENOSYS.diff.patch
new file mode 100644
index 000000000..c2a380b00
--- /dev/null
+++ b/patches/boa-0.94.14rc21/0002-sendfile_ENOSYS.diff.patch
@@ -0,0 +1,28 @@
+From 00381e568e8937e6ffb25871ac51d05b9a324b89 Mon Sep 17 00:00:00 2001
+From: debian.org <debian.org>
+Date: Mon, 22 Feb 2010 23:14:34 +0100
+Subject: [PATCH 2/6] sendfile_ENOSYS.diff
+
+http://ftp.de.debian.org/debian/pool/main/b/boa/boa_0.94.14rc21-3.1.diff.gz
+---
+ src/pipe.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/src/pipe.c b/src/pipe.c
+index 3460277..7126562 100644
+--- a/src/pipe.c
++++ b/src/pipe.c
+@@ -215,7 +215,9 @@ retrysendfile:
+ }
+ req->ranges->start = sendfile_offset;
+ if (bytes_written < 0) {
+- if (errno == EWOULDBLOCK || errno == EAGAIN) {
++ if (errno == ENOSYS) {
++ return io_shuffle(req);
++ } else if (errno == EWOULDBLOCK || errno == EAGAIN) {
+ return -1; /* request blocked at the pipe level, but keep going */
+ } else if (errno == EINTR) {
+ goto retrysendfile;
+--
+1.7.0
+
diff --git a/patches/boa-0.94.14rc21/0003-Makefile.in.diff.patch b/patches/boa-0.94.14rc21/0003-Makefile.in.diff.patch
new file mode 100644
index 000000000..687d21dbc
--- /dev/null
+++ b/patches/boa-0.94.14rc21/0003-Makefile.in.diff.patch
@@ -0,0 +1,26 @@
+From 56d314ae56b76e2938b622a50061101135fb8ecf Mon Sep 17 00:00:00 2001
+From: debian.org <debian.org>
+Date: Mon, 22 Feb 2010 23:14:35 +0100
+Subject: [PATCH 3/6] Makefile.in.diff
+
+http://ftp.de.debian.org/debian/pool/main/b/boa/boa_0.94.14rc21-3.1.diff.gz
+---
+ Makefile.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 6755951..70e3662 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -20,7 +20,7 @@ distclean: mrclean
+
+ mrclean: clean
+ -(cd src && $(MAKE) $(MFLAGS) mrclean)
+- -(cd docs && $(MAKE)$(MFLAGS) mrclean)
++ -(cd docs && $(MAKE) $(MFLAGS) mrclean)
+ rm -f config.status config.cache config.h config.log
+ rm -f Makefile *~
+
+--
+1.7.0
+
diff --git a/patches/boa-0.94.14rc21/0004-allow_8bit.diff.patch b/patches/boa-0.94.14rc21/0004-allow_8bit.diff.patch
new file mode 100644
index 000000000..714840ed8
--- /dev/null
+++ b/patches/boa-0.94.14rc21/0004-allow_8bit.diff.patch
@@ -0,0 +1,29 @@
+From ef819011b8ffab89ee04d831f91966d68324540d Mon Sep 17 00:00:00 2001
+From: debian.org <debian.org>
+Date: Mon, 22 Feb 2010 23:14:35 +0100
+Subject: [PATCH 4/6] allow_8bit.diff
+
+http://ftp.de.debian.org/debian/pool/main/b/boa/boa_0.94.14rc21-3.1.diff.gz
+---
+ src/util.c | 5 -----
+ 1 files changed, 0 insertions(+), 5 deletions(-)
+
+diff --git a/src/util.c b/src/util.c
+index 3f54da8..30df6cf 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -410,11 +410,6 @@ int unescape_uri(char *uri, char **query_string)
+ uri_old++;
+ if ((c = *uri_old++) && (d = *uri_old++)) {
+ *uri = HEX_TO_DECIMAL(c, d);
+- if (*uri < 32 || *uri > 126) {
+- /* control chars in URI */
+- *uri = '\0';
+- return 0;
+- }
+ } else {
+ *uri = '\0';
+ return 0;
+--
+1.7.0
+
diff --git a/patches/boa-0.94.14rc21/0005-lfs_support.diff.patch b/patches/boa-0.94.14rc21/0005-lfs_support.diff.patch
new file mode 100644
index 000000000..dc801ab38
--- /dev/null
+++ b/patches/boa-0.94.14rc21/0005-lfs_support.diff.patch
@@ -0,0 +1,480 @@
+From e9e24d7d5154aa72f36a236fc35c8f683a46c75e Mon Sep 17 00:00:00 2001
+From: debian.org <debian.org>
+Date: Mon, 22 Feb 2010 23:14:35 +0100
+Subject: [PATCH 5/6] lfs_support.diff
+
+http://ftp.de.debian.org/debian/pool/main/b/boa/boa_0.94.14rc21-3.1.diff.gz
+---
+ src/boa.h | 4 +++-
+ src/buffer.c | 2 +-
+ src/config.h.in | 13 +++++++++++++
+ src/get.c | 26 +++++++++++++++-----------
+ src/globals.h | 6 +++---
+ src/index_dir.c | 19 +++++++++++++------
+ src/log.c | 2 +-
+ src/mmap_cache.c | 2 +-
+ src/pipe.c | 18 +++++++++---------
+ src/range.c | 2 +-
+ src/read.c | 22 +++++++++++-----------
+ src/request.c | 6 +++---
+ src/util.c | 2 +-
+ 13 files changed, 75 insertions(+), 49 deletions(-)
+
+diff --git a/src/boa.h b/src/boa.h
+index ae54ba9..983e43a 100644
+--- a/src/boa.h
++++ b/src/boa.h
+@@ -25,7 +25,9 @@
+ #ifndef _BOA_H
+ #define _BOA_H
+
++/* Important, include before anything else */
+ #include "config.h"
++
+ #include <errno.h>
+ #include <stdlib.h> /* malloc, free, etc. */
+ #include <stdio.h> /* stdin, stdout, stderr */
+@@ -165,7 +167,7 @@ void sigterm_stage2_run(void);
+ void clean_pathname(char *pathname);
+ char *get_commonlog_time(void);
+ void rfc822_time_buf(char *buf, time_t s);
+-char *simple_itoa(unsigned int i);
++char *simple_itoa(uint64_t i);
+ int boa_atoi(const char *s);
+ int month2int(const char *month);
+ int modified_since(time_t * mtime, const char *if_modified_since);
+diff --git a/src/buffer.c b/src/buffer.c
+index 99f3e7c..3663725 100644
+--- a/src/buffer.c
++++ b/src/buffer.c
+@@ -212,7 +212,7 @@ int req_flush(request * req)
+ return -2;
+
+ if (bytes_to_write) {
+- int bytes_written;
++ off_t bytes_written;
+
+ bytes_written = write(req->fd, req->buffer + req->buffer_start,
+ bytes_to_write);
+diff --git a/src/config.h.in b/src/config.h.in
+index cf3e2a4..5809479 100644
+--- a/src/config.h.in
++++ b/src/config.h.in
+@@ -205,3 +205,16 @@
+
+ /* Define to `int' if <sys/types.h> doesn't define. */
+ #undef uid_t
++
++/* Those enable the LFS ready structures in the system headers */
++#define _FILE_OFFSET_BITS 64 /* glibc style */
++#define _LARGEFILE_SOURCE 1 /* To make ftello() visible (HP-UX 10.20). */
++#define _LARGE_FILES 1 /* Large file defined on AIX-style hosts. */
++
++#define _LARGEFILE64_SOURCE /* tell kernel headers to provide the O_LARGEFILE value */
++
++#if __WORDSIZE == 64
++#define PRINTF_OFF_T_ARG "%ld"
++#elif __WORDSIZE == 32
++#define PRINTF_OFF_T_ARG "%lld"
++#endif
+diff --git a/src/get.c b/src/get.c
+index da01520..6d5b98e 100644
+--- a/src/get.c
++++ b/src/get.c
+@@ -25,6 +25,10 @@
+ #include "boa.h"
+ #include "access.h"
+
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++
+ #define STR(s) __STR(s)
+ #define __STR(s) #s
+
+@@ -52,9 +56,9 @@ int init_get(request * req)
+ {
+ int data_fd, saved_errno;
+ struct stat statbuf;
+- volatile unsigned int bytes_free;
++ volatile off_t bytes_free;
+
+- data_fd = open(req->pathname, O_RDONLY);
++ data_fd = open(req->pathname, O_RDONLY|O_LARGEFILE);
+ saved_errno = errno; /* might not get used */
+
+ #ifdef GUNZIP
+@@ -76,7 +80,7 @@ int init_get(request * req)
+ memcpy(gzip_pathname, req->pathname, len);
+ memcpy(gzip_pathname + len, ".gz", 3);
+ gzip_pathname[len + 3] = '\0';
+- data_fd = open(gzip_pathname, O_RDONLY);
++ data_fd = open(gzip_pathname, O_RDONLY|O_LARGEFILE);
+ if (data_fd != -1) {
+ close(data_fd);
+
+@@ -430,8 +434,8 @@ int init_get(request * req)
+
+ int process_get(request * req)
+ {
+- int bytes_written;
+- volatile unsigned int bytes_to_write;
++ off_t bytes_written;
++ volatile off_t bytes_to_write;
+
+ if (req->method == M_HEAD) {
+ return complete_response(req);
+@@ -531,7 +535,7 @@ int get_dir(request * req, struct stat *statbuf)
+ memcpy(pathname_with_index, req->pathname, l1); /* doesn't copy NUL */
+ memcpy(pathname_with_index + l1, directory_index, l2 + 1); /* does */
+
+- data_fd = open(pathname_with_index, O_RDONLY);
++ data_fd = open(pathname_with_index, O_RDONLY|O_LARGEFILE);
+
+ if (data_fd != -1) { /* user's index file */
+ /* We have to assume that directory_index will fit, because
+@@ -555,7 +559,7 @@ int get_dir(request * req, struct stat *statbuf)
+ * try index.html.gz
+ */
+ strcat(pathname_with_index, ".gz");
+- data_fd = open(pathname_with_index, O_RDONLY);
++ data_fd = open(pathname_with_index, O_RDONLY|O_LARGEFILE);
+ if (data_fd != -1) { /* user's index file */
+ close(data_fd);
+
+@@ -624,9 +628,9 @@ static int get_cachedir_file(request * req, struct stat *statbuf)
+ * include the NUL when calculating if the size is enough
+ */
+ snprintf(pathname_with_index, sizeof(pathname_with_index),
+- "%s/dir.%d.%ld", cachedir,
++ "%s/dir.%d." PRINTF_OFF_T_ARG, cachedir,
+ (int) statbuf->st_dev, statbuf->st_ino);
+- data_fd = open(pathname_with_index, O_RDONLY);
++ data_fd = open(pathname_with_index, O_RDONLY|O_LARGEFILE);
+
+ if (data_fd != -1) { /* index cache */
+
+@@ -642,7 +646,7 @@ static int get_cachedir_file(request * req, struct stat *statbuf)
+ if (index_directory(req, pathname_with_index) == -1)
+ return -1;
+
+- data_fd = open(pathname_with_index, O_RDONLY); /* Last chance */
++ data_fd = open(pathname_with_index, O_RDONLY|O_LARGEFILE); /* Last chance */
+ if (data_fd != -1) {
+ strcpy(req->request_uri, directory_index); /* for mimetype */
+ fstat(data_fd, statbuf);
+@@ -671,7 +675,7 @@ static int index_directory(request * req, char *dest_filename)
+ DIR *request_dir;
+ FILE *fdstream;
+ struct dirent *dirbuf;
+- int bytes = 0;
++ off_t bytes = 0;
+ char *escname = NULL;
+
+ if (chdir(req->pathname) == -1) {
+diff --git a/src/globals.h b/src/globals.h
+index c0b987c..1d3b69e 100644
+--- a/src/globals.h
++++ b/src/globals.h
+@@ -130,9 +130,9 @@ struct request { /* pending requests */
+ int numranges;
+
+ int data_fd; /* fd of data */
+- unsigned long filesize; /* filesize */
+- unsigned long filepos; /* position in file */
+- unsigned long bytes_written; /* total bytes written (sans header) */
++ off_t filesize; /* filesize */
++ off_t filepos; /* position in file */
++ size_t bytes_written; /* total bytes written (sans header) */
+ char *data_mem; /* mmapped/malloced char array */
+
+ char *logline; /* line to log file */
+diff --git a/src/index_dir.c b/src/index_dir.c
+index 256f9de..99cc306 100644
+--- a/src/index_dir.c
++++ b/src/index_dir.c
+@@ -19,6 +19,7 @@
+
+ /* $Id: index_dir.c,v 1.32.2.7 2005/02/22 03:00:24 jnelson Exp $*/
+
++#include "config.h"
+ #include <stdio.h>
+ #include <sys/stat.h>
+ #include <limits.h> /* for PATH_MAX */
+@@ -266,10 +267,12 @@ int index_directory(char *dir, char *title)
+ printf("<tr>"
+ "<td width=\"40%%\"><a href=\"%s/\">%s/</a></td>"
+ "<td align=right>%s</td>"
+- "<td align=right>%ld bytes</td>"
++ "<td align=right>"
++ PRINTF_OFF_T_ARG
++ " bytes</td>"
+ "</tr>\n",
+ escaped_filename, html_filename,
+- ctime(&statbuf.st_mtime), (long) statbuf.st_size);
++ ctime(&statbuf.st_mtime), (off_t) statbuf.st_size);
+ }
+
+ printf
+@@ -312,10 +315,12 @@ int index_directory(char *dir, char *title)
+ "<td width=\"40%%\"><a href=\"%s\">%s</a> "
+ "<a href=\"%s.gz\">(.gz)</a></td>"
+ "<td align=right>%s</td>"
+- "<td align=right>%ld bytes</td>"
++ "<td align=right>"
++ PRINTF_OFF_T_ARG
++ "bytes</td>"
+ "</tr>\n",
+ escaped_filename, html_filename, http_filename,
+- ctime(&statbuf.st_mtime), (long) statbuf.st_size);
++ ctime(&statbuf.st_mtime), (off_t) statbuf.st_size);
+ } else {
+ #endif
+ if (html_escape_string(http_filename, escaped_filename,
+@@ -326,10 +331,12 @@ int index_directory(char *dir, char *title)
+ printf("<tr>"
+ "<td width=\"40%%\"><a href=\"%s\">%s</a></td>"
+ "<td align=right>%s</td>"
+- "<td align=right>%ld bytes</td>"
++ "<td align=right>"
++ PRINTF_OFF_T_ARG
++ "bytes</td>"
+ "</tr>\n",
+ escaped_filename, html_filename,
+- ctime(&statbuf.st_mtime), (long) statbuf.st_size);
++ ctime(&statbuf.st_mtime), (off_t) statbuf.st_size);
+ #ifdef GUNZIP
+ }
+ #endif
+diff --git a/src/log.c b/src/log.c
+index 9119cd7..e4cb4bd 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -146,7 +146,7 @@ void log_access(request * req)
+ } else if (vhost_root) {
+ printf("%s ", (req->host ? req->host : "(null)"));
+ }
+- printf("%s - - %s\"%s\" %d %ld \"%s\" \"%s\"\n",
++ printf("%s - - %s\"%s\" %d %zu \"%s\" \"%s\"\n",
+ req->remote_ip_addr,
+ get_commonlog_time(),
+ req->logline ? req->logline : "-",
+diff --git a/src/mmap_cache.c b/src/mmap_cache.c
+index 18c4218..8f71480 100644
+--- a/src/mmap_cache.c
++++ b/src/mmap_cache.c
+@@ -140,7 +140,7 @@ static struct mmap_entry *find_named_mmap(char *fname)
+ int data_fd;
+ struct stat statbuf;
+ struct mmap_entry *e;
+- data_fd = open(fname, O_RDONLY);
++ data_fd = open(fname, O_RDONLY|O_LARGEFILE);
+ if (data_fd == -1) {
+ perror(fname);
+ return NULL;
+diff --git a/src/pipe.c b/src/pipe.c
+index 7126562..3d35bd9 100644
+--- a/src/pipe.c
++++ b/src/pipe.c
+@@ -37,8 +37,8 @@
+
+ int read_from_pipe(request * req)
+ {
+- int bytes_read; /* signed */
+- unsigned int bytes_to_read; /* unsigned */
++ off_t bytes_read; /* signed */
++ off_t bytes_to_read; /* unsigned */ /* XXX really? */
+
+ bytes_to_read = BUFFER_SIZE - (req->header_end - req->buffer - 1);
+
+@@ -128,8 +128,8 @@ int read_from_pipe(request * req)
+
+ int write_from_pipe(request * req)
+ {
+- int bytes_written;
+- size_t bytes_to_write = req->header_end - req->header_line;
++ off_t bytes_written;
++ off_t bytes_to_write = req->header_end - req->header_line;
+
+ if (bytes_to_write == 0) {
+ if (req->cgi_status == CGI_DONE)
+@@ -170,9 +170,9 @@ int write_from_pipe(request * req)
+ #ifdef HAVE_SENDFILE
+ int io_shuffle_sendfile(request * req)
+ {
+- int bytes_written;
+- size_t bytes_to_write;
+ off_t sendfile_offset;
++ off_t bytes_written;
++ off_t bytes_to_write;
+
+ if (req->method == M_HEAD) {
+ return complete_response(req);
+@@ -266,8 +266,8 @@ retrysendfile:
+
+ int io_shuffle(request * req)
+ {
+- int bytes_to_read;
+- int bytes_written, bytes_to_write;
++ off_t bytes_to_read;
++ off_t bytes_written, bytes_to_write;
+
+ if (req->method == M_HEAD) {
+ return complete_response(req);
+@@ -287,7 +287,7 @@ int io_shuffle(request * req)
+ bytes_to_read = bytes_to_write;
+
+ if (bytes_to_read > 0 && req->data_fd) {
+- int bytes_read;
++ off_t bytes_read;
+ off_t temp;
+
+ temp = lseek(req->data_fd, req->ranges->start, SEEK_SET);
+diff --git a/src/range.c b/src/range.c
+index b571894..801b9ea 100644
+--- a/src/range.c
++++ b/src/range.c
+@@ -147,7 +147,7 @@ int ranges_fixup(request * req)
+ * 5) start > stop && start != -1 :: invalid
+ */
+ DEBUG(DEBUG_RANGE) {
+- fprintf(stderr, "range.c: ranges_fixup: %lu-%lu\n", r->start, r->stop);
++ fprintf(stderr, "range.c: ranges_fixup: %lu - %lu\n", r->start, r->stop);
+ }
+
+ /* no stop range specified or stop is too big.
+diff --git a/src/read.c b/src/read.c
+index e17a422..9f20fad 100644
+--- a/src/read.c
++++ b/src/read.c
+@@ -38,7 +38,7 @@
+
+ int read_header(request * req)
+ {
+- int bytes;
++ off_t bytes;
+ char *check, *buffer;
+ unsigned char uc;
+
+@@ -179,7 +179,7 @@ int read_header(request * req)
+ */
+
+ if (req->content_length) {
+- int content_length;
++ off_t content_length;
+
+ content_length = boa_atoi(req->content_length);
+ /* Is a content-length of 0 legal? */
+@@ -195,7 +195,7 @@ int read_header(request * req)
+ && content_length > single_post_limit) {
+ log_error_doc(req);
+ fprintf(stderr,
+- "Content-Length [%d] > SinglePostLimit [%d] on POST!\n",
++ "Content-Length [" PRINTF_OFF_T_ARG "] > SinglePostLimit [%d] on POST!\n",
+ content_length, single_post_limit);
+ send_r_bad_request(req);
+ return 0;
+@@ -224,7 +224,7 @@ int read_header(request * req)
+
+ if (req->status < BODY_READ) {
+ /* only reached if request is split across more than one packet */
+- unsigned int buf_bytes_left;
++ off_t buf_bytes_left;
+
+ buf_bytes_left = CLIENT_STREAM_SIZE - req->client_stream_pos;
+ if (buf_bytes_left < 1 || buf_bytes_left > CLIENT_STREAM_SIZE) {
+@@ -273,7 +273,7 @@ int read_header(request * req)
+ DEBUG(DEBUG_HEADER_READ) {
+ log_error_time();
+ req->client_stream[req->client_stream_pos] = '\0';
+- fprintf(stderr, "%s:%d -- We read %d bytes: \"%s\"\n",
++ fprintf(stderr, "%s:%d -- We read " PRINTF_OFF_T_ARG " bytes: \"%s\"\n",
+ __FILE__, __LINE__, bytes,
+ #ifdef VERY_FASCIST_LOGGING2
+ req->client_stream + req->client_stream_pos - bytes
+@@ -309,8 +309,8 @@ int read_header(request * req)
+
+ int read_body(request * req)
+ {
+- int bytes_read;
+- unsigned int bytes_to_read, bytes_free;
++ off_t bytes_read;
++ off_t bytes_to_read, bytes_free;
+
+ bytes_free = BUFFER_SIZE - (req->header_end - req->header_line);
+ bytes_to_read = req->filesize - req->filepos;
+@@ -367,8 +367,8 @@ int read_body(request * req)
+
+ int write_body(request * req)
+ {
+- int bytes_written;
+- unsigned int bytes_to_write = req->header_end - req->header_line;
++ off_t bytes_written;
++ off_t bytes_to_write = req->header_end - req->header_line;
+
+ if (req->filepos + bytes_to_write > req->filesize)
+ bytes_to_write = req->filesize - req->filepos;
+@@ -402,7 +402,7 @@ int write_body(request * req)
+ }
+ DEBUG(DEBUG_HEADER_READ) {
+ log_error_time();
+- fprintf(stderr, "%s:%d - wrote %d bytes of CGI body. %ld of %ld\n",
++ fprintf(stderr, "%s:%d - wrote " PRINTF_OFF_T_ARG " bytes of CGI body. " PRINTF_OFF_T_ARG " of " PRINTF_OFF_T_ARG "\n",
+ __FILE__, __LINE__,
+ bytes_written, req->filepos, req->filesize);
+ }
+@@ -417,7 +417,7 @@ int write_body(request * req)
+
+ req->header_line[bytes_written] = '\0';
+ fprintf(stderr,
+- "%s:%d - wrote %d bytes (%s). %lu of %lu\n",
++ "%s:%d - wrote " PRINTF_OFF_T_ARG " bytes (%s). " PRINTF_OFF_T_ARG " of " PRINTF_OFF_T_ARG "\n",
+ __FILE__, __LINE__, bytes_written,
+ req->header_line, req->filepos, req->filesize);
+ req->header_line[bytes_written] = c;
+diff --git a/src/request.c b/src/request.c
+index 79067cd..a81fadf 100644
+--- a/src/request.c
++++ b/src/request.c
+@@ -259,14 +259,14 @@ void get_request(int server_sock)
+
+ static void sanitize_request(request * req, int new_req)
+ {
+- static unsigned int bytes_to_zero = offsetof(request, fd);
++ static off_t bytes_to_zero = offsetof(request, fd);
+
+ if (new_req) {
+ req->kacount = ka_max;
+ req->time_last = current_time;
+ req->client_stream_pos = 0;
+ } else {
+- unsigned int bytes_to_move =
++ off_t bytes_to_move =
+ req->client_stream_pos - req->parse_pos;
+
+ if (bytes_to_move) {
+@@ -282,7 +282,7 @@ static void sanitize_request(request * req, int new_req)
+
+ DEBUG(DEBUG_REQUEST) {
+ log_error_time();
+- fprintf(stderr, "req: %p, offset: %u\n", (void *) req,
++ fprintf(stderr, "req: %p, offset: " PRINTF_OFF_T_ARG "\n", (void *) req,
+ bytes_to_zero);
+ }
+
+diff --git a/src/util.c b/src/util.c
+index 30df6cf..1fbe898 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -497,7 +497,7 @@ void rfc822_time_buf(char *buf, time_t s)
+ memcpy(p, day_tab + t->tm_wday * 4, 4);
+ }
+
+-char *simple_itoa(unsigned int i)
++char *simple_itoa(uint64_t i)
+ {
+ /* 21 digits plus null terminator, good for 64-bit or smaller ints
+ * for bigger ints, use a bigger buffer!
+--
+1.7.0
+
diff --git a/patches/boa-0.94.14rc21/0006-buffer_escape.diff.patch b/patches/boa-0.94.14rc21/0006-buffer_escape.diff.patch
new file mode 100644
index 000000000..d35e0cc9c
--- /dev/null
+++ b/patches/boa-0.94.14rc21/0006-buffer_escape.diff.patch
@@ -0,0 +1,39 @@
+From b46d216b3673246e7299a22dfb88a8f0d7538e5a Mon Sep 17 00:00:00 2001
+From: debian.org <debian.org>
+Date: Mon, 22 Feb 2010 23:14:35 +0100
+Subject: [PATCH 6/6] buffer_escape.diff
+
+http://ftp.de.debian.org/debian/pool/main/b/boa/boa_0.94.14rc21-3.1.diff.gz
+---
+ src/buffer.c | 8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/src/buffer.c b/src/buffer.c
+index 3663725..0a23f58 100644
+--- a/src/buffer.c
++++ b/src/buffer.c
+@@ -77,6 +77,7 @@ int req_write_escape_http(request * req, const char *msg)
+ char c, *dest;
+ const char *inp;
+
++ int skip = 0;
+ int left;
+ inp = msg;
+ dest = req->buffer + req->buffer_end;
+@@ -84,7 +85,12 @@ int req_write_escape_http(request * req, const char *msg)
+ * in the middle of a transfer of up to 3 bytes */
+ left = BUFFER_SIZE - req->buffer_end;
+ while ((c = *inp++) && left >= 3) {
+- if (needs_escape((unsigned int) c)) {
++ /* Lower the skip character count. */
++ if (skip) skip--;
++ /* If we have a '%', we skip the two follow characters. */
++ if (c == '%') skip = 2;
++
++ if (!skip && needs_escape((unsigned int) c)) {
+ *dest++ = '%';
+ *dest++ = INT_TO_HEX((c >> 4) & 0xf);
+ *dest++ = INT_TO_HEX(c & 0xf);
+--
+1.7.0
+
diff --git a/patches/boa-0.94.14rc21/series b/patches/boa-0.94.14rc21/series
new file mode 100644
index 000000000..3a224ce6c
--- /dev/null
+++ b/patches/boa-0.94.14rc21/series
@@ -0,0 +1,6 @@
+0001-config.diff.patch
+0002-sendfile_ENOSYS.diff.patch
+0003-Makefile.in.diff.patch
+0004-allow_8bit.diff.patch
+0005-lfs_support.diff.patch
+0006-buffer_escape.diff.patch