--- /dev/null
+{+https-inspection +ignore-certificate-errors}
+/
+
+{+filter{img-reorder}}
+/chunked-transfer-encoding/
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+6\r
+AAAAA
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+AAAAA
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - One chunk delivered through https.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+Bogus data.\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+Bogus data.\r
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks, bogus data instead of last chunk.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+18
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+100\r
+%repeat[1000 x D]%
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+100\r
+%repeat[1000 x D]%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks, chunk at the end too big.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+56
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+100\r
+%repeat[255 x 0]%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%repeat[255 x A]%
+%repeat[255 x B]%
+%repeat[255 x C]%
+%repeat[255 x 0]%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks, chunk at the end contains zeros but is valid
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+100\r
+%repeat[255 x %01]%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%repeat[255 x A]%
+%repeat[255 x B]%
+%repeat[255 x C]%
+%repeat[255 x %01]%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks, chunk at the end contains binary ones and is valid
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+100\r
+%repeat[255 x %hex[%00]hex%]%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%repeat[255 x A]%
+%repeat[255 x B]%
+%repeat[255 x C]%
+%repeat[255 x %hex[%00]hex%]%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks, chunk at the end contains binary zeroes and is valid.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+100\r
+%repeat[255 x %hex[%00]hex%]%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%repeat[255 x A]%
+%repeat[255 x B]%
+%repeat[255 x C]%
+%repeat[255 x %hex[%00]hex%]%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks, chunk at the end contains binary zeroes and is valid.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+2\r
+%hex[%00]hex%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%hex[%00]hex%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Single chunk with binary zeroes that is valid.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%hex[%FF%00%01]hex%
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%hex[%FF%00%01]hex%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Binary data test. XXX: Not actually a chunked test.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%hex[%00]hex%Blafasel
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%hex[%00]hex%Blafasel
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Binary zero test. XXX: Not actually a chunked-transfer-encoding test.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x %00]%
+\r
+100\r
+%repeat[255 x %00]%
+\r
+100\r
+%repeat[255 x %00]%
+\r
+100\r
+%repeat[255 x %00]%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%repeat[255 x %00]%
+%repeat[255 x %00]%
+%repeat[255 x %00]%
+%repeat[255 x %00]%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple valid chunks with binary zeros.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+6\r
+AAAAA
+\r
+100\r
+%repeat[255 x B]%
+\r
+1000\r
+%repeat[4095 x C]%
+\r
+10000\r
+%repeat[65535 x D]%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established
+
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+AAAAA
+%repeat[255 x B]%
+%repeat[4095 x C]%
+%repeat[65535 x D]%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks delivered through https.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100 blafasel %hex[%00]hex%\r
+%repeat[255 x C]%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100 blafasel %hex[%00]hex%\r
+%repeat[255 x C]%
+\r
+0\r
+\r
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks, invalid binary zero in chunk extension.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+# XXX: Why does curl not detect this?
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+12345\r
+%repeat[74564 x A]%
+\r
+67891\r
+%repeat[424080 x B]%
+\r
+31337\r
+%repeat[201526 x C]%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+%repeat[74564 x A]%
+%repeat[424080 x B]%
+%repeat[201526 x C]%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple largish chunks.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Only last chunk, no actual data.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+6 Oh noes\r
+AAAAA
+\r
+100 there is\r
+%repeat[255 x B]%
+\r
+1000 bogus data\r
+%repeat[4095 x C]%
+\r
+10000 here \r
+%repeat[65535 x D]%
+\r
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+X-Control: swsclose\r
+\r
+AAAAA
+%repeat[255 x B]%
+%repeat[4095 x C]%
+%repeat[65535 x D]%
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks with garbage after chunk-sizes deliverd through https.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+123\r
+This chunk is too small
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+123\r
+This chunk is too small
+0\r
+\r
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Single chunk that is too small delivered through https.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+18
+</errorcode>
+</verify>
+
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+3\r
+AA
+\r
+4\r
+BBB
+\r
+123\r
+This chunk is too small
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+3\r
+AA
+\r
+4\r
+BBB
+\r
+123\r
+This chunk is too small
+0\r
+\r
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple small chunks, last one too small.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+18
+</errorcode>
+</verify>
+
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+3\r
+AA
+\r
+4\r
+BBB
+\r
+123\r
+This chunk is too small
+4\r
+DDD
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+3\r
+AA
+\r
+4\r
+BBB
+\r
+123\r
+This chunk is too small
+4\r
+DDD
+0\r
+\r
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple small chunks, chunk in the middle too small.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+18
+</errorcode>
+</verify>
+
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+1000\r
+%repeat[4095 x B]%
+\r
+10000\r
+%repeat[65535 x C]%
+123\r
+This chunk is too small
+0\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+1000\r
+%repeat[4095 x B]%
+\r
+10000\r
+%repeat[65535 x C]%
+123\r
+This chunk is too small
+0\r
+\r
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks, some of them large, last chunk too small.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+56
+</errorcode>
+</verify>
+
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+\r
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - One data chunk, last chunk missing. Delivered through https.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+56
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+chunked transfer encoding
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established\r
+\r
+HTTP/1.1 200 OK\r
+Date: Thu, 22 Jul 2010 11:22:33 GMT\r
+Connection: close\r
+Content-Type: text/html\r
+Transfer-Encoding: chunked\r
+X-Control: swsclose\r
+\r
+100\r
+%repeat[255 x A]%
+\r
+100\r
+%repeat[255 x B]%
+\r
+100\r
+%repeat[255 x C]%
+\r
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Chunked transfer encoding - Multiple chunks, last chunk missing.
+</name>
+<features>
+proxy
+</features>
+<command>
+--insecure --raw https://%HOSTIP:%HTTPSPORT/chunked-transfer-encoding/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /chunked-transfer-encoding/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<errorcode>
+18
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+listen-address 127.0.0.1:9119
+
+ca-directory ../ca-directory
+ca-cert-file privoxy-test-cacert.crt
+ca-key-file privoxy-test-cakey.pem
+ca-password blafasel
+# We don't check certificate anyway
+trusted-cas-file privoxy-test-cacert.crt
+
+certificate-directory ../certs
+
+debug 1 # Log the destination for each request Privoxy let through. See also debug 1024.
+debug 2 # show each connection status
+debug 4 # show tagging-related messages
+debug 8 # show header parsing
+debug 32 # debug force feature
+debug 64 # debug regular expression filters
+debug 128 # debug redirects
+debug 256 # debug GIF de-animation
+debug 512 # Common Log Format
+debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
+debug 4096 # Startup banner and warnings.
+debug 8192 # Non-fatal errors
+
+filterfile ../../../default.filter
+actionsfile ./chunked-transfer-encoding.action
+