summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/_httprequestqueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcorehttp/_httprequestqueue.cpp')
-rw-r--r--indra/llcorehttp/_httprequestqueue.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/indra/llcorehttp/_httprequestqueue.cpp b/indra/llcorehttp/_httprequestqueue.cpp
index 92bb5ec5c1..6487ef6fa5 100644
--- a/indra/llcorehttp/_httprequestqueue.cpp
+++ b/indra/llcorehttp/_httprequestqueue.cpp
@@ -39,7 +39,8 @@ HttpRequestQueue * HttpRequestQueue::sInstance(NULL);
HttpRequestQueue::HttpRequestQueue()
- : RefCounted(true)
+ : RefCounted(true),
+ mQueueStopped(false)
{
}
@@ -72,14 +73,25 @@ void HttpRequestQueue::term()
}
-void HttpRequestQueue::addOp(HttpOperation * op)
+HttpStatus HttpRequestQueue::addOp(HttpOperation * op)
{
+ bool wake(false);
{
HttpScopedLock lock(mQueueMutex);
+ if (mQueueStopped)
+ {
+ // Return op and error to caller
+ return HttpStatus(HttpStatus::LLCORE, HE_SHUTTING_DOWN);
+ }
+ wake = mQueue.empty();
mQueue.push_back(op);
}
- mQueueCV.notify_all();
+ if (wake)
+ {
+ mQueueCV.notify_all();
+ }
+ return HttpStatus();
}
@@ -129,4 +141,15 @@ void HttpRequestQueue::fetchAll(bool wait, OpContainer & ops)
return;
}
+
+void HttpRequestQueue::stopQueue()
+{
+ {
+ HttpScopedLock lock(mQueueMutex);
+
+ mQueueStopped = true;
+ }
+}
+
+
} // end namespace LLCore