]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: temporarily use std::vector in place of static_vector of Boost.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Wed, 25 May 2016 16:30:28 +0000 (18:30 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 2 Jun 2016 19:17:13 +0000 (21:17 +0200)
We want to use boost::container::static_vector to avoid dynamic
memory allocations. However, Boost on some platforms we support
doesn't offer this container yet.

The patch can be safely reverted when we get modern enough Boost
on all our platforms.

Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_swift_auth.cc

index ceb64aadf1c23cf0d5c629fa3b2bf9f4300e624f..350fa92ec3b1d74c1e97458111351b29e5958bcc 100644 (file)
@@ -4,7 +4,13 @@
 #include <array>
 
 #include <boost/utility/string_ref.hpp>
-#include <boost/container/static_vector.hpp>
+/* TODO(rzarzynski): we want to use static_vector when it will be available
+ * also on RHEL/Centos 7. At the moment std::vetor is being used instead. */
+#if 0
+#  include <boost/container/static_vector.hpp>
+#else
+#  include <vector>
+#endif
 
 #include "rgw_swift_auth.h"
 #include "rgw_rest.h"
@@ -223,7 +229,12 @@ RGWAuthApplier::aplptr_t RGWTempURLAuthEngine::authenticate() const
   };
 
   /* Account owner calculates the signature also against a HTTP method. */
+  /* TODO(rzarzynski): switch to static_vector when possible. */
+#if 0
   boost::container::static_vector<boost::string_ref, 3> allowed_methods;
+#else
+  std::vector<boost::string_ref> allowed_methods;
+#endif
   if (strcmp("HEAD", s->info.method) == 0) {
     /* HEAD requests are specially handled. */
     /* TODO: after getting a newer boost (with static_vector supporting