summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-07-08 12:09:36 -0700
committerRider Linden <rider@lindenlab.com>2015-07-08 12:09:36 -0700
commitfe5567639d7d4b6f13f66da0a1fb4bf2af295283 (patch)
treeba03f2211b8206ed7b1ade5dc6ffb84d11104be3 /indra
parent1138c57f9a8553903199e727912d7f1b092697e4 (diff)
Change HttpOptions::ptr_t to be shared_ptr<> rather than intrusive.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llcorehttp/_httpoprequest.cpp42
-rwxr-xr-xindra/llcorehttp/_httpoprequest.h23
-rwxr-xr-xindra/llcorehttp/examples/http_texture_load.cpp6
-rwxr-xr-xindra/llcorehttp/httpheaders.h2
-rwxr-xr-xindra/llcorehttp/httpoptions.cpp2
-rwxr-xr-xindra/llcorehttp/httpoptions.h7
-rwxr-xr-xindra/llcorehttp/httprequest.cpp28
-rwxr-xr-xindra/llcorehttp/httprequest.h31
-rwxr-xr-xindra/llcrashlogger/llcrashlogger.cpp2
-rw-r--r--indra/llmessage/llcorehttputil.cpp12
-rw-r--r--indra/llmessage/llcorehttputil.h18
-rwxr-xr-xindra/newview/llinventorymodel.cpp13
-rwxr-xr-xindra/newview/llinventorymodel.h2
-rwxr-xr-xindra/newview/llmaterialmgr.cpp2
-rwxr-xr-xindra/newview/llmeshrepository.cpp28
-rwxr-xr-xindra/newview/llmeshrepository.h6
-rwxr-xr-xindra/newview/lltexturefetch.cpp26
-rwxr-xr-xindra/newview/lltexturefetch.h4
-rwxr-xr-xindra/newview/llxmlrpctransaction.cpp2
19 files changed, 109 insertions, 147 deletions
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index 5d118a9afb..7baef25aca 100755
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -123,7 +123,7 @@ HttpOpRequest::HttpOpRequest()
mReqOffset(0),
mReqLength(0),
mReqHeaders(),
- mReqOptions(NULL),
+ mReqOptions(),
mCurlActive(false),
mCurlHandle(NULL),
mCurlService(NULL),
@@ -156,12 +156,6 @@ HttpOpRequest::~HttpOpRequest()
mReqBody = NULL;
}
- if (mReqOptions)
- {
- mReqOptions->release();
- mReqOptions = NULL;
- }
-
if (mCurlHandle)
{
// Uncertain of thread context so free using
@@ -287,8 +281,8 @@ HttpStatus HttpOpRequest::cancel()
HttpStatus HttpOpRequest::setupGet(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers)
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers)
{
setupCommon(policy_id, priority, url, NULL, options, headers);
mReqMethod = HOR_GET;
@@ -302,8 +296,8 @@ HttpStatus HttpOpRequest::setupGetByteRange(HttpRequest::policy_t policy_id,
const std::string & url,
size_t offset,
size_t len,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers)
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers)
{
setupCommon(policy_id, priority, url, NULL, options, headers);
mReqMethod = HOR_GET;
@@ -322,8 +316,8 @@ HttpStatus HttpOpRequest::setupPost(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers)
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers)
{
setupCommon(policy_id, priority, url, body, options, headers);
mReqMethod = HOR_POST;
@@ -336,8 +330,8 @@ HttpStatus HttpOpRequest::setupPut(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers)
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers)
{
setupCommon(policy_id, priority, url, body, options, headers);
mReqMethod = HOR_PUT;
@@ -349,8 +343,8 @@ HttpStatus HttpOpRequest::setupPut(HttpRequest::policy_t policy_id,
HttpStatus HttpOpRequest::setupDelete(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers)
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers)
{
setupCommon(policy_id, priority, url, NULL, options, headers);
mReqMethod = HOR_DELETE;
@@ -363,8 +357,8 @@ HttpStatus HttpOpRequest::setupPatch(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers)
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers)
{
setupCommon(policy_id, priority, url, body, options, headers);
mReqMethod = HOR_PATCH;
@@ -376,7 +370,7 @@ HttpStatus HttpOpRequest::setupPatch(HttpRequest::policy_t policy_id,
HttpStatus HttpOpRequest::setupCopy(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
- HttpOptions * options,
+ HttpOptions::ptr_t & options,
HttpHeaders::ptr_t &headers)
{
setupCommon(policy_id, priority, url, NULL, options, headers);
@@ -390,8 +384,8 @@ void HttpOpRequest::setupCommon(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers)
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers)
{
mProcFlags = 0U;
mReqPolicy = policy_id;
@@ -404,12 +398,10 @@ void HttpOpRequest::setupCommon(HttpRequest::policy_t policy_id,
}
if (headers && ! mReqHeaders)
{
- //headers->addRef();
mReqHeaders = headers;
}
- if (options && ! mReqOptions)
+ if (options && !mReqOptions)
{
- options->addRef();
mReqOptions = options;
if (options->getWantHeaders())
{
diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h
index 0465c2b83f..42db71e7a0 100755
--- a/indra/llcorehttp/_httpoprequest.h
+++ b/indra/llcorehttp/_httpoprequest.h
@@ -42,14 +42,13 @@
#include "_refcounted.h"
#include "httpheaders.h"
+#include "httpoptions.h"
namespace LLCore
{
class BufferArray;
-class HttpHeaders;
-class HttpOptions;
/// HttpOpRequest requests a supported HTTP method invocation with
@@ -105,7 +104,7 @@ public:
HttpStatus setupGet(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
- HttpOptions * options,
+ HttpOptions::ptr_t & options,
HttpHeaders::ptr_t & headers);
HttpStatus setupGetByteRange(HttpRequest::policy_t policy_id,
@@ -113,40 +112,40 @@ public:
const std::string & url,
size_t offset,
size_t len,
- HttpOptions * options,
+ HttpOptions::ptr_t & options,
HttpHeaders::ptr_t & headers);
HttpStatus setupPost(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
+ HttpOptions::ptr_t & options,
HttpHeaders::ptr_t & headers);
HttpStatus setupPut(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
+ HttpOptions::ptr_t & options,
HttpHeaders::ptr_t & headers);
HttpStatus setupDelete(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
- HttpOptions * options,
+ HttpOptions::ptr_t & options,
HttpHeaders::ptr_t & headers);
HttpStatus setupPatch(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
+ HttpOptions::ptr_t & options,
HttpHeaders::ptr_t & headers);
HttpStatus setupCopy(HttpRequest::policy_t policy_id,
HttpRequest::priority_t priority,
const std::string & url,
- HttpOptions * options,
+ HttpOptions::ptr_t & options,
HttpHeaders::ptr_t & headers);
// Internal method used to setup the libcurl options for a request.
@@ -167,8 +166,8 @@ protected:
HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers);
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers);
// libcurl operational callbacks
//
@@ -199,7 +198,7 @@ public:
off_t mReqOffset;
size_t mReqLength;
HttpHeaders::ptr_t mReqHeaders;
- HttpOptions * mReqOptions;
+ HttpOptions::ptr_t mReqOptions;
// Transport data
bool mCurlActive;
diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp
index 9d9631b980..13c9f90b2e 100755
--- a/indra/llcorehttp/examples/http_texture_load.cpp
+++ b/indra/llcorehttp/examples/http_texture_load.cpp
@@ -83,7 +83,7 @@ public:
WorkingSet();
~WorkingSet();
- bool reload(LLCore::HttpRequest *, LLCore::HttpOptions *);
+ bool reload(LLCore::HttpRequest *, LLCore::HttpOptions::ptr_t &);
virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response);
@@ -304,7 +304,7 @@ int main(int argc, char** argv)
LLCore::HttpRequest * hr = new LLCore::HttpRequest();
// Get request options
- LLCore::HttpOptions * opt = new LLCore::HttpOptions();
+ LLCore::HttpOptions::ptr_t opt = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions());
opt->setRetries(12);
opt->setUseRetryAfter(true);
@@ -442,7 +442,7 @@ WorkingSet::~WorkingSet()
}
-bool WorkingSet::reload(LLCore::HttpRequest * hr, LLCore::HttpOptions * opt)
+bool WorkingSet::reload(LLCore::HttpRequest * hr, LLCore::HttpOptions::ptr_t & opt)
{
if (mRequestLowWater <= mHandles.size())
{
diff --git a/indra/llcorehttp/httpheaders.h b/indra/llcorehttp/httpheaders.h
index a97bae5537..b9168cb6ec 100755
--- a/indra/llcorehttp/httpheaders.h
+++ b/indra/llcorehttp/httpheaders.h
@@ -85,6 +85,7 @@ public:
typedef container_t::const_reverse_iterator const_reverse_iterator;
typedef container_t::value_type value_type;
typedef container_t::size_type size_type;
+ typedef boost::shared_ptr<HttpHeaders> ptr_t;
public:
/// @post In addition to the instance, caller has a refcount
@@ -94,7 +95,6 @@ public:
virtual ~HttpHeaders(); // Use release()
//typedef LLCoreInt::IntrusivePtr<HttpHeaders> ptr_t;
- typedef boost::shared_ptr<HttpHeaders> ptr_t;
protected:
HttpHeaders(const HttpHeaders &); // Not defined
diff --git a/indra/llcorehttp/httpoptions.cpp b/indra/llcorehttp/httpoptions.cpp
index 3459a37aff..aab447f2dd 100755
--- a/indra/llcorehttp/httpoptions.cpp
+++ b/indra/llcorehttp/httpoptions.cpp
@@ -33,7 +33,7 @@ namespace LLCore
{
-HttpOptions::HttpOptions() : RefCounted(true),
+HttpOptions::HttpOptions() :
mWantHeaders(false),
mTracing(HTTP_TRACE_OFF),
mTimeout(HTTP_REQUEST_TIMEOUT_DEFAULT),
diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h
index 2fe05a65ff..510eaa45bb 100755
--- a/indra/llcorehttp/httpoptions.h
+++ b/indra/llcorehttp/httpoptions.h
@@ -55,15 +55,16 @@ namespace LLCore
/// Allocation: Refcounted, heap only. Caller of the constructor
/// is given a refcount.
///
-class HttpOptions : public LLCoreInt::RefCounted
+class HttpOptions : private boost::noncopyable
{
public:
HttpOptions();
- typedef LLCoreInt::IntrusivePtr<HttpOptions> ptr_t;
+ typedef boost::shared_ptr<HttpOptions> ptr_t;
+
+ virtual ~HttpOptions(); // Use release()
protected:
- virtual ~HttpOptions(); // Use release()
HttpOptions(const HttpOptions &); // Not defined
void operator=(const HttpOptions &); // Not defined
diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp
index b5ea0b44b0..4a7352c962 100755
--- a/indra/llcorehttp/httprequest.cpp
+++ b/indra/llcorehttp/httprequest.cpp
@@ -197,8 +197,8 @@ HttpStatus HttpRequest::getStatus() const
HttpHandle HttpRequest::requestGet(policy_t policy_id,
priority_t priority,
const std::string & url,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler)
{
HttpStatus status;
@@ -231,8 +231,8 @@ HttpHandle HttpRequest::requestGetByteRange(policy_t policy_id,
const std::string & url,
size_t offset,
size_t len,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler)
{
HttpStatus status;
@@ -264,8 +264,8 @@ HttpHandle HttpRequest::requestPost(policy_t policy_id,
priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler)
{
HttpStatus status;
@@ -297,8 +297,8 @@ HttpHandle HttpRequest::requestPut(policy_t policy_id,
priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler)
{
HttpStatus status;
@@ -328,8 +328,8 @@ HttpHandle HttpRequest::requestPut(policy_t policy_id,
HttpHandle HttpRequest::requestDelete(policy_t policy_id,
priority_t priority,
const std::string & url,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler)
{
HttpStatus status;
@@ -360,8 +360,8 @@ HttpHandle HttpRequest::requestPatch(policy_t policy_id,
priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler)
{
HttpStatus status;
@@ -391,8 +391,8 @@ HttpHandle HttpRequest::requestPatch(policy_t policy_id,
HttpHandle HttpRequest::requestCopy(policy_t policy_id,
priority_t priority,
const std::string & url,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler)
{
HttpStatus status;
diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h
index c0622372e1..58aea1444c 100755
--- a/indra/llcorehttp/httprequest.h
+++ b/indra/llcorehttp/httprequest.h
@@ -32,6 +32,7 @@
#include "httphandler.h"
#include "httpheaders.h"
+#include "httpoptions.h"
namespace LLCore
{
@@ -39,8 +40,6 @@ namespace LLCore
class HttpRequestQueue;
class HttpReplyQueue;
class HttpService;
-class HttpOptions;
-class HttpHeaders;
class HttpOperation;
class BufferArray;
@@ -349,8 +348,8 @@ public:
HttpHandle requestGet(policy_t policy_id,
priority_t priority,
const std::string & url,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * handler);
@@ -392,8 +391,8 @@ public:
const std::string & url,
size_t offset,
size_t len,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * handler);
@@ -433,8 +432,8 @@ public:
priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * handler);
@@ -474,8 +473,8 @@ public:
priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * handler);
@@ -494,8 +493,8 @@ public:
HttpHandle requestDelete(policy_t policy_id,
priority_t priority,
const std::string & url,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler);
/// Queue a full HTTP PUT. Query arguments and body may
@@ -517,8 +516,8 @@ public:
priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler);
/// Queue a full HTTP PUT. Query arguments and body may
@@ -536,8 +535,8 @@ public:
HttpHandle requestCopy(policy_t policy_id,
priority_t priority,
const std::string & url,
- HttpOptions * options,
- HttpHeaders::ptr_t &headers,
+ HttpOptions::ptr_t & options,
+ HttpHeaders::ptr_t & headers,
HttpHandler * user_handler);
/// Queue a NoOp request.
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index ed585ff64e..4caf6dcd05 100755
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -407,7 +407,7 @@ bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg
updateApplication(llformat("%s, try %d...", msg.c_str(), i+1));
LLCoreHttpUtil::requestPostWithLLSD(httpRequest.get(), LLCore::HttpRequest::DEFAULT_POLICY_ID, 0,
- host, data, httpOpts.get(), LLCore::HttpHeaders::ptr_t(), new LLCrashLoggerHandler);
+ host, data, httpOpts, LLCore::HttpHeaders::ptr_t(), new LLCrashLoggerHandler);
while(!gBreak)
{
diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp
index e3588b74ee..24f5d77ee1 100644
--- a/indra/llmessage/llcorehttputil.cpp
+++ b/indra/llmessage/llcorehttputil.cpp
@@ -102,7 +102,7 @@ HttpHandle requestPostWithLLSD(HttpRequest * request,
HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- HttpOptions * options,
+ HttpOptions::ptr_t &options,
HttpHeaders::ptr_t &headers,
HttpHandler * handler)
{
@@ -129,7 +129,7 @@ HttpHandle requestPutWithLLSD(HttpRequest * request,
HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- HttpOptions * options,
+ HttpOptions::ptr_t &options,
HttpHeaders::ptr_t &headers,
HttpHandler * handler)
{
@@ -155,7 +155,7 @@ HttpHandle requestPatchWithLLSD(HttpRequest * request,
HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- HttpOptions * options,
+ HttpOptions::ptr_t &options,
HttpHeaders::ptr_t &headers,
HttpHandler * handler)
{
@@ -689,7 +689,7 @@ LLSD HttpCoroutineAdapter::postAndYield_(LLCoros::self & self, LLCore::HttpReque
// 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, handler.get());
+ options, headers, handler.get());
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
{
@@ -782,7 +782,7 @@ LLSD HttpCoroutineAdapter::getAndYield_(LLCoros::self & self, LLCore::HttpReques
// 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, handler.get());
+ url, options, headers, handler.get());
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
{
@@ -817,7 +817,7 @@ LLSD HttpCoroutineAdapter::deleteAndYield_(LLCoros::self & self, LLCore::HttpReq
// 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, handler.get());
+ url, options, headers, handler.get());
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
{
diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h
index a54f94e6f0..1e575e0e0c 100644
--- a/indra/llmessage/llcorehttputil.h
+++ b/indra/llmessage/llcorehttputil.h
@@ -111,7 +111,7 @@ LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest * request,
LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- LLCore::HttpOptions * options,
+ LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers,
LLCore::HttpHandler * handler);
@@ -125,7 +125,7 @@ inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & reque
LLCore::HttpHandler * handler)
{
return requestPostWithLLSD(request.get(), policy_id, priority,
- url, body, options.get(), headers, handler);
+ url, body, options, headers, handler);
}
inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & request,
@@ -136,7 +136,7 @@ inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & reque
LLCore::HttpHandler * handler)
{
return requestPostWithLLSD(request.get(), policy_id, priority,
- url, body, NULL, LLCore::HttpHeaders::ptr_t(), handler);
+ url, body, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t(), handler);
}
@@ -161,7 +161,7 @@ LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest * request,
LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- LLCore::HttpOptions * options,
+ LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers,
LLCore::HttpHandler * handler);
@@ -175,7 +175,7 @@ inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & reques
LLCore::HttpHandler * handler)
{
return requestPutWithLLSD(request.get(), policy_id, priority,
- url, body, options.get(), headers, handler);
+ url, body, options, headers, handler);
}
inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & request,
@@ -186,7 +186,7 @@ inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & reques
LLCore::HttpHandler * handler)
{
return requestPutWithLLSD(request.get(), policy_id, priority,
- url, body, NULL, LLCore::HttpHeaders::ptr_t(), handler);
+ url, body, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t(), handler);
}
/// Issue a standard HttpRequest::requestPatch() call but using
@@ -210,7 +210,7 @@ LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest * request,
LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
- LLCore::HttpOptions * options,
+ LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers,
LLCore::HttpHandler * handler);
@@ -224,7 +224,7 @@ inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & requ
LLCore::HttpHandler * handler)
{
return requestPatchWithLLSD(request.get(), policy_id, priority,
- url, body, options.get(), headers, handler);
+ url, body, options, headers, handler);
}
inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & request,
@@ -235,7 +235,7 @@ inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & requ
LLCore::HttpHandler * handler)
{
return requestPatchWithLLSD(request.get(), policy_id, priority,
- url, body, NULL, LLCore::HttpHeaders::ptr_t(), handler);
+ url, body, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t(), handler);
}
//=========================================================================
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index cf550c20c5..39aeab22e5 100755
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -148,7 +148,7 @@ LLInventoryModel::LLInventoryModel()
mObservers(),
mHttpRequestFG(NULL),
mHttpRequestBG(NULL),
- mHttpOptions(NULL),
+ mHttpOptions(),
mHttpHeaders(),
mHttpPolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID),
mHttpPriorityFG(0),
@@ -179,11 +179,8 @@ void LLInventoryModel::cleanupInventory()
// Run down HTTP transport
mHttpHeaders.reset();
- if (mHttpOptions)
- {
- mHttpOptions->release();
- mHttpOptions = NULL;
- }
+ mHttpOptions.reset();
+
delete mHttpRequestFG;
mHttpRequestFG = NULL;
delete mHttpRequestBG;
@@ -609,7 +606,7 @@ void LLInventoryModel::createNewCategoryCoro(LLCoros::self& self, std::string ur
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("createNewCategoryCoro", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
+ LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
httpOpts->setWantHeaders(true);
@@ -2414,7 +2411,7 @@ void LLInventoryModel::initHttpRequest()
mHttpRequestFG = new LLCore::HttpRequest;
mHttpRequestBG = new LLCore::HttpRequest;
- mHttpOptions = new LLCore::HttpOptions;
+ mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
mHttpOptions->setTransferTimeout(300);
mHttpOptions->setUseRetryAfter(true);
// mHttpOptions->setTrace(2); // Do tracing of requests
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 9711fb95f6..f768e61ccb 100755
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -571,7 +571,7 @@ private:
// Usual plumbing for LLCore:: HTTP operations.
LLCore::HttpRequest * mHttpRequestFG;
LLCore::HttpRequest * mHttpRequestBG;
- LLCore::HttpOptions * mHttpOptions;
+ LLCore::HttpOptions::ptr_t mHttpOptions;
LLCore::HttpHeaders::ptr_t mHttpHeaders;
LLCore::HttpRequest::policy_t mHttpPolicyClass;
LLCore::HttpRequest::priority_t mHttpPriorityFG;
diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp
index e6f3540877..1045def72e 100755
--- a/indra/newview/llmaterialmgr.cpp
+++ b/indra/newview/llmaterialmgr.cpp
@@ -712,7 +712,7 @@ void LLMaterialMgr::processGetAllQueue()
);
LLCore::HttpHandle handle = mHttpRequest->requestGet(mHttpPolicy, mHttpPriority, capURL,
- mHttpOptions.get(), mHttpHeaders, handler);
+ mHttpOptions, mHttpHeaders, handler);
if (handle == LLCORE_HTTP_HANDLE_INVALID)
{
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 7f8e357e33..d6aaf18cb7 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -738,8 +738,8 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content,
LLMeshRepoThread::LLMeshRepoThread()
: LLThread("mesh repo"),
mHttpRequest(NULL),
- mHttpOptions(NULL),
- mHttpLargeOptions(NULL),
+ mHttpOptions(),
+ mHttpLargeOptions(),
mHttpHeaders(),
mHttpPolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID),
mHttpLegacyPolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID),
@@ -753,10 +753,10 @@ LLMeshRepoThread::LLMeshRepoThread()
mHeaderMutex = new LLMutex(NULL);
mSignal = new LLCondition(NULL);
mHttpRequest = new LLCore::HttpRequest;
- mHttpOptions = new LLCore::HttpOptions;
+ mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
mHttpOptions->setTransferTimeout(SMALL_MESH_XFER_TIMEOUT);
mHttpOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter"));
- mHttpLargeOptions = new LLCore::HttpOptions;
+ mHttpLargeOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
mHttpLargeOptions->setTransferTimeout(LARGE_MESH_XFER_TIMEOUT);
mHttpLargeOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter"));
mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders);
@@ -782,17 +782,8 @@ LLMeshRepoThread::~LLMeshRepoThread()
}
mHttpRequestSet.clear();
mHttpHeaders.reset();
- if (mHttpOptions)
- {
- mHttpOptions->release();
- mHttpOptions = NULL;
- }
- if (mHttpLargeOptions)
- {
- mHttpLargeOptions->release();
- mHttpLargeOptions = NULL;
- }
- delete mHttpRequest;
+
+ delete mHttpRequest;
mHttpRequest = NULL;
delete mMutex;
mMutex = NULL;
@@ -1878,7 +1869,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut") ;
mHttpRequest = new LLCore::HttpRequest;
- mHttpOptions = new LLCore::HttpOptions;
+ mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
mHttpOptions->setTransferTimeout(mMeshUploadTimeOut);
mHttpOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter"));
mHttpOptions->setRetries(UPLOAD_RETRY_LIMIT);
@@ -1890,11 +1881,6 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
LLMeshUploadThread::~LLMeshUploadThread()
{
- if (mHttpOptions)
- {
- mHttpOptions->release();
- mHttpOptions = NULL;
- }
delete mHttpRequest;
mHttpRequest = NULL;
}
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index dc1fa883b3..55157cc040 100755
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -322,8 +322,8 @@ public:
// llcorehttp library interface objects.
LLCore::HttpStatus mHttpStatus;
LLCore::HttpRequest * mHttpRequest;
- LLCore::HttpOptions * mHttpOptions;
- LLCore::HttpOptions * mHttpLargeOptions;
+ LLCore::HttpOptions::ptr_t mHttpOptions;
+ LLCore::HttpOptions::ptr_t mHttpLargeOptions;
LLCore::HttpHeaders::ptr_t mHttpHeaders;
LLCore::HttpRequest::policy_t mHttpPolicyClass;
LLCore::HttpRequest::policy_t mHttpLegacyPolicyClass;
@@ -493,7 +493,7 @@ private:
// llcorehttp library interface objects.
LLCore::HttpStatus mHttpStatus;
LLCore::HttpRequest * mHttpRequest;
- LLCore::HttpOptions * mHttpOptions;
+ LLCore::HttpOptions::ptr_t mHttpOptions;
LLCore::HttpHeaders::ptr_t mHttpHeaders;
LLCore::HttpRequest::policy_t mHttpPolicyClass;
LLCore::HttpRequest::priority_t mHttpPriority;
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 1055216b65..e61eeb2f4e 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -1557,7 +1557,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
// Will call callbackHttpGet when curl request completes
// Only server bake images use the returned headers currently, for getting retry-after field.
- LLCore::HttpOptions *options = (mFTType == FTT_SERVER_BAKE) ? mFetcher->mHttpOptionsWithHeaders: mFetcher->mHttpOptions;
+ LLCore::HttpOptions::ptr_t options = (mFTType == FTT_SERVER_BAKE) ? mFetcher->mHttpOptionsWithHeaders: mFetcher->mHttpOptions;
if (disable_range_req)
{
// 'Range:' requests may be disabled in which case all HTTP
@@ -2509,8 +2509,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
mTotalHTTPRequests(0),
mQAMode(qa_mode),
mHttpRequest(NULL),
- mHttpOptions(NULL),
- mHttpOptionsWithHeaders(NULL),
+ mHttpOptions(),
+ mHttpOptionsWithHeaders(),
mHttpHeaders(),
mHttpPolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID),
mHttpMetricsHeaders(),
@@ -2528,8 +2528,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp());
mHttpRequest = new LLCore::HttpRequest;
- mHttpOptions = new LLCore::HttpOptions;
- mHttpOptionsWithHeaders = new LLCore::HttpOptions;
+ mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
+ mHttpOptionsWithHeaders = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
mHttpOptionsWithHeaders->setWantHeaders(true);
mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders);
mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_IMAGE_X_J2C);
@@ -2568,18 +2568,6 @@ LLTextureFetch::~LLTextureFetch()
delete req;
}
- if (mHttpOptions)
- {
- mHttpOptions->release();
- mHttpOptions = NULL;
- }
-
- if (mHttpOptionsWithHeaders)
- {
- mHttpOptionsWithHeaders->release();
- mHttpOptionsWithHeaders = NULL;
- }
-
mHttpWaitResource.clear();
delete mHttpRequest;
@@ -4031,7 +4019,7 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
report_priority,
mCapsURL,
sd,
- NULL,
+ LLCore::HttpOptions::ptr_t(),
fetcher->getMetricsHeaders(),
handler);
LLTextureFetch::svMetricsDataBreak = false;
@@ -4608,7 +4596,7 @@ S32 LLTextureFetchDebugger::fillCurlQueue()
texture_url,
0,
requestedSize,
- NULL,
+ LLCore::HttpOptions::ptr_t(),
mHttpHeaders,
this);
if (LLCORE_HTTP_HANDLE_INVALID != handle)
diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h
index a5d6cd63d7..e569175e8f 100755
--- a/indra/newview/lltexturefetch.h
+++ b/indra/newview/lltexturefetch.h
@@ -354,8 +354,8 @@ private:
// to make our HTTP requests. These replace the various
// LLCurl interfaces used in the past.
LLCore::HttpRequest * mHttpRequest; // Ttf
- LLCore::HttpOptions * mHttpOptions; // Ttf
- LLCore::HttpOptions * mHttpOptionsWithHeaders; // Ttf
+ LLCore::HttpOptions::ptr_t mHttpOptions; // Ttf
+ LLCore::HttpOptions::ptr_t mHttpOptionsWithHeaders; // Ttf
LLCore::HttpHeaders::ptr_t mHttpHeaders; // Ttf
LLCore::HttpRequest::policy_t mHttpPolicyClass; // T*
LLCore::HttpHeaders::ptr_t mHttpMetricsHeaders; // Ttf
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index 63ad4bd49b..5828aee7fc 100755
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -390,7 +390,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
mHandler = LLXMLRPCTransaction::Handler::ptr_t(new Handler( mHttpRequest, this ));
mPostH = mHttpRequest->requestPost(LLCore::HttpRequest::DEFAULT_POLICY_ID, 0,
- mURI, body.get(), httpOpts.get(), httpHeaders, mHandler.get());
+ mURI, body.get(), httpOpts, httpHeaders, mHandler.get());
}