summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_client_io.h
diff options
context:
space:
mode:
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>2016-08-12 17:58:30 +0200
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>2016-10-21 22:57:20 +0200
commit3c2afc6c0cec962ace4af93af2d139b7e49e1aba (patch)
treefc11d121e73cc738ca0e7bd36d940c9f7fc647fa /src/rgw/rgw_client_io.h
parentrgw: rework quoting value of HTTP headers. (diff)
downloadceph-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.h22
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());
}