From 6f4d36634e980bb989b9a8b762c3c622804c43dd Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 16 Mar 2015 17:14:34 -0700 Subject: Removal of RPCXML dep on LLCurl switching to LLCore::Html --- indra/llcorehttp/httprequest.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'indra/llcorehttp/httprequest.cpp') diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp index 7b1888e3eb..5f1ed3d43b 100755 --- a/indra/llcorehttp/httprequest.cpp +++ b/indra/llcorehttp/httprequest.cpp @@ -117,6 +117,15 @@ HttpStatus HttpRequest::setStaticPolicyOption(EPolicyOption opt, policy_t pclass return HttpService::instanceOf()->setPolicyOption(opt, pclass, value, ret_value); } +HttpStatus HttpRequest::setStaticPolicyOption(EPolicyOption opt, policy_t pclass, policyCallback value, policyCallback * ret_value) +{ + if (HttpService::RUNNING == HttpService::instanceOf()->getState()) + { + return HttpStatus(HttpStatus::LLCORE, HE_OPT_NOT_DYNAMIC); + } + + return HttpService::instanceOf()->setPolicyOption(opt, pclass, value, ret_value); +} HttpHandle HttpRequest::setPolicyOption(EPolicyOption opt, policy_t pclass, long value, HttpHandler * handler) @@ -195,7 +204,7 @@ HttpHandle HttpRequest::requestGet(policy_t policy_id, HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOpRequest * op = new HttpOpRequest(); + HttpOpRequest * op = new HttpOpRequest(this); if (! (status = op->setupGet(policy_id, priority, url, options, headers))) { op->release(); @@ -229,7 +238,7 @@ HttpHandle HttpRequest::requestGetByteRange(policy_t policy_id, HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOpRequest * op = new HttpOpRequest(); + HttpOpRequest * op = new HttpOpRequest(this); if (! (status = op->setupGetByteRange(policy_id, priority, url, offset, len, options, headers))) { op->release(); @@ -262,7 +271,7 @@ HttpHandle HttpRequest::requestPost(policy_t policy_id, HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOpRequest * op = new HttpOpRequest(); + HttpOpRequest * op = new HttpOpRequest(this); if (! (status = op->setupPost(policy_id, priority, url, body, options, headers))) { op->release(); @@ -295,7 +304,7 @@ HttpHandle HttpRequest::requestPut(policy_t policy_id, HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOpRequest * op = new HttpOpRequest(); + HttpOpRequest * op = new HttpOpRequest(this); if (! (status = op->setupPut(policy_id, priority, url, body, options, headers))) { op->release(); -- cgit v1.2.3 From 735364038767694ea29d9b6a168410e6482cc9c2 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 27 Mar 2015 17:00:02 -0700 Subject: first set of chnages from code review from Nat --- indra/llcorehttp/httprequest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llcorehttp/httprequest.cpp') diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp index 5f1ed3d43b..df8502b947 100755 --- a/indra/llcorehttp/httprequest.cpp +++ b/indra/llcorehttp/httprequest.cpp @@ -117,7 +117,7 @@ HttpStatus HttpRequest::setStaticPolicyOption(EPolicyOption opt, policy_t pclass return HttpService::instanceOf()->setPolicyOption(opt, pclass, value, ret_value); } -HttpStatus HttpRequest::setStaticPolicyOption(EPolicyOption opt, policy_t pclass, policyCallback value, policyCallback * ret_value) +HttpStatus HttpRequest::setStaticPolicyOption(EPolicyOption opt, policy_t pclass, policyCallback_t value, policyCallback_t * ret_value) { if (HttpService::RUNNING == HttpService::instanceOf()->getState()) { @@ -204,7 +204,7 @@ HttpHandle HttpRequest::requestGet(policy_t policy_id, HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOpRequest * op = new HttpOpRequest(this); + HttpOpRequest * op = new HttpOpRequest(); if (! (status = op->setupGet(policy_id, priority, url, options, headers))) { op->release(); @@ -238,7 +238,7 @@ HttpHandle HttpRequest::requestGetByteRange(policy_t policy_id, HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOpRequest * op = new HttpOpRequest(this); + HttpOpRequest * op = new HttpOpRequest(); if (! (status = op->setupGetByteRange(policy_id, priority, url, offset, len, options, headers))) { op->release(); @@ -271,7 +271,7 @@ HttpHandle HttpRequest::requestPost(policy_t policy_id, HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOpRequest * op = new HttpOpRequest(this); + HttpOpRequest * op = new HttpOpRequest(); if (! (status = op->setupPost(policy_id, priority, url, body, options, headers))) { op->release(); @@ -304,7 +304,7 @@ HttpHandle HttpRequest::requestPut(policy_t policy_id, HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOpRequest * op = new HttpOpRequest(this); + HttpOpRequest * op = new HttpOpRequest(); if (! (status = op->setupPut(policy_id, priority, url, body, options, headers))) { op->release(); -- cgit v1.2.3 From d0c85b6dd964164b6d92103ad65b5cd859197de2 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 10 Apr 2015 17:23:58 -0700 Subject: Adding support for DELETE, PATCH and COPY --- indra/llcorehttp/httprequest.cpp | 94 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) (limited to 'indra/llcorehttp/httprequest.cpp') diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp index df8502b947..d4c60a6f14 100755 --- a/indra/llcorehttp/httprequest.cpp +++ b/indra/llcorehttp/httprequest.cpp @@ -325,6 +325,100 @@ HttpHandle HttpRequest::requestPut(policy_t policy_id, return handle; } +HttpHandle HttpRequest::requestDelete(policy_t policy_id, + priority_t priority, + const std::string & url, + HttpOptions * options, + HttpHeaders * headers, + HttpHandler * user_handler) +{ + HttpStatus status; + HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); + + HttpOpRequest * op = new HttpOpRequest(); + if (!(status = op->setupDelete(policy_id, priority, url, options, headers))) + { + op->release(); + mLastReqStatus = status; + return handle; + } + op->setReplyPath(mReplyQueue, user_handler); + if (!(status = mRequestQueue->addOp(op))) // transfers refcount + { + op->release(); + mLastReqStatus = status; + return handle; + } + + mLastReqStatus = status; + handle = static_cast(op); + + return handle; +} + +HttpHandle HttpRequest::requestPatch(policy_t policy_id, + priority_t priority, + const std::string & url, + BufferArray * body, + HttpOptions * options, + HttpHeaders * headers, + HttpHandler * user_handler) +{ + HttpStatus status; + HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); + + HttpOpRequest * op = new HttpOpRequest(); + if (!(status = op->setupPatch(policy_id, priority, url, body, options, headers))) + { + op->release(); + mLastReqStatus = status; + return handle; + } + op->setReplyPath(mReplyQueue, user_handler); + if (!(status = mRequestQueue->addOp(op))) // transfers refcount + { + op->release(); + mLastReqStatus = status; + return handle; + } + + mLastReqStatus = status; + handle = static_cast(op); + + return handle; +} + +HttpHandle HttpRequest::requestCopy(policy_t policy_id, + priority_t priority, + const std::string & url, + HttpOptions * options, + HttpHeaders * headers, + HttpHandler * user_handler) +{ + HttpStatus status; + HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); + + HttpOpRequest * op = new HttpOpRequest(); + if (!(status = op->setupCopy(policy_id, priority, url, options, headers))) + { + op->release(); + mLastReqStatus = status; + return handle; + } + op->setReplyPath(mReplyQueue, user_handler); + if (!(status = mRequestQueue->addOp(op))) // transfers refcount + { + op->release(); + mLastReqStatus = status; + return handle; + } + + mLastReqStatus = status; + handle = static_cast(op); + + return handle; +} + HttpHandle HttpRequest::requestNoOp(HttpHandler * user_handler) { -- cgit v1.2.3