Missed two instances of priority typed as 'float'. Became an
excuse to go through an use a typedef for priority and policy class id.master
parent
f67084337c
commit
7b9da4eeda
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -90,6 +90,10 @@ private:
|
|||
HttpRequest(const HttpRequest &); // Disallowed
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue