diff options
Diffstat (limited to 'indra/llcorehttp')
-rw-r--r-- | indra/llcorehttp/examples/http_texture_load.cpp | 20 |
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) { |