Skip to content

Commit

Permalink
Merge pull request ceph#12103 from rzarzynski/wip-rgw-auth-static_vector
Browse files Browse the repository at this point in the history
rgw: avoid dynamic memory allocations in rgw_swift_auth.cc by using static_vector

verified: f23
  • Loading branch information
mattbenjamin authored Nov 21, 2016
2 parents a70dc74 + cb782e1 commit 43eb7f3
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/rgw/rgw_swift_auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#include <array>

#include <boost/utility/string_ref.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 <boost/container/static_vector.hpp>

#include "rgw_swift_auth.h"
#include "rgw_rest.h"
Expand Down Expand Up @@ -229,12 +223,7 @@ 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
Expand Down

0 comments on commit 43eb7f3

Please sign in to comment.