summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llcorehttp/_httpoperation.h13
-rw-r--r--indra/llcorehttp/_httpoprequest.cpp8
-rw-r--r--indra/llcorehttp/_httpoprequest.h12
-rw-r--r--indra/llcorehttp/_httpopsetpriority.cpp2
-rw-r--r--indra/llcorehttp/_httpopsetpriority.h10
-rw-r--r--indra/llcorehttp/_httppolicy.cpp2
-rw-r--r--indra/llcorehttp/_httppolicy.h2
-rw-r--r--indra/llcorehttp/_httpservice.cpp2
-rw-r--r--indra/llcorehttp/_httpservice.h3
-rw-r--r--indra/llcorehttp/httprequest.cpp18
-rw-r--r--indra/llcorehttp/httprequest.h20
11 files changed, 48 insertions, 44 deletions
diff --git a/indra/llcorehttp/_httpoperation.h b/indra/llcorehttp/_httpoperation.h
index 6c0c3183b7..4d9298d801 100644
--- a/indra/llcorehttp/_httpoperation.h
+++ b/indra/llcorehttp/_httpoperation.h
@@ -29,7 +29,7 @@
#include "httpcommon.h"
-
+#include "httprequest.h"
#include "_refcounted.h"
@@ -39,7 +39,6 @@ namespace LLCore
class HttpReplyQueue;
class HttpHandler;
class HttpService;
-class HttpRequest;
/// HttpOperation is the base class for all request/reply
/// pairs.
@@ -102,13 +101,13 @@ protected:
void addAsReply();
protected:
- HttpReplyQueue * mReplyQueue; // Have refcount
- HttpHandler * mLibraryHandler; // Have refcount
- HttpHandler * mUserHandler; // Have refcount
+ HttpReplyQueue * mReplyQueue; // Have refcount
+ HttpHandler * mLibraryHandler; // Have refcount
+ HttpHandler * mUserHandler; // Have refcount
public:
- unsigned int mReqPolicy;
- unsigned int mReqPriority;
+ HttpRequest::policy_t mReqPolicy;
+ HttpRequest::priority_t mReqPriority;
}; // end class HttpOperation
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index 54b9990057..791ee5f860 100644
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -233,8 +233,8 @@ HttpStatus HttpOpRequest::cancel()
}
-HttpStatus HttpOpRequest::setupGetByteRange(unsigned int policy_id,
- float priority,
+HttpStatus HttpOpRequest::setupGetByteRange(HttpRequest::policy_t policy_id,
+ HttpRequest::priority_t priority,
const std::string & url,
size_t offset,
size_t len,
@@ -268,8 +268,8 @@ HttpStatus HttpOpRequest::setupGetByteRange(unsigned int policy_id,
}
-HttpStatus HttpOpRequest::setupPost(unsigned int policy_id,
- float priority,
+HttpStatus HttpOpRequest::setupPost(HttpRequest::policy_t policy_id,
+ HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
HttpOptions * options,
diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h
index 7efed0b1d9..e973f6ad26 100644
--- a/indra/llcorehttp/_httpoprequest.h
+++ b/indra/llcorehttp/_httpoprequest.h
@@ -30,10 +30,10 @@
#include "linden_common.h" // Modifies curl/curl.h interfaces
-#include "httpcommon.h"
-
#include <curl/curl.h>
+#include "httpcommon.h"
+#include "httprequest.h"
#include "_httpoperation.h"
#include "_refcounted.h"
@@ -76,16 +76,16 @@ public:
public:
// Setup Methods
- HttpStatus setupGetByteRange(unsigned int policy_id,
- float priority,
+ HttpStatus setupGetByteRange(HttpRequest::policy_t policy_id,
+ HttpRequest::priority_t priority,
const std::string & url,
size_t offset,
size_t len,
HttpOptions * options,
HttpHeaders * headers);
- HttpStatus setupPost(unsigned int policy_id,
- float priority,
+ HttpStatus setupPost(HttpRequest::policy_t policy_id,
+ HttpRequest::priority_t priority,
const std::string & url,
BufferArray * body,
HttpOptions * options,
diff --git a/indra/llcorehttp/_httpopsetpriority.cpp b/indra/llcorehttp/_httpopsetpriority.cpp
index dc609421ed..b0ee577087 100644
--- a/indra/llcorehttp/_httpopsetpriority.cpp
+++ b/indra/llcorehttp/_httpopsetpriority.cpp
@@ -35,7 +35,7 @@ namespace LLCore
{
-HttpOpSetPriority::HttpOpSetPriority(HttpHandle handle, unsigned int priority)
+HttpOpSetPriority::HttpOpSetPriority(HttpHandle handle, HttpRequest::priority_t priority)
: HttpOperation(),
mHandle(handle),
mPriority(priority)
diff --git a/indra/llcorehttp/_httpopsetpriority.h b/indra/llcorehttp/_httpopsetpriority.h
index e5d8e5fc1f..b972f50fff 100644
--- a/indra/llcorehttp/_httpopsetpriority.h
+++ b/indra/llcorehttp/_httpopsetpriority.h
@@ -29,7 +29,7 @@
#include "httpcommon.h"
-
+#include "httprequest.h"
#include "_httpoperation.h"
#include "_refcounted.h"
@@ -46,7 +46,7 @@ namespace LLCore
class HttpOpSetPriority : public HttpOperation
{
public:
- HttpOpSetPriority(HttpHandle handle, unsigned int priority);
+ HttpOpSetPriority(HttpHandle handle, HttpRequest::priority_t priority);
virtual ~HttpOpSetPriority();
private:
@@ -59,9 +59,9 @@ public:
virtual void visitNotifier(HttpRequest * request);
protected:
- HttpStatus mStatus;
- HttpHandle mHandle;
- unsigned int mPriority;
+ HttpStatus mStatus;
+ HttpHandle mHandle;
+ HttpRequest::priority_t mPriority;
}; // end class HttpOpSetPriority
} // end namespace LLCore
diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp
index 873b519c51..1d28f23d56 100644
--- a/indra/llcorehttp/_httppolicy.cpp
+++ b/indra/llcorehttp/_httppolicy.cpp
@@ -112,7 +112,7 @@ HttpService::ELoopSpeed HttpPolicy::processReadyQueue()
}
-bool HttpPolicy::changePriority(HttpHandle handle, unsigned int priority)
+bool HttpPolicy::changePriority(HttpHandle handle, HttpRequest::priority_t priority)
{
for (int policy_class(0); policy_class < HttpRequest::POLICY_CLASS_LIMIT; ++policy_class)
{
diff --git a/indra/llcorehttp/_httppolicy.h b/indra/llcorehttp/_httppolicy.h
index c5e82d0a65..2bc03c531f 100644
--- a/indra/llcorehttp/_httppolicy.h
+++ b/indra/llcorehttp/_httppolicy.h
@@ -67,7 +67,7 @@ public:
void addOp(HttpOpRequest *);
// Shadows HttpService's method
- bool changePriority(HttpHandle handle, unsigned int priority);
+ bool changePriority(HttpHandle handle, HttpRequest::priority_t priority);
protected:
int mReadyInClass[HttpRequest::POLICY_CLASS_LIMIT];
diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp
index 48884ca060..337493ca12 100644
--- a/indra/llcorehttp/_httpservice.cpp
+++ b/indra/llcorehttp/_httpservice.cpp
@@ -152,7 +152,7 @@ void HttpService::stopRequested()
mExitRequested = true;
}
-bool HttpService::changePriority(HttpHandle handle, unsigned int priority)
+bool HttpService::changePriority(HttpHandle handle, HttpRequest::priority_t priority)
{
bool found(false);
diff --git a/indra/llcorehttp/_httpservice.h b/indra/llcorehttp/_httpservice.h
index 3e5a5457d7..095316c8a7 100644
--- a/indra/llcorehttp/_httpservice.h
+++ b/indra/llcorehttp/_httpservice.h
@@ -29,6 +29,7 @@
#include "httpcommon.h"
+#include "httprequest.h"
namespace LLCoreInt
@@ -145,7 +146,7 @@ public:
/// @return True if the request was found somewhere.
///
/// Threading: callable by worker thread.
- bool changePriority(HttpHandle handle, unsigned int priority);
+ bool changePriority(HttpHandle handle, HttpRequest::priority_t priority);
HttpPolicy * getPolicy()
{
diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp
index a06b859a91..0e512d97ed 100644
--- a/indra/llcorehttp/httprequest.cpp
+++ b/indra/llcorehttp/httprequest.cpp
@@ -83,7 +83,7 @@ protected:
// ====================================
-unsigned int HttpRequest::sNextPolicyID(1);
+HttpRequest::policy_t HttpRequest::sNextPolicyID(1);
HttpRequest::HttpRequest()
@@ -133,15 +133,15 @@ HttpStatus HttpRequest::setPolicyGlobalOption(EGlobalPolicy opt, long value)
}
-unsigned int HttpRequest::createPolicyClass()
+HttpRequest::policy_t HttpRequest::createPolicyClass()
{
- unsigned int policy_id = 1;
+ policy_t policy_id = 1;
return policy_id;
}
-HttpStatus HttpRequest::setPolicyClassOption(unsigned int policy_id,
+HttpStatus HttpRequest::setPolicyClassOption(policy_t policy_id,
EClassPolicy opt,
long value)
{
@@ -162,8 +162,8 @@ HttpStatus HttpRequest::getStatus() const
}
-HttpHandle HttpRequest::requestGetByteRange(unsigned int policy_id,
- unsigned int priority,
+HttpHandle HttpRequest::requestGetByteRange(policy_t policy_id,
+ priority_t priority,
const std::string & url,
size_t offset,
size_t len,
@@ -191,8 +191,8 @@ HttpHandle HttpRequest::requestGetByteRange(unsigned int policy_id,
}
-HttpHandle HttpRequest::requestPost(unsigned int policy_id,
- unsigned int priority,
+HttpHandle HttpRequest::requestPost(policy_t policy_id,
+ priority_t priority,
const std::string & url,
BufferArray * body,
HttpOptions * options,
@@ -251,7 +251,7 @@ HttpHandle HttpRequest::requestNoOp(HttpHandler * user_handler)
}
-HttpHandle HttpRequest::requestSetPriority(HttpHandle request, unsigned int priority,
+HttpHandle HttpRequest::requestSetPriority(HttpHandle request, priority_t priority,
HttpHandler * handler)
{
HttpStatus status;
diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h
index e2ab9be533..57d2da245b 100644
--- a/indra/llcorehttp/httprequest.h
+++ b/indra/llcorehttp/httprequest.h
@@ -91,6 +91,10 @@ private:
void operator=(const HttpRequest &); // Disallowed
public:
+ typedef unsigned int policy_t;
+ typedef unsigned int priority_t;
+
+public:
/// @name PolicyMethods
/// @{
@@ -125,7 +129,7 @@ public:
/// the class in other methods. If -1, an error
/// occurred and @see getStatus() may provide more
/// detail on the reason.
- unsigned int createPolicyClass();
+ policy_t createPolicyClass();
enum EClassPolicy
{
@@ -149,7 +153,7 @@ public:
/// @param opt Enum of option to be set.
/// @param value Desired value of option.
/// @return Standard status code.
- HttpStatus setPolicyClassOption(unsigned int policy_id,
+ HttpStatus setPolicyClassOption(policy_t policy_id,
EClassPolicy opt,
long value);
@@ -194,8 +198,8 @@ public:
/// request could not be queued. In the latter
/// case, @see getStatus() will return more info.
///
- HttpHandle requestGetByteRange(unsigned int policy_id,
- unsigned int priority,
+ HttpHandle requestGetByteRange(policy_t policy_id,
+ priority_t priority,
const std::string & url,
size_t offset,
size_t len,
@@ -221,8 +225,8 @@ public:
/// request could not be queued. In the latter
/// case, @see getStatus() will return more info.
///
- HttpHandle requestPost(unsigned int policy_id,
- unsigned int priority,
+ HttpHandle requestPost(policy_t policy_id,
+ priority_t priority,
const std::string & url,
BufferArray * body,
HttpOptions * options,
@@ -278,7 +282,7 @@ public:
/// queued or LLCORE_HTTP_HANDLE_INVALID if the
/// request could not be queued.
///
- HttpHandle requestSetPriority(HttpHandle request, unsigned int priority, HttpHandler * handler);
+ HttpHandle requestSetPriority(HttpHandle request, priority_t priority, HttpHandler * handler);
/// @}
@@ -345,7 +349,7 @@ private:
/// Must be established before any threading is allowed to
/// start.
///
- static unsigned int sNextPolicyID;
+ static policy_t sNextPolicyID;
/// @}
// End Global State