summaryrefslogtreecommitdiff
path: root/indra/llmessage/llcorehttputil.cpp
diff options
context:
space:
mode:
authorRider Linden <none@none>2015-04-03 14:23:31 -0700
committerRider Linden <none@none>2015-04-03 14:23:31 -0700
commit17641c8427d05c4cde1fadd2ca059264d89bc818 (patch)
tree08f12a5bc407e770a99bc69a78807bf1d2bc4d5a /indra/llmessage/llcorehttputil.cpp
parentfbd58959c2ac2216fb451bd687558763ceb2ab30 (diff)
Added a class to automate pumping the HttpRequest on the mainloop.
Converted AccountingCostManager to use the new LLCore::Http library and coroutines.
Diffstat (limited to 'indra/llmessage/llcorehttputil.cpp')
-rw-r--r--indra/llmessage/llcorehttputil.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp
index 991985b1cf..30f5f3d3ed 100644
--- a/indra/llmessage/llcorehttputil.cpp
+++ b/indra/llmessage/llcorehttputil.cpp
@@ -279,6 +279,27 @@ void HttpCoroHandler::buildStatusEntry(LLCore::HttpResponse *response, LLCore::H
result["http_result"] = httpresults;
}
+HttpRequestPumper::HttpRequestPumper(const LLCore::HttpRequest::ptr_t &request):
+ mHttpRequest(request)
+{
+ mBoundListener = LLEventPumps::instance().obtain("mainloop").
+ listen(LLEventPump::inventName(), boost::bind(&HttpRequestPumper::pollRequest, this, _1));
+}
+
+HttpRequestPumper::~HttpRequestPumper()
+{
+ if (mBoundListener.connected())
+ {
+ mBoundListener.disconnect();
+ }
+}
+
+bool HttpRequestPumper::pollRequest(const LLSD&)
+{
+ mHttpRequest->update(0L);
+ return false;
+}
+
} // end namespace LLCoreHttpUtil