summaryrefslogtreecommitdiff
path: root/indra/newview/llaccountingcostmanager.cpp
diff options
context:
space:
mode:
authorRider Linden <none@none>2015-04-07 10:30:10 -0700
committerRider Linden <none@none>2015-04-07 10:30:10 -0700
commit8a76284e488227b9ff83917cdec2ea011c088527 (patch)
treeef4006a5f22a8676fd078b9524f28b257e71ae0b /indra/newview/llaccountingcostmanager.cpp
parent0962dd23bdca11cae7d4cabda338814de5f756c8 (diff)
Results from code review with Nat. Consolidate some of the coroutine/http code into a single adapter.
Diffstat (limited to 'indra/newview/llaccountingcostmanager.cpp')
-rwxr-xr-xindra/newview/llaccountingcostmanager.cpp28
1 files changed, 5 insertions, 23 deletions
diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp
index a80715dad5..f33f67e76d 100755
--- a/indra/newview/llaccountingcostmanager.cpp
+++ b/indra/newview/llaccountingcostmanager.cpp
@@ -53,10 +53,6 @@ LLAccountingCostManager::LLAccountingCostManager():
void LLAccountingCostManager::accountingCostCoro(LLCoros::self& self, std::string url,
eSelectionType selectionType, const LLHandle<LLAccountingCostObserver> observerHandle)
{
- LLEventStream replyPump("AccountingCostReply", true);
- LLCoreHttpUtil::HttpCoroHandler::ptr_t httpHandler =
- LLCoreHttpUtil::HttpCoroHandler::ptr_t(new LLCoreHttpUtil::HttpCoroHandler(replyPump));
-
LL_DEBUGS("LLAccountingCostManager") << "Entering coroutine " << LLCoros::instance().getName(self)
<< " with url '" << url << LL_ENDL;
@@ -108,36 +104,22 @@ void LLAccountingCostManager::accountingCostCoro(LLCoros::self& self, std::strin
LLUUID transactionId = observer->getTransactionID();
observer = NULL;
- LLSD results;
- { // Scoping block for pumper object
- //LL_INFOS() << "Requesting transaction " << transactionId << LL_ENDL;
- LLCoreHttpUtil::HttpRequestPumper pumper(mHttpRequest);
- LLCore::HttpHandle hhandle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest,
- mHttpPolicy, mHttpPriority, url, dataToPost, mHttpOptions, mHttpHeaders,
- httpHandler.get());
+ LLCoreHttpUtil::HttpCoroutineAdapter httpAdapter("AccountingCost", mHttpPolicy);
- if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
- {
- LLCore::HttpStatus status = mHttpRequest->getStatus();
- LL_WARNS() << "Error posting to " << url << " Status=" << status.getStatus() <<
- " message = " << status.getMessage() << LL_ENDL;
- mPendingObjectQuota.clear();
- return;
- }
+ LLSD results = httpAdapter.postAndYield(self, mHttpRequest, url, dataToPost);
- results = waitForEventOn(self, replyPump);
- //LL_INFOS() << "Results for transaction " << transactionId << LL_ENDL;
- }
LLSD httpResults;
httpResults = results["http_result"];
+ // do/while(false) allows error conditions to break out of following
+ // block while normal flow goes forward once.
do
{
observer = observerHandle.get();
if ((!observer) || (observer->getTransactionID() != transactionId))
{ // *TODO: Rider: I've noticed that getTransactionID() does not
// always match transactionId (the new transaction Id does not show a
- // corresponding request.)
+ // corresponding request.) (ask Vir)
if (!observer)
break;
LL_WARNS() << "Request transaction Id(" << transactionId