diff options
author | Radoslaw Zarzynski <rzarzynski@mirantis.com> | 2016-08-12 17:58:30 +0200 |
---|---|---|
committer | Radoslaw Zarzynski <rzarzynski@mirantis.com> | 2016-10-21 22:57:20 +0200 |
commit | 3c2afc6c0cec962ace4af93af2d139b7e49e1aba (patch) | |
tree | fc11d121e73cc738ca0e7bd36d940c9f7fc647fa /src/rgw/rgw_client_io.h | |
parent | rgw: rework quoting value of HTTP headers. (diff) | |
download | ceph-3c2afc6c0cec962ace4af93af2d139b7e49e1aba.tar.xz ceph-3c2afc6c0cec962ace4af93af2d139b7e49e1aba.zip |
rgw: add control logic for chunked transfer encoding.
Needed for tempest.api.object_storage.test_object_slo.ObjectSloTest.test_delete_large_object.
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
Diffstat (limited to 'src/rgw/rgw_client_io.h')
-rw-r--r-- | src/rgw/rgw_client_io.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/rgw/rgw_client_io.h b/src/rgw/rgw_client_io.h index 05879e4c47f..e85b47f9c98 100644 --- a/src/rgw/rgw_client_io.h +++ b/src/rgw/rgw_client_io.h @@ -64,7 +64,24 @@ public: virtual std::size_t send_header(const boost::string_ref& name, const boost::string_ref& value) = 0; + /* Inform a client about a content length. Takes number of bytes supplied in + * @len XOR one of the alternative modes for dealing with it passed as @mode. + * On success returns number of bytes sent to the direct client of RadosGW. + * On failure throws int containing errno. + * + * CALL ORDER: + * - The method must be called EXACTLY ONE time. + * - The method must be preceeded with a call to send_status(). + * - The method must not be called after complete_header(). */ virtual std::size_t send_content_length(uint64_t len) = 0; + + virtual std::size_t send_chunked_transfer_encoding() { + /* This is a null implementation. We don't send anything here, even the HTTP + * header. The intended behaviour should be provided through a decorator or + * directly by a given front-end. */ + return 0; + } + virtual std::size_t complete_header() = 0; /* Receive body. On success Returns number of bytes sent to the direct @@ -98,6 +115,7 @@ public: virtual std::size_t send_header(const boost::string_ref& name, const boost::string_ref& value) noexcept = 0; virtual int send_content_length(uint64_t len) = 0; + virtual int send_chunked_transfer_encoding() = 0; virtual int complete_header() = 0; virtual int recv_body(char* buf, std::size_t max) = 0; @@ -186,6 +204,10 @@ public: EXCPT_TO_RC(get_decoratee().send_content_length(len)); } + int send_chunked_transfer_encoding() override { + EXCPT_TO_RC(get_decoratee().send_chunked_transfer_encoding()); + } + int complete_header() override { EXCPT_TO_RC(get_decoratee().complete_header()); } |