diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2017-10-11 14:35:49 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2017-10-11 14:35:49 -0400 |
commit | 0c7bc67814dd4fa347401c24ba0e1be78e4b838f (patch) | |
tree | 450fc1ce0aff2f2880c32b3ca85161ca0ceff8a6 /indra/llcorehttp/_httpservice.cpp | |
parent | b6d22de58850fc9a5b34eeb5b7930e5845bfc42d (diff) | |
parent | 25be14381e29481413c94edf5436c0af715a1578 (diff) |
Automated merge with ssh://bitbucket.org/lindenlab/viewer-release
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; |