diff options
author | Ed Tanous <ed@tanous.net> | 2020-09-30 02:16:58 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2020-10-15 18:52:46 +0300 |
commit | b5a76932eab7d40487ffb305cd745ec155813c4e (patch) | |
tree | 193d0ba4e679be07880d661130930cd4adcb38b9 /include/authorization.hpp | |
parent | c370fad0ae67480fac19a2fe6a08be3401f48ae7 (diff) | |
download | bmcweb-b5a76932eab7d40487ffb305cd745ec155813c4e.tar.xz |
Lots of performance improvements
(In the voice of the kid from sixth sense) I see string copies...
Apparently there are a lot of places we make unnecessary copies. This
fixes all of them.
Not sure how to split this up into smaller patches, or if it even needs
split up. It seems pretty easy to review to me, because basically every
diff is identical.
Change-Id: I22b4ae4f96f7e4082d2bc701098a04f7bed95369
Signed-off-by: Ed Tanous <ed@tanous.net>
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
Diffstat (limited to 'include/authorization.hpp')
-rw-r--r-- | include/authorization.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/authorization.hpp b/include/authorization.hpp index 634620b1e6..997e50434f 100644 --- a/include/authorization.hpp +++ b/include/authorization.hpp @@ -13,6 +13,7 @@ #include <pam_authenticate.hpp> #include <random> +#include <utility> namespace crow { @@ -165,7 +166,7 @@ static std::shared_ptr<persistent_data::UserSession> #ifdef BMCWEB_ENABLE_MUTUAL_TLS_AUTHENTICATION static std::shared_ptr<persistent_data::UserSession> performTLSAuth(const crow::Request& req, Response& res, - std::weak_ptr<persistent_data::UserSession> session) + const std::weak_ptr<persistent_data::UserSession>& session) { if (auto sp = session.lock()) { @@ -244,7 +245,7 @@ static void authenticate( #ifdef BMCWEB_ENABLE_MUTUAL_TLS_AUTHENTICATION if (req.session == nullptr && authMethodsConfig.tls) { - req.session = performTLSAuth(req, res, session); + req.session = performTLSAuth(req, res, std::move(session)); } #endif if (req.session == nullptr && authMethodsConfig.xtoken) |