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/_httpservice.cpp | |
parent | 4cc6d44ef88196c940e9f7e74243146549a11018 (diff) | |
parent | 79856e655432a30f5bba2e8d7adecdc3626ce94f (diff) |
Merged in rider_linden/viewer64-gundam (pull request #18)
Default
Diffstat (limited to 'indra/llcorehttp/_httpservice.cpp')
-rw-r--r-- | indra/llcorehttp/_httpservice.cpp | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 6c39fdc61b..49d865cbfa 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -38,7 +38,8 @@ #include "lltimer.h" #include "llthread.h" - +#include "llexception.h" +#include "llmemory.h" namespace { @@ -293,22 +294,42 @@ void HttpService::threadRun(LLCoreInt::HttpThread * thread) ELoopSpeed loop(REQUEST_SLEEP); while (! mExitRequested) { - loop = processRequestQueue(loop); + try + { + loop = processRequestQueue(loop); - // Process ready queue issuing new requests as needed - ELoopSpeed new_loop = mPolicy->processReadyQueue(); - loop = (std::min)(loop, new_loop); + // Process ready queue issuing new requests as needed + ELoopSpeed new_loop = mPolicy->processReadyQueue(); + loop = (std::min)(loop, new_loop); - // Give libcurl some cycles - new_loop = mTransport->processTransport(); - loop = (std::min)(loop, new_loop); + // Give libcurl some cycles + new_loop = mTransport->processTransport(); + loop = (std::min)(loop, new_loop); - // Determine whether to spin, sleep briefly or sleep for next request - if (REQUEST_SLEEP != loop) - { - ms_sleep(HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS); - } - } + // Determine whether to spin, sleep briefly or sleep for next request + if (REQUEST_SLEEP != loop) + { + ms_sleep(HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS); + } + } + catch (const LLContinueError&) + { + LOG_UNHANDLED_EXCEPTION(""); + } + catch (std::bad_alloc) + { + LLMemory::logMemoryInfo(TRUE); + + //output possible call stacks to log file. + LLError::LLCallStacks::print(); + + LL_ERRS() << "Bad memory allocation in HttpService::threadRun()!" << LL_ENDL; + } + catch (...) + { + CRASH_ON_UNHANDLED_EXCEPTION(""); + } + } shutdown(); sState = STOPPED; |