Fix an edge case in the dechunk bucket where it could erroneously report
APR_EOF instead of an error in presence of a truncated response with
CRLF in place of the next chunk length.

* buckets/dechunk_buckets.c
  (wait_for_chunk): Check if we got an empty chunk size line before trying
   to parse it with apr_strtoi64().  Otherwise this function would report 0,
   which we would then incorrectly interpret as the final zero-sized chunk.

* test/test_buckets.c
  (test_response_body_chunked_truncated_with_crlf): New test, modelled
   after what httpd + mod_dav + mod_dav_svn can actually send when
   aborting connection due to an internal error.
  (test_linebuf_crlf_split): Update the expectation in this test, as the
   response in it didn't include the final zero-sized chunk.  That's ill-
   formed per RFC7230 3.3.3 and 4.1.
  (test_buckets): Add new test.


git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1804005 13f79535-47bb-0310-9956-ffa450edef68
2 files changed