summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/_httpservice.cpp
diff options
context:
space:
mode:
authorAnchor Linden <anchor@lindenlab.com>2018-02-28 22:42:23 -0800
committerAnchor Linden <anchor@lindenlab.com>2018-02-28 22:42:23 -0800
commit618179a71722e47115a6b021a1eb2be99e46322f (patch)
tree7cb94aef6fe27ed0497790f07f8c190cf1944f92 /indra/llcorehttp/_httpservice.cpp
parentbfbcd6d16931819c43eea8e83963c9f86c6892dd (diff)
parent5a12a88f7b53bb99a6b302c35d891a8ecee59855 (diff)
Merge
Diffstat (limited to 'indra/llcorehttp/_httpservice.cpp')
-rw-r--r--indra/llcorehttp/_httpservice.cpp49
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;