Change HttpOptions::ptr_t to be shared_ptr<> rather than intrusive.
parent
1138c57f9a
commit
fe5567639d
|
|
@ -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())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace LLCore
|
|||
{
|
||||
|
||||
|
||||
HttpOptions::HttpOptions() : RefCounted(true),
|
||||
HttpOptions::HttpOptions() :
|
||||
mWantHeaders(false),
|
||||
mTracing(HTTP_TRACE_OFF),
|
||||
mTimeout(HTTP_REQUEST_TIMEOUT_DEFAULT),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue