diff options
author | Steven Barth <steven@midlink.org> | 2008-06-11 08:39:43 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-06-11 08:39:43 +0000 |
commit | 0ce532556c304c370a0e2511567e499ea8d5342f (patch) | |
tree | 10243bbd2a722f4ccdda50f6d07ec077f8f3a2e8 /libs/sgi-webuci/boa-patches/060-buffer_escape.patch | |
parent | d291e1c3f5664d86054736912f671af1bc339235 (diff) |
* Updated Boa to 0.94.14rc21 + Debian patches
Diffstat (limited to 'libs/sgi-webuci/boa-patches/060-buffer_escape.patch')
-rw-r--r-- | libs/sgi-webuci/boa-patches/060-buffer_escape.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libs/sgi-webuci/boa-patches/060-buffer_escape.patch b/libs/sgi-webuci/boa-patches/060-buffer_escape.patch new file mode 100644 index 0000000000..570c254e16 --- /dev/null +++ b/libs/sgi-webuci/boa-patches/060-buffer_escape.patch @@ -0,0 +1,26 @@ +diff --git a/src/buffer.c b/src/buffer.c +index 99f3e7c..6720e21 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); |