Try to fix the lambda formatting issue

clang-tidy has a setting, LambdaBodyIndentation, which it says:
"For callback-heavy code, it may improve readability to have the
signature indented two levels and to use OuterScope."

bmcweb is very callback heavy code.  Try to enable it and see if that
improves things.  There are many cases where the length of a lambda call
will change, and reindent the entire lambda function.  This is really
bad for code reviews, as it's difficult to see the lines changed.  This
commit should resolve it.  This does have the downside of reindenting a
lot of functions, which is unfortunate, but probably worth it in the
long run.

All changes except for the .clang-format file were made by the robot.

Tested: Code compiles, whitespace changes only.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib4aa2f1391fada981febd25b67dcdb9143827f43
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index 2ea3f18..8c86ac9 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -115,9 +115,8 @@
             }
         }
 
-        adaptor.set_verify_callback([this](
-                                        bool preverified,
-                                        boost::asio::ssl::verify_context& ctx) {
+        adaptor.set_verify_callback(
+            [this](bool preverified, boost::asio::ssl::verify_context& ctx) {
             // do nothing if TLS is disabled
             if (!persistent_data::SessionStore::getInstance()
                      .getAuthMethodsConfig()
@@ -305,12 +304,12 @@
             adaptor.async_handshake(boost::asio::ssl::stream_base::server,
                                     [this, self(shared_from_this())](
                                         const boost::system::error_code& ec) {
-                                        if (ec)
-                                        {
-                                            return;
-                                        }
-                                        doReadHeaders();
-                                    });
+                if (ec)
+                {
+                    return;
+                }
+                doReadHeaders();
+            });
         }
         else
         {
@@ -375,8 +374,8 @@
         BMCWEB_LOG_DEBUG << "Setting completion handler";
         asyncResp->res.setCompleteRequestHandler(
             [self(shared_from_this())](crow::Response& thisRes) {
-                self->completeRequest(thisRes);
-            });
+            self->completeRequest(thisRes);
+        });
 
         if (thisReq.isUpgrade() &&
             boost::iequals(
@@ -534,75 +533,74 @@
             [this,
              self(shared_from_this())](const boost::system::error_code& ec,
                                        std::size_t bytesTransferred) {
-                BMCWEB_LOG_DEBUG << this << " async_read_header "
-                                 << bytesTransferred << " Bytes";
-                bool errorWhileReading = false;
-                if (ec)
+            BMCWEB_LOG_DEBUG << this << " async_read_header "
+                             << bytesTransferred << " Bytes";
+            bool errorWhileReading = false;
+            if (ec)
+            {
+                errorWhileReading = true;
+                if (ec == boost::asio::error::eof)
                 {
-                    errorWhileReading = true;
-                    if (ec == boost::asio::error::eof)
-                    {
-                        BMCWEB_LOG_WARNING
-                            << this << " Error while reading: " << ec.message();
-                    }
-                    else
-                    {
-                        BMCWEB_LOG_ERROR
-                            << this << " Error while reading: " << ec.message();
-                    }
+                    BMCWEB_LOG_WARNING
+                        << this << " Error while reading: " << ec.message();
                 }
                 else
                 {
-                    // if the adaptor isn't open anymore, and wasn't handed to a
-                    // websocket, treat as an error
-                    if (!isAlive() &&
-                        !boost::beast::websocket::is_upgrade(parser->get()))
-                    {
-                        errorWhileReading = true;
-                    }
+                    BMCWEB_LOG_ERROR
+                        << this << " Error while reading: " << ec.message();
                 }
-
-                cancelDeadlineTimer();
-
-                if (errorWhileReading)
+            }
+            else
+            {
+                // if the adaptor isn't open anymore, and wasn't handed to a
+                // websocket, treat as an error
+                if (!isAlive() &&
+                    !boost::beast::websocket::is_upgrade(parser->get()))
                 {
+                    errorWhileReading = true;
+                }
+            }
+
+            cancelDeadlineTimer();
+
+            if (errorWhileReading)
+            {
+                close();
+                BMCWEB_LOG_DEBUG << this << " from read(1)";
+                return;
+            }
+
+            readClientIp();
+
+            boost::asio::ip::address ip;
+            if (getClientIp(ip))
+            {
+                BMCWEB_LOG_DEBUG << "Unable to get client IP";
+            }
+            sessionIsFromTransport = false;
+#ifndef BMCWEB_INSECURE_DISABLE_AUTHX
+            boost::beast::http::verb method = parser->get().method();
+            userSession = crow::authentication::authenticate(
+                ip, res, method, parser->get().base(), userSession);
+
+            bool loggedIn = userSession != nullptr;
+            if (!loggedIn)
+            {
+                const boost::optional<uint64_t> contentLength =
+                    parser->content_length();
+                if (contentLength && *contentLength > loggedOutPostBodyLimit)
+                {
+                    BMCWEB_LOG_DEBUG << "Content length greater than limit "
+                                     << *contentLength;
                     close();
-                    BMCWEB_LOG_DEBUG << this << " from read(1)";
                     return;
                 }
 
-                readClientIp();
-
-                boost::asio::ip::address ip;
-                if (getClientIp(ip))
-                {
-                    BMCWEB_LOG_DEBUG << "Unable to get client IP";
-                }
-                sessionIsFromTransport = false;
-#ifndef BMCWEB_INSECURE_DISABLE_AUTHX
-                boost::beast::http::verb method = parser->get().method();
-                userSession = crow::authentication::authenticate(
-                    ip, res, method, parser->get().base(), userSession);
-
-                bool loggedIn = userSession != nullptr;
-                if (!loggedIn)
-                {
-                    const boost::optional<uint64_t> contentLength =
-                        parser->content_length();
-                    if (contentLength &&
-                        *contentLength > loggedOutPostBodyLimit)
-                    {
-                        BMCWEB_LOG_DEBUG << "Content length greater than limit "
-                                         << *contentLength;
-                        close();
-                        return;
-                    }
-
-                    BMCWEB_LOG_DEBUG << "Starting quick deadline";
-                }
+                BMCWEB_LOG_DEBUG << "Starting quick deadline";
+            }
 #endif // BMCWEB_INSECURE_DISABLE_AUTHX
 
-                doRead();
+            doRead();
             });
     }
 
@@ -610,24 +608,23 @@
     {
         BMCWEB_LOG_DEBUG << this << " doRead";
         startDeadline();
-        boost::beast::http::async_read(
-            adaptor, buffer, *parser,
-            [this,
-             self(shared_from_this())](const boost::system::error_code& ec,
-                                       std::size_t bytesTransferred) {
-                BMCWEB_LOG_DEBUG << this << " async_read " << bytesTransferred
-                                 << " Bytes";
-                cancelDeadlineTimer();
-                if (ec)
-                {
-                    BMCWEB_LOG_ERROR
-                        << this << " Error while reading: " << ec.message();
-                    close();
-                    BMCWEB_LOG_DEBUG << this << " from read(1)";
-                    return;
-                }
-                handle();
-            });
+        boost::beast::http::async_read(adaptor, buffer, *parser,
+                                       [this, self(shared_from_this())](
+                                           const boost::system::error_code& ec,
+                                           std::size_t bytesTransferred) {
+            BMCWEB_LOG_DEBUG << this << " async_read " << bytesTransferred
+                             << " Bytes";
+            cancelDeadlineTimer();
+            if (ec)
+            {
+                BMCWEB_LOG_ERROR << this
+                                 << " Error while reading: " << ec.message();
+                close();
+                BMCWEB_LOG_DEBUG << this << " from read(1)";
+                return;
+            }
+            handle();
+        });
     }
 
     void doWrite(crow::Response& thisRes)
@@ -636,47 +633,46 @@
         thisRes.preparePayload();
         serializer.emplace(*thisRes.stringResponse);
         startDeadline();
-        boost::beast::http::async_write(
-            adaptor, *serializer,
-            [this,
-             self(shared_from_this())](const boost::system::error_code& ec,
-                                       std::size_t bytesTransferred) {
-                BMCWEB_LOG_DEBUG << this << " async_write " << bytesTransferred
-                                 << " bytes";
+        boost::beast::http::async_write(adaptor, *serializer,
+                                        [this, self(shared_from_this())](
+                                            const boost::system::error_code& ec,
+                                            std::size_t bytesTransferred) {
+            BMCWEB_LOG_DEBUG << this << " async_write " << bytesTransferred
+                             << " bytes";
 
-                cancelDeadlineTimer();
+            cancelDeadlineTimer();
 
-                if (ec)
-                {
-                    BMCWEB_LOG_DEBUG << this << " from write(2)";
-                    return;
-                }
-                if (!res.keepAlive())
-                {
-                    close();
-                    BMCWEB_LOG_DEBUG << this << " from write(1)";
-                    return;
-                }
+            if (ec)
+            {
+                BMCWEB_LOG_DEBUG << this << " from write(2)";
+                return;
+            }
+            if (!res.keepAlive())
+            {
+                close();
+                BMCWEB_LOG_DEBUG << this << " from write(1)";
+                return;
+            }
 
-                serializer.reset();
-                BMCWEB_LOG_DEBUG << this << " Clearing response";
-                res.clear();
-                parser.emplace(std::piecewise_construct, std::make_tuple());
-                parser->body_limit(httpReqBodyLimit); // reset body limit for
-                                                      // newly created parser
-                buffer.consume(buffer.size());
+            serializer.reset();
+            BMCWEB_LOG_DEBUG << this << " Clearing response";
+            res.clear();
+            parser.emplace(std::piecewise_construct, std::make_tuple());
+            parser->body_limit(httpReqBodyLimit); // reset body limit for
+                                                  // newly created parser
+            buffer.consume(buffer.size());
 
-                // If the session was built from the transport, we don't need to
-                // clear it.  All other sessions are generated per request.
-                if (!sessionIsFromTransport)
-                {
-                    userSession = nullptr;
-                }
+            // If the session was built from the transport, we don't need to
+            // clear it.  All other sessions are generated per request.
+            if (!sessionIsFromTransport)
+            {
+                userSession = nullptr;
+            }
 
-                // Destroy the Request via the std::optional
-                req.reset();
-                doReadHeaders();
-            });
+            // Destroy the Request via the std::optional
+            req.reset();
+            doReadHeaders();
+        });
     }
 
     void cancelDeadlineTimer()