summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage')
-rwxr-xr-xindra/llmessage/CMakeLists.txt2
-rwxr-xr-xindra/llmessage/llavatarnamecache.cpp12
-rw-r--r--indra/llmessage/llcorehttputil.cpp82
-rw-r--r--indra/llmessage/llcorehttputil.h121
4 files changed, 113 insertions, 104 deletions
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt
index fc51d147a6..10953408db 100755
--- a/indra/llmessage/CMakeLists.txt
+++ b/indra/llmessage/CMakeLists.txt
@@ -256,8 +256,8 @@ if (LL_TESTS)
${LLMESSAGE_LIBRARIES}
${LLCOREHTTP_LIBRARIES}
${JSONCPP_LIBRARIES}
- ${BOOST_COROUTINE_LIBRARY}
${BOOST_CONTEXT_LIBRARY}
+ ${BOOST_COROUTINE_LIBRARY}
${GOOGLEMOCK_LIBRARIES}
)
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index d262862c80..7014048021 100755
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -137,8 +137,8 @@ namespace LLAvatarNameCache
bool expirationFromCacheControl(const LLSD& headers, F64 *expires);
- // This is a coroutine.
- void requestAvatarNameCache_(std::string url, std::vector<LLUUID> agentIds);
+ // This is a coroutine. The only parameter that can be specified as a reference is the self
+ void requestAvatarNameCache_(LLCoros::self& self, std::string url, std::vector<LLUUID> agentIds);
void handleAvNameCacheSuccess(const LLSD &data, const LLSD &httpResult);
}
@@ -185,9 +185,9 @@ namespace LLAvatarNameCache
// Coroutine for sending and processing avatar name cache requests.
// Do not call directly. See documentation in lleventcoro.h and llcoro.h for
// further explanation.
-void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLUUID> agentIds)
+void LLAvatarNameCache::requestAvatarNameCache_(LLCoros::self& self, std::string url, std::vector<LLUUID> agentIds)
{
- LL_DEBUGS("AvNameCache") << "Entering coroutine " << LLCoros::instance().getName()
+ LL_DEBUGS("AvNameCache") << "Entering coroutine " << LLCoros::instance().getName(self)
<< " with url '" << url << "', requesting " << agentIds.size() << " Agent Ids" << LL_ENDL;
try
@@ -195,7 +195,7 @@ void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLU
bool success = true;
LLCoreHttpUtil::HttpCoroutineAdapter httpAdapter("NameCache", LLAvatarNameCache::sHttpPolicy);
- LLSD results = httpAdapter.getAndYield(sHttpRequest, url);
+ LLSD results = httpAdapter.getAndYield(self, sHttpRequest, url);
LLSD httpResults;
LL_DEBUGS() << results << LL_ENDL;
@@ -401,7 +401,7 @@ void LLAvatarNameCache::requestNamesViaCapability()
std::string coroname =
LLCoros::instance().launch("LLAvatarNameCache::requestAvatarNameCache_",
- boost::bind(&LLAvatarNameCache::requestAvatarNameCache_, url, agent_ids));
+ boost::bind(&LLAvatarNameCache::requestAvatarNameCache_, _1, url, agent_ids));
LL_DEBUGS("AvNameCache") << coroname << " with url '" << url << "', agent_ids.size()=" << agent_ids.size() << LL_ENDL;
}
diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp
index cd3c527241..ba840a6a36 100644
--- a/indra/llmessage/llcorehttputil.cpp
+++ b/indra/llmessage/llcorehttputil.cpp
@@ -102,8 +102,8 @@ HttpHandle requestPostWithLLSD(HttpRequest * request,
HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- HttpOptions * options,
- HttpHeaders * headers,
+ const HttpOptions::ptr_t &options,
+ const HttpHeaders::ptr_t &headers,
HttpHandler * handler)
{
HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID);
@@ -129,8 +129,8 @@ HttpHandle requestPutWithLLSD(HttpRequest * request,
HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- HttpOptions * options,
- HttpHeaders * headers,
+ const HttpOptions::ptr_t &options,
+ const HttpHeaders::ptr_t &headers,
HttpHandler * handler)
{
HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID);
@@ -155,8 +155,8 @@ HttpHandle requestPatchWithLLSD(HttpRequest * request,
HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- HttpOptions * options,
- HttpHeaders * headers,
+ const HttpOptions::ptr_t &options,
+ const HttpHeaders::ptr_t &headers,
HttpHandler * handler)
{
HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID);
@@ -286,7 +286,7 @@ void HttpCoroHandler::buildStatusEntry(LLCore::HttpResponse *response, LLCore::H
writeStatusCodes(status, response->getRequestURL(), httpresults);
LLSD httpHeaders = LLSD::emptyMap();
- LLCore::HttpHeaders * hdrs = response->getHeaders();
+ LLCore::HttpHeaders::ptr_t hdrs = response->getHeaders();
if (hdrs)
{
@@ -565,17 +565,17 @@ HttpCoroutineAdapter::~HttpCoroutineAdapter()
cancelYieldingOperation();
}
-LLSD HttpCoroutineAdapter::postAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName, true);
HttpCoroHandler::ptr_t httpHandler = HttpCoroHandler::ptr_t(new HttpCoroLLSDHandler(replyPump));
- return postAndYield_(request, url, body, options, headers, httpHandler);
+ return postAndYield_(self, request, url, body, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::postAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::postAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -602,29 +602,29 @@ LLSD HttpCoroutineAdapter::postAndYield_(LLCore::HttpRequest::ptr_t &request,
return results;
}
-LLSD HttpCoroutineAdapter::postAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::BufferArray::ptr_t rawbody,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName, true);
HttpCoroHandler::ptr_t httpHandler = HttpCoroHandler::ptr_t(new HttpCoroLLSDHandler(replyPump));
- return postAndYield_(request, url, rawbody, options, headers, httpHandler);
+ return postAndYield_(self, request, url, rawbody, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::postRawAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postRawAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::BufferArray::ptr_t rawbody,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName, true);
HttpCoroHandler::ptr_t httpHandler = HttpCoroHandler::ptr_t(new HttpCoroRawHandler(replyPump));
- return postAndYield_(request, url, rawbody, options, headers, httpHandler);
+ return postAndYield_(self, request, url, rawbody, options, headers, httpHandler);
}
// *TODO: This functionality could be moved into the LLCore::Http library itself
// by having the CURL layer read the file directly.
-LLSD HttpCoroutineAdapter::postFileAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postFileAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, std::string fileName,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
@@ -648,12 +648,12 @@ LLSD HttpCoroutineAdapter::postFileAndYield(LLCore::HttpRequest::ptr_t request,
}
}
- return postAndYield(request, url, fileData, options, headers);
+ return postAndYield(self, request, url, fileData, options, headers);
}
// *TODO: This functionality could be moved into the LLCore::Http library itself
// by having the CURL layer read the file directly.
-LLSD HttpCoroutineAdapter::postFileAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postFileAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, LLUUID assetId, LLAssetType::EType assetType,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
@@ -673,11 +673,11 @@ LLSD HttpCoroutineAdapter::postFileAndYield(LLCore::HttpRequest::ptr_t request,
delete[] fileBuffer;
}
- return postAndYield(request, url, fileData, options, headers);
+ return postAndYield(self, request, url, fileData, options, headers);
}
-LLSD HttpCoroutineAdapter::postAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::postAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::BufferArray::ptr_t &rawbody,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -689,7 +689,7 @@ LLSD HttpCoroutineAdapter::postAndYield_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestPost(mPolicyId, mPriority, url, rawbody.get(),
- options.get(), headers.get(), handler.get());
+ options, headers, handler.get());
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
{
@@ -704,17 +704,17 @@ LLSD HttpCoroutineAdapter::postAndYield_(LLCore::HttpRequest::ptr_t &request,
return results;
}
-LLSD HttpCoroutineAdapter::putAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::putAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler = HttpCoroHandler::ptr_t(new HttpCoroLLSDHandler(replyPump));
- return putAndYield_(request, url, body, options, headers, httpHandler);
+ return putAndYield_(self, request, url, body, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::putAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::putAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -741,37 +741,37 @@ LLSD HttpCoroutineAdapter::putAndYield_(LLCore::HttpRequest::ptr_t &request,
return results;
}
-LLSD HttpCoroutineAdapter::getAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::getAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler = HttpCoroHandler::ptr_t(new HttpCoroLLSDHandler(replyPump));
- return getAndYield_(request, url, options, headers, httpHandler);
+ return getAndYield_(self, request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::getRawAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::getRawAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler = HttpCoroHandler::ptr_t(new HttpCoroRawHandler(replyPump));
- return getAndYield_(request, url, options, headers, httpHandler);
+ return getAndYield_(self, request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::getJsonAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::getJsonAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler = HttpCoroHandler::ptr_t(new HttpCoroJSONHandler(replyPump));
- return getAndYield_(request, url, options, headers, httpHandler);
+ return getAndYield_(self, request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::getAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::getAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -782,7 +782,7 @@ LLSD HttpCoroutineAdapter::getAndYield_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestGet(mPolicyId, mPriority,
- url, options.get(), headers.get(), handler.get());
+ url, options, headers, handler.get());
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
{
@@ -797,17 +797,17 @@ LLSD HttpCoroutineAdapter::getAndYield_(LLCore::HttpRequest::ptr_t &request,
}
-LLSD HttpCoroutineAdapter::deleteAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::deleteAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler = HttpCoroHandler::ptr_t(new HttpCoroLLSDHandler(replyPump));
- return deleteAndYield_(request, url, options, headers, httpHandler);
+ return deleteAndYield_(self, request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::deleteAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::deleteAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers, HttpCoroHandler::ptr_t &handler)
{
@@ -817,7 +817,7 @@ LLSD HttpCoroutineAdapter::deleteAndYield_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestDelete(mPolicyId, mPriority,
- url, options.get(), headers.get(), handler.get());
+ url, options, headers, handler.get());
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
{
@@ -907,7 +907,7 @@ LLCore::HttpStatus HttpCoroutineAdapter::getStatusFromLLSD(const LLSD &httpResul
void HttpCoroutineAdapter::callbackHttpGet(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure)
{
LLCoros::instance().launch("HttpCoroutineAdapter::genericGetCoro",
- boost::bind(&HttpCoroutineAdapter::trivialGetCoro, url, policyId, success, failure));
+ boost::bind(&HttpCoroutineAdapter::trivialGetCoro, _1, url, policyId, success, failure));
}
/*static*/
@@ -921,7 +921,7 @@ void HttpCoroutineAdapter::messageHttpGet(const std::string &url, const std::str
}
/*static*/
-void HttpCoroutineAdapter::trivialGetCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure)
+void HttpCoroutineAdapter::trivialGetCoro(LLCoros::self& self, std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure)
{
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericGetCoro", policyId));
@@ -932,7 +932,7 @@ void HttpCoroutineAdapter::trivialGetCoro(std::string url, LLCore::HttpRequest::
LL_INFOS("HttpCoroutineAdapter", "genericGetCoro") << "Generic GET for " << url << LL_ENDL;
- LLSD result = httpAdapter->getAndYield(httpRequest, url, httpOpts);
+ LLSD result = httpAdapter->getAndYield(self, httpRequest, url, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -957,7 +957,7 @@ void HttpCoroutineAdapter::trivialGetCoro(std::string url, LLCore::HttpRequest::
void HttpCoroutineAdapter::callbackHttpPost(const std::string &url, LLCore::HttpRequest::policy_t policyId, const LLSD &postData, completionCallback_t success, completionCallback_t failure)
{
LLCoros::instance().launch("HttpCoroutineAdapter::genericPostCoro",
- boost::bind(&HttpCoroutineAdapter::trivialPostCoro, url, policyId, postData, success, failure));
+ boost::bind(&HttpCoroutineAdapter::trivialPostCoro, _1, url, policyId, postData, success, failure));
}
/*static*/
@@ -972,7 +972,7 @@ void HttpCoroutineAdapter::messageHttpPost(const std::string &url, const LLSD &p
}
/*static*/
-void HttpCoroutineAdapter::trivialPostCoro(std::string url, LLCore::HttpRequest::policy_t policyId, LLSD postData, completionCallback_t success, completionCallback_t failure)
+void HttpCoroutineAdapter::trivialPostCoro(LLCoros::self& self, std::string url, LLCore::HttpRequest::policy_t policyId, LLSD postData, completionCallback_t success, completionCallback_t failure)
{
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", policyId));
@@ -983,7 +983,7 @@ void HttpCoroutineAdapter::trivialPostCoro(std::string url, LLCore::HttpRequest:
LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData, httpOpts);
+ LLSD result = httpAdapter->postAndYield(self, httpRequest, url, postData, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h
index cf35177e48..6d8f333c72 100644
--- a/indra/llmessage/llcorehttputil.h
+++ b/indra/llmessage/llcorehttputil.h
@@ -107,25 +107,25 @@ std::string responseToString(LLCore::HttpResponse * response);
/// a now-useless HttpHandler object.
///
LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest * request,
- LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
- const std::string & url,
- const LLSD & body,
- LLCore::HttpOptions * options,
- LLCore::HttpHeaders * headers,
- LLCore::HttpHandler * handler);
+ LLCore::HttpRequest::policy_t policy_id,
+ LLCore::HttpRequest::priority_t priority,
+ const std::string & url,
+ const LLSD & body,
+ const LLCore::HttpOptions::ptr_t &options,
+ const LLCore::HttpHeaders::ptr_t &headers,
+ LLCore::HttpHandler * handler);
inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & request,
LLCore::HttpRequest::policy_t policy_id,
LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- LLCore::HttpOptions::ptr_t & options,
- LLCore::HttpHeaders::ptr_t & headers,
+ const LLCore::HttpOptions::ptr_t & options,
+ const LLCore::HttpHeaders::ptr_t & headers,
LLCore::HttpHandler * handler)
{
return requestPostWithLLSD(request.get(), policy_id, priority,
- url, body, options.get(), headers.get(), handler);
+ url, body, options, headers, handler);
}
inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & request,
@@ -135,8 +135,11 @@ inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & reque
const LLSD & body,
LLCore::HttpHandler * handler)
{
+ LLCore::HttpOptions::ptr_t options;
+ LLCore::HttpHeaders::ptr_t headers;
+
return requestPostWithLLSD(request.get(), policy_id, priority,
- url, body, NULL, NULL, handler);
+ url, body, options, headers, handler);
}
@@ -161,8 +164,8 @@ LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest * request,
LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- LLCore::HttpOptions * options,
- LLCore::HttpHeaders * headers,
+ const LLCore::HttpOptions::ptr_t &options,
+ const LLCore::HttpHeaders::ptr_t &headers,
LLCore::HttpHandler * handler);
inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & request,
@@ -170,12 +173,12 @@ inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & reques
LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- LLCore::HttpOptions::ptr_t & options,
- LLCore::HttpHeaders::ptr_t & headers,
+ const LLCore::HttpOptions::ptr_t & options,
+ const LLCore::HttpHeaders::ptr_t & headers,
LLCore::HttpHandler * handler)
{
return requestPutWithLLSD(request.get(), policy_id, priority,
- url, body, options.get(), headers.get(), handler);
+ url, body, options, headers, handler);
}
inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & request,
@@ -185,8 +188,11 @@ inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & reques
const LLSD & body,
LLCore::HttpHandler * handler)
{
+ LLCore::HttpOptions::ptr_t options;
+ LLCore::HttpHeaders::ptr_t headers;
+
return requestPutWithLLSD(request.get(), policy_id, priority,
- url, body, NULL, NULL, handler);
+ url, body, options, headers, handler);
}
/// Issue a standard HttpRequest::requestPatch() call but using
@@ -210,8 +216,8 @@ LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest * request,
LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- LLCore::HttpOptions * options,
- LLCore::HttpHeaders * headers,
+ const LLCore::HttpOptions::ptr_t &options,
+ const LLCore::HttpHeaders::ptr_t &headers,
LLCore::HttpHandler * handler);
inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & request,
@@ -219,12 +225,12 @@ inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & requ
LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- LLCore::HttpOptions::ptr_t & options,
- LLCore::HttpHeaders::ptr_t & headers,
+ const LLCore::HttpOptions::ptr_t & options,
+ const LLCore::HttpHeaders::ptr_t & headers,
LLCore::HttpHandler * handler)
{
return requestPatchWithLLSD(request.get(), policy_id, priority,
- url, body, options.get(), headers.get(), handler);
+ url, body, options, headers, handler);
}
inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & request,
@@ -234,8 +240,11 @@ inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & requ
const LLSD & body,
LLCore::HttpHandler * handler)
{
+ LLCore::HttpOptions::ptr_t options;
+ LLCore::HttpHeaders::ptr_t headers;
+
return requestPatchWithLLSD(request.get(), policy_id, priority,
- url, body, NULL, NULL, handler);
+ url, body, options, headers, handler);
}
//=========================================================================
@@ -320,67 +329,67 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD postAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::BufferArray::ptr_t rawbody,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD postAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postAndYield(request, url, body,
+ return postAndYield(self, request, url, body,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD postAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD postAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::BufferArray::ptr_t &rawbody,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postAndYield(request, url, rawbody,
+ return postAndYield(self, request, url, rawbody,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD postRawAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postRawAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::BufferArray::ptr_t rawbody,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postRawAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD postRawAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::BufferArray::ptr_t &rawbody,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postRawAndYield(request, url, rawbody,
+ return postRawAndYield(self, request, url, rawbody,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD postFileAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postFileAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, std::string fileName,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postFileAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD postFileAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, std::string fileName,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postFileAndYield(request, url, fileName,
+ return postFileAndYield(self, request, url, fileName,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD postFileAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postFileAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, LLUUID assetId, LLAssetType::EType assetType,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postFileAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postFileAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, LLUUID assetId, LLAssetType::EType assetType,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postFileAndYield(request, url, assetId, assetType,
+ return postFileAndYield(self, request, url, assetId, assetType,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
@@ -390,7 +399,7 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD putAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD putAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
@@ -400,38 +409,38 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD getAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD getAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD getAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD getAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpHeaders::ptr_t &headers)
{
- return getAndYield(request, url,
+ return getAndYield(self, request, url,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
headers);
}
- LLSD getRawAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD getRawAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD getRawAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD getRawAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpHeaders::ptr_t &headers)
{
- return getRawAndYield(request, url,
+ return getRawAndYield(self, request, url,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
headers);
}
- LLSD getJsonAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD getJsonAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD getJsonndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD getJsonndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpHeaders::ptr_t &headers)
{
- return getJsonAndYield(request, url,
+ return getJsonAndYield(self, request, url,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
headers);
}
@@ -442,7 +451,7 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD deleteAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD deleteAndYield(LLCoros::self & self, LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
@@ -486,31 +495,31 @@ private:
HttpCoroHandler::ptr_t &handler);
void cleanState();
- LLSD postAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD postAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
- LLSD postAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD postAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::BufferArray::ptr_t &rawbody,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
- LLSD putAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD putAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
- LLSD getAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD getAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers, HttpCoroHandler::ptr_t &handler);
- LLSD deleteAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD deleteAndYield_(LLCoros::self & self, LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers, HttpCoroHandler::ptr_t &handler);
- static void trivialGetCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure);
- static void trivialPostCoro(std::string url, LLCore::HttpRequest::policy_t policyId, LLSD postData, completionCallback_t success, completionCallback_t failure);
+ static void trivialGetCoro(LLCoros::self& self, std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure);
+ static void trivialPostCoro(LLCoros::self& self, std::string url, LLCore::HttpRequest::policy_t policyId, LLSD postData, completionCallback_t success, completionCallback_t failure);
void checkDefaultHeaders(LLCore::HttpHeaders::ptr_t &headers);