diff options
author | Rider Linden <rider@lindenlab.com> | 2017-08-14 14:54:58 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2017-08-14 14:54:58 -0700 |
commit | 79856e655432a30f5bba2e8d7adecdc3626ce94f (patch) | |
tree | f83102e09960f73ff32faa4b25e4f3e6e0baf83e /indra/llcorehttp/_httpoprequest.cpp | |
parent | 1038633526330cf931ba097dbafdd270b5bb56e3 (diff) |
MAINT-7634: Feedback from code review, move enum to string converter to own function.
Diffstat (limited to 'indra/llcorehttp/_httpoprequest.cpp')
-rw-r--r-- | indra/llcorehttp/_httpoprequest.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 36955f3797..f526af37b5 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -247,24 +247,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) response->setHeaders(mReplyHeaders); response->setRequestURL(mReqURL); - std::string method("UNKNOWN"); - - if (mReqMethod == HOR_COPY) - method = "COPY"; - else if (mReqMethod == HOR_DELETE) - method = "DELETE"; - else if (mReqMethod == HOR_GET) - method = "GET"; - else if (mReqMethod == HOR_MOVE) - method = "MOVE"; - else if (mReqMethod == HOR_PATCH) - method = "PATCH"; - else if (mReqMethod == HOR_POST) - method = "POST"; - else if (mReqMethod == HOR_PUT) - method = "PUT"; - - response->setRequestMethod(method); + response->setRequestMethod(methodToString(mReqMethod)); if (mReplyOffset || mReplyLength) { @@ -1161,6 +1144,25 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe return 0; } +std::string HttpOpRequest::methodToString(const HttpOpRequest::EMethod &e) +{ + if (e == HOR_COPY) + return "COPY"; + else if (e == HOR_DELETE) + return "DELETE"; + else if (e == HOR_GET) + return "GET"; + else if (e == HOR_MOVE) + return "MOVE"; + else if (e == HOR_PATCH) + return "PATCH"; + else if (e == HOR_POST) + return "POST"; + else if (e == HOR_PUT) + return "PUT"; + + return "UNKNOWN"; +} } // end namespace LLCore |