summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/httprequest.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2012-06-22 19:13:50 -0400
committerMonty Brandenberg <monty@lindenlab.com>2012-06-22 19:13:50 -0400
commitbc7d5b24d16963a2715e880c518a4706a99f02fa (patch)
treedb91cb215ecf88fa57bbe599cba9df699fd46334 /indra/llcorehttp/httprequest.cpp
parent5ff1758b633f1984f601aacbb7920c3c744b87f7 (diff)
This sets down the groundwork for dynamic policy classes.
Groundwork is used for the default class which currently represents texture fetching. Class options implemented from API user into HttpLibcurl. Policy layer is going to start doing some traffic shaping like work to solve problems with consumer-grade gear. Need to have dynamic aspects to policies and that starts now...
Diffstat (limited to 'indra/llcorehttp/httprequest.cpp')
-rw-r--r--indra/llcorehttp/httprequest.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp
index 6d13a213f5..a525d8f9ea 100644
--- a/indra/llcorehttp/httprequest.cpp
+++ b/indra/llcorehttp/httprequest.cpp
@@ -92,26 +92,31 @@ HttpRequest::~HttpRequest()
HttpStatus HttpRequest::setPolicyGlobalOption(EGlobalPolicy opt, long value)
{
- // *FIXME: Fail if thread is running.
-
+ if (HttpService::RUNNING == HttpService::instanceOf()->getState())
+ {
+ return HttpStatus(HttpStatus::LLCORE, HE_OPT_NOT_DYNAMIC);
+ }
return HttpService::instanceOf()->getGlobalOptions().set(opt, value);
}
HttpStatus HttpRequest::setPolicyGlobalOption(EGlobalPolicy opt, const std::string & value)
{
- // *FIXME: Fail if thread is running.
-
+ if (HttpService::RUNNING == HttpService::instanceOf()->getState())
+ {
+ return HttpStatus(HttpStatus::LLCORE, HE_OPT_NOT_DYNAMIC);
+ }
return HttpService::instanceOf()->getGlobalOptions().set(opt, value);
}
HttpRequest::policy_t HttpRequest::createPolicyClass()
{
- // *FIXME: Implement classes
- policy_t policy_id = 1;
-
- return policy_id;
+ if (HttpService::RUNNING == HttpService::instanceOf()->getState())
+ {
+ return 0;
+ }
+ return HttpService::instanceOf()->createPolicyClass();
}
@@ -119,9 +124,11 @@ HttpStatus HttpRequest::setPolicyClassOption(policy_t policy_id,
EClassPolicy opt,
long value)
{
- HttpStatus status;
-
- return status;
+ if (HttpService::RUNNING == HttpService::instanceOf()->getState())
+ {
+ return HttpStatus(HttpStatus::LLCORE, HE_OPT_NOT_DYNAMIC);
+ }
+ return HttpService::instanceOf()->getClassOptions(policy_id).set(opt, value);
}