]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove the duplicated initialization of 'using_qs' in 19250/head
authorBingyin Zhang <zhangbingyin@cloudin.cn>
Thu, 30 Nov 2017 08:21:36 +0000 (16:21 +0800)
committerBingyin Zhang <zhangbingyin@cloudin.cn>
Fri, 1 Dec 2017 01:13:02 +0000 (09:13 +0800)
parse_credentials

Signed-off-by: Bingyin Zhang <zhangbingyin@cloudin.cn>
src/rgw/rgw_auth_s3.cc
src/rgw/rgw_auth_s3.h
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_s3.h

index ba137e3f59b509656f6d3318da4a85fc993d3ba0..1f89136a62644dd24c2e0a3553f0f58f77db6927 100644 (file)
@@ -417,13 +417,10 @@ int parse_credentials(const req_info& info,                     /* in */
                       boost::string_view& signedheaders,        /* out */
                       boost::string_view& signature,            /* out */
                       boost::string_view& date,                 /* out */
-                      bool& using_qs)                           /* out */
+                      const bool using_qs)                      /* in */
 {
-  const char* const http_auth = info.env->get("HTTP_AUTHORIZATION");
-  using_qs = http_auth == nullptr || http_auth[0] == '\0';
-
-  int ret;
   boost::string_view credential;
+  int ret;
   if (using_qs) {
     ret = parse_v4_query_string(info, credential, signedheaders,
                                 signature, date);
index 1c851a933e1138baf7528428f113acc5663da3ae..c1abd6eb503bf1b5d72eeb7db129218a2035ba04 100644 (file)
@@ -344,7 +344,7 @@ int parse_credentials(const req_info& info,                     /* in */
                       boost::string_view& signedheaders,        /* out */
                       boost::string_view& signature,            /* out */
                       boost::string_view& date,                 /* out */
-                      bool& using_qs);                          /* out */
+                      const bool using_qs);                     /* in */
 
 static inline std::string get_v4_canonical_uri(const req_info& info) {
   /* The code should normalize according to RFC 3986 but S3 does NOT do path
index bc0c4ac18715bc36f768b470f61c031fbcffb2f5..080c1180d92bc1e3e8c2c14440bd4998cbb5e006 100644 (file)
@@ -3724,8 +3724,7 @@ AWSGeneralAbstractor::get_v4_canonical_headers(
 
 AWSEngine::VersionAbstractor::auth_data_t
 AWSGeneralAbstractor::get_auth_data_v4(const req_state* const s,
-                                       /* FIXME: const. */
-                                       bool using_qs) const
+                                       const bool using_qs) const
 {
   boost::string_view access_key_id;
   boost::string_view signed_hdrs;
index d0aa098fa1b82fc74533aec9fb4f51fdfd5a2b19..902ba6e36eb02db3450db33a5970178a6dd76760 100644 (file)
@@ -776,7 +776,7 @@ class AWSGeneralAbstractor : public AWSEngine::VersionAbstractor {
                            const bool using_qs) const;
 
   auth_data_t get_auth_data_v2(const req_state* s) const;
-  auth_data_t get_auth_data_v4(const req_state* s, bool using_qs) const;
+  auth_data_t get_auth_data_v4(const req_state* s, const bool using_qs) const;
 
 public:
   AWSGeneralAbstractor(CephContext* const cct)