summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2012-07-04 23:30:58 -0400
committerMonty Brandenberg <monty@lindenlab.com>2012-07-04 23:30:58 -0400
commitadce38800a3ac428c3e0b89fe5d62ca3baf97471 (patch)
treea6cf141ee664b33cc3a9b3d372df72aa6b290e52
parente38a676c087d0adce9bd35cf3bdf8ff0e898f201 (diff)
Example program needs to set Accept: header to talk to Caps router.
-rw-r--r--indra/llcorehttp/examples/http_texture_load.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp
index 7efdf53959..e5951e8415 100644
--- a/indra/llcorehttp/examples/http_texture_load.cpp
+++ b/indra/llcorehttp/examples/http_texture_load.cpp
@@ -39,6 +39,7 @@
#include "httprequest.h"
#include "httphandler.h"
#include "httpresponse.h"
+#include "httpheaders.h"
#include "bufferarray.h"
#include "_mutex.h"
@@ -76,6 +77,7 @@ class WorkingSet : public LLCore::HttpHandler
{
public:
WorkingSet();
+ ~WorkingSet();
bool reload(LLCore::HttpRequest *);
@@ -111,6 +113,7 @@ public:
int mErrorsHttp503;
int mSuccesses;
long mByteCount;
+ LLCore::HttpHeaders * mHeaders;
};
@@ -316,6 +319,19 @@ WorkingSet::WorkingSet()
mByteCount(0L)
{
mTextures.reserve(30000);
+
+ mHeaders = new LLCore::HttpHeaders;
+ mHeaders->mHeaders.push_back("Accept: image/x-j2c");
+}
+
+
+WorkingSet::~WorkingSet()
+{
+ if (mHeaders)
+ {
+ mHeaders->release();
+ mHeaders = NULL;
+ }
}
@@ -337,11 +353,11 @@ bool WorkingSet::reload(LLCore::HttpRequest * hr)
LLCore::HttpHandle handle;
if (offset || length)
{
- handle = hr->requestGetByteRange(0, 0, buffer, offset, length, NULL, NULL, this);
+ handle = hr->requestGetByteRange(0, 0, buffer, offset, length, NULL, mHeaders, this);
}
else
{
- handle = hr->requestGet(0, 0, buffer, NULL, NULL, this);
+ handle = hr->requestGet(0, 0, buffer, NULL, mHeaders, this);
}
if (! handle)
{