From adce38800a3ac428c3e0b89fe5d62ca3baf97471 Mon Sep 17 00:00:00 2001
From: Monty Brandenberg <monty@lindenlab.com>
Date: Wed, 4 Jul 2012 23:30:58 -0400
Subject: Example program needs to set Accept: header to talk to Caps router.

---
 indra/llcorehttp/examples/http_texture_load.cpp | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

(limited to 'indra')

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)
 		{
-- 
cgit v1.2.3