diff options
author | Don Kjer <don@lindenlab.com> | 2013-10-29 13:20:18 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2013-10-29 13:20:18 +0000 |
commit | 7866356d7719413b952787a509ebd3c4ce8d39b1 (patch) | |
tree | a200c96afd5ab8ad6da64c14ec6211aac9d5c65f /indra/llmessage/llurlrequest.cpp | |
parent | 81fecfa9f7e8664ec4f3bcf6662fe34d4e5d41a1 (diff) | |
parent | ea1e1b0925b386cf83178539b8eae9e25c573548 (diff) |
Merge viewer-release => sunshine-internal
Diffstat (limited to 'indra/llmessage/llurlrequest.cpp')
-rwxr-xr-x | indra/llmessage/llurlrequest.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index d6448e83fe..ae4c40cdb0 100755 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -131,16 +131,19 @@ CURLcode LLURLRequest::_sslCtxCallback(CURL * curl, void *sslctx, void *param) */ -LLURLRequest::LLURLRequest(EHTTPMethod action) : - mAction(action) +LLURLRequest::LLURLRequest(EHTTPMethod action, bool follow_redirects /* = true */) : + mAction(action), + mFollowRedirects(follow_redirects) { initialize(); } LLURLRequest::LLURLRequest( EHTTPMethod action, - const std::string& url) : - mAction(action) + const std::string& url, + bool follow_redirects /* = true */) : + mAction(action), + mFollowRedirects(follow_redirects) { initialize(); setURL(url); @@ -465,12 +468,18 @@ bool LLURLRequest::configure() case HTTP_HEAD: mDetail->mCurlRequest->setopt(CURLOPT_HEADER, 1); mDetail->mCurlRequest->setopt(CURLOPT_NOBODY, 1); - mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + if (mFollowRedirects) + { + mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + } rv = true; break; case HTTP_GET: mDetail->mCurlRequest->setopt(CURLOPT_HTTPGET, 1); - mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + if (mFollowRedirects) + { + mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + } // Set Accept-Encoding to allow response compression mDetail->mCurlRequest->setoptString(CURLOPT_ENCODING, ""); |