From: Radoslaw Zarzynski Date: Thu, 6 Oct 2016 12:59:28 +0000 (+0200) Subject: rgw: introduce AWS_AUTHv4_IO. X-Git-Tag: v11.1.0~454^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=908c0732064ec839f6fcb5259d19acaf67c4caa5;p=ceph.git rgw: introduce AWS_AUTHv4_IO. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_auth_s3.cc b/src/rgw/rgw_auth_s3.cc index 62d7ddab10b..69dc01d976b 100644 --- a/src/rgw/rgw_auth_s3.cc +++ b/src/rgw/rgw_auth_s3.cc @@ -275,7 +275,7 @@ void rgw_create_s3_v4_canonical_request(struct req_state *s, const string& canon request_payload_hash = "UNSIGNED-PAYLOAD"; } else { if (s->aws4_auth_needs_complete) { - request_payload_hash = RESTFUL_IO(s)->grab_aws4_sha256_hash(); + request_payload_hash = AWS_AUTHv4_IO(s)->grab_aws4_sha256_hash(); } else { if (s->aws4_auth_streaming_mode) { request_payload_hash = "STREAMING-AWS4-HMAC-SHA256-PAYLOAD"; diff --git a/src/rgw/rgw_client_io.h b/src/rgw/rgw_client_io.h index 46e2da118b6..e7cca88268d 100644 --- a/src/rgw/rgw_client_io.h +++ b/src/rgw/rgw_client_io.h @@ -212,14 +212,18 @@ public: /* Type conversions to work around lack of req_state type hierarchy matching * (e.g.) REST backends (may be replaced w/dynamic typed req_state). */ -static inline RGWRestfulIO* RESTFUL_IO(struct req_state* s) { - return static_cast(s->cio); +static inline rgw::io::RestfulClient* RESTFUL_IO(struct req_state* s) { + return static_cast(s->cio); } static inline rgw::io::Accounter* ACCOUNTING_IO(struct req_state* s) { return dynamic_cast(s->cio); } +static inline RGWRestfulIO* AWS_AUTHv4_IO(struct req_state* s) { + return static_cast(s->cio); +} + class RGWClientIOStreamBuf : public std::streambuf { protected: diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 9e49eb072ac..dfddc3a29f1 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -854,7 +854,7 @@ int recv_body(struct req_state* const s, const size_t max) { try { - return RESTFUL_IO(s)->recv_body(buf, max, s->aws4_auth_needs_complete); + return AWS_AUTHv4_IO(s)->recv_body(buf, max, s->aws4_auth_needs_complete); } catch (rgw::io::RestfulClient::Exception& e) { return -e.code().value(); }