diff options
author | Oz Linden <oz@lindenlab.com> | 2017-08-15 15:28:52 +0000 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2017-08-15 15:28:52 +0000 |
commit | bafe85a0f6e86912c43caaf4779cb4daa54c9ba3 (patch) | |
tree | 4c077382fb2eeb92cd7c6efdad3a9ea08f82b193 /indra/llcorehttp/_httpoprequest.cpp | |
parent | 4cc6d44ef88196c940e9f7e74243146549a11018 (diff) | |
parent | 79856e655432a30f5bba2e8d7adecdc3626ce94f (diff) |
Merged in rider_linden/viewer64-gundam (pull request #18)
Default
Diffstat (limited to 'indra/llcorehttp/_httpoprequest.cpp')
-rw-r--r-- | indra/llcorehttp/_httpoprequest.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 07cc0e4625..f526af37b5 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -47,6 +47,8 @@ #include "llhttpconstants.h" #include "llproxy.h" +#include "httpstats.h" + // *DEBUG: "[curl:bugs] #1420" problem and testing. // // A pipelining problem, https://sourceforge.net/p/curl/bugs/1420/, @@ -245,6 +247,8 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) response->setHeaders(mReplyHeaders); response->setRequestURL(mReqURL); + response->setRequestMethod(methodToString(mReqMethod)); + if (mReplyOffset || mReplyLength) { // Got an explicit offset/length in response @@ -805,6 +809,7 @@ size_t HttpOpRequest::writeCallback(void * data, size_t size, size_t nmemb, void } const size_t req_size(size * nmemb); const size_t write_size(op->mReplyBody->append(static_cast<char *>(data), req_size)); + HTTPStats::instance().recordDataDown(write_size); return write_size; } @@ -833,7 +838,8 @@ size_t HttpOpRequest::readCallback(void * data, size_t size, size_t nmemb, void const size_t do_size((std::min)(req_size, body_size - op->mCurlBodyPos)); const size_t read_size(op->mReqBody->read(op->mCurlBodyPos, static_cast<char *>(data), do_size)); - op->mCurlBodyPos += read_size; + HTTPStats::instance().recordDataUp(read_size); + op->mCurlBodyPos += read_size; return read_size; } @@ -1138,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 |