summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/httprequest.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcorehttp/httprequest.h')
-rwxr-xr-xindra/llcorehttp/httprequest.h120
1 files changed, 107 insertions, 13 deletions
diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h
index 7f23723b0b..6c2449266f 100755
--- a/indra/llcorehttp/httprequest.h
+++ b/indra/llcorehttp/httprequest.h
@@ -31,6 +31,8 @@
#include "httpcommon.h"
#include "httphandler.h"
+#include "httpheaders.h"
+#include "httpoptions.h"
namespace LLCore
{
@@ -38,8 +40,6 @@ namespace LLCore
class HttpRequestQueue;
class HttpReplyQueue;
class HttpService;
-class HttpOptions;
-class HttpHeaders;
class HttpOperation;
class BufferArray;
@@ -97,6 +97,8 @@ public:
typedef unsigned int policy_t;
typedef unsigned int priority_t;
+ typedef boost::shared_ptr<HttpRequest> ptr_t;
+ typedef boost::weak_ptr<HttpRequest> wptr_t;
public:
/// @name PolicyMethods
/// @{
@@ -163,7 +165,7 @@ public:
/// Long value that if non-zero enables the use of the
/// traditional LLProxy code for http/socks5 support. If
- // enabled, has priority over GP_HTTP_PROXY.
+ /// enabled, has priority over GP_HTTP_PROXY.
///
/// Global only
PO_LLPROXY,
@@ -219,15 +221,25 @@ public:
/// Controls whether client-side throttling should be
/// performed on this policy class. Positive values
/// enable throttling and specify the request rate
- /// (requests per second) that should be targetted.
+ /// (requests per second) that should be targeted.
/// A value of zero, the default, specifies no throttling.
///
/// Per-class only
PO_THROTTLE_RATE,
+ /// Controls the callback function used to control SSL CTX
+ /// certificate verification.
+ ///
+ /// Global only
+ PO_SSL_VERIFY_CALLBACK,
+
PO_LAST // Always at end
};
+ /// Prototype for policy based callbacks. The callback methods will be executed
+ /// on the worker thread so no modifications should be made to the HttpHandler object.
+ typedef boost::function<HttpStatus(const std::string &, HttpHandler const * const, void *)> policyCallback_t;
+
/// Set a policy option for a global or class parameter at
/// startup time (prior to thread start).
///
@@ -243,6 +255,8 @@ public:
long value, long * ret_value);
static HttpStatus setStaticPolicyOption(EPolicyOption opt, policy_t pclass,
const std::string & value, std::string * ret_value);
+ static HttpStatus setStaticPolicyOption(EPolicyOption opt, policy_t pclass,
+ policyCallback_t value, policyCallback_t * ret_value);;
/// Set a parameter on a class-based policy option. Calls
/// made after the start of the servicing thread are
@@ -334,8 +348,8 @@ public:
HttpHandle requestGet(policy_t policy_id,
priority_t priority,
const std::string & url,
- HttpOptions * options,
- HttpHeaders * headers,
+ const HttpOptions::ptr_t & options,
+ const HttpHeaders::ptr_t & headers,
HttpHandler * handler);
@@ -377,8 +391,8 @@ public:
const std::string & url,
size_t offset,
size_t len,
- HttpOptions * options,
- HttpHeaders * headers,
+ const HttpOptions::ptr_t & options,
+ const HttpHeaders::ptr_t & headers,
HttpHandler * handler);
@@ -418,8 +432,8 @@ public:
priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders * headers,
+ const HttpOptions::ptr_t & options,
+ const HttpHeaders::ptr_t & headers,
HttpHandler * handler);
@@ -459,12 +473,92 @@ public:
priority_t priority,
const std::string & url,
BufferArray * body,
- HttpOptions * options,
- HttpHeaders * headers,
+ const HttpOptions::ptr_t & options,
+ const HttpHeaders::ptr_t & headers,
HttpHandler * handler);
- /// Queue a NoOp request.
+ /// Queue a full HTTP DELETE. Query arguments and body may
+ /// be provided. Caller is responsible for escaping and
+ /// encoding and communicating the content types.
+ ///
+ /// @param policy_id @see requestGet()
+ /// @param priority "
+ /// @param url "
+ /// @param options @see requestGet()K(optional)
+ /// @param headers "
+ /// @param handler "
+ /// @return "
+ ///
+ HttpHandle requestDelete(policy_t policy_id,
+ priority_t priority,
+ const std::string & url,
+ const HttpOptions::ptr_t & options,
+ const HttpHeaders::ptr_t & headers,
+ HttpHandler * user_handler);
+
+ /// Queue a full HTTP PATCH. Query arguments and body may
+ /// be provided. Caller is responsible for escaping and
+ /// encoding and communicating the content types.
+ ///
+ /// @param policy_id @see requestGet()
+ /// @param priority "
+ /// @param url "
+ /// @param body Byte stream to be sent as the body. No
+ /// further encoding or escaping will be done
+ /// to the content.
+ /// @param options @see requestGet()K(optional)
+ /// @param headers "
+ /// @param handler "
+ /// @return "
+ ///
+ HttpHandle requestPatch(policy_t policy_id,
+ priority_t priority,
+ const std::string & url,
+ BufferArray * body,
+ const HttpOptions::ptr_t & options,
+ const HttpHeaders::ptr_t & headers,
+ HttpHandler * user_handler);
+
+ /// Queue a full HTTP COPY. Query arguments and body may
+ /// be provided. Caller is responsible for escaping and
+ /// encoding and communicating the content types.
+ ///
+ /// @param policy_id @see requestGet()
+ /// @param priority "
+ /// @param url "
+ /// @param options @see requestGet()K(optional)
+ /// @param headers "
+ /// @param handler "
+ /// @return "
+ ///
+ HttpHandle requestCopy(policy_t policy_id,
+ priority_t priority,
+ const std::string & url,
+ const HttpOptions::ptr_t & options,
+ const HttpHeaders::ptr_t & headers,
+ HttpHandler * user_handler);
+
+ /// Queue a full HTTP MOVE. Query arguments and body may
+ /// be provided. Caller is responsible for escaping and
+ /// encoding and communicating the content types.
+ ///
+ /// @param policy_id @see requestGet()
+ /// @param priority "
+ /// @param url "
+ /// @param options @see requestGet()K(optional)
+ /// @param headers "
+ /// @param handler "
+ /// @return "
+ ///
+ HttpHandle requestMove(policy_t policy_id,
+ priority_t priority,
+ const std::string & url,
+ const HttpOptions::ptr_t & options,
+ const HttpHeaders::ptr_t & headers,
+ HttpHandler * user_handler);
+
+ /// Queue a NoOp request.
/// The request is queued and serviced by the working thread which
/// immediately processes it and returns the request to the reply
/// queue.