]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: fix chunked-encoding for chunks >1MiB 24363/head
authorRobin H. Johnson <rjohnson@digitalocean.com>
Fri, 14 Sep 2018 21:23:49 +0000 (14:23 -0700)
committerPrashant D <pdhange@redhat.com>
Tue, 2 Oct 2018 04:36:26 +0000 (00:36 -0400)
commite2061d1e3da9cc9921ca24d59486026d46aa31f7
treeba9f4fb1b16ad8939e732e48087bae32c665edd5
parentdb7584dca546581b9ffdab8886ee125922ed25ca
rgw: fix chunked-encoding for chunks >1MiB

For HTTP responses sent with chunked-encoding, and greater than 1MiB in
size, the chunk-size field was being printed wrong.

Specifically, the chunk-size field was being sent with a mangled or
missing trailer of '\r\n'.

This bug manifested as HTTP clients being unable to read the response:
Chrome generates ERR_INCOMPLETE_CHUNKED_ENCODING
Python/boto generates httplib.LineTooLong: got more than 65536 bytes when reading chunk size

The wrong variable was being used to determine the size of the buffer
used for the chunk-size field.

Fix it by using the correct variable, and rename the variables to
clearly reflect their purpose.

Prior to PR#23940, this would only have been seen in some Swift
operations. PR#23940 changed some S3 operations to also use chunked
encoding to get responses sent faster, and made the bug easier to
detect. It was initially reported for a ListBucket call with a high
max-keys argument.

Backport: luminous, mimic
Reference: https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1
Reference: https://github.com/ceph/ceph/pull/23940
Fixes: http://tracker.ceph.com/issues/35990
Signed-off-by: Robin H. Johnson <rjohnson@digitalocean.com>
(cherry picked from commit 3b864482d6aef2efe0b03be70ea83c38f7a6d99b)
src/rgw/rgw_client_io_filters.h