summaryrefslogtreecommitdiff
path: root/indra/llmessage/llcurl.cpp
diff options
context:
space:
mode:
authorChristian Goetze (CG) <cg@lindenlab.com>2010-08-02 15:57:01 -0700
committerChristian Goetze (CG) <cg@lindenlab.com>2010-08-02 15:57:01 -0700
commit4f6e814eaa7ae5cfc10e4e7d1f22e53be395a2f4 (patch)
treebe554f9f22996e00dada6da67f7e77eb0502b0f5 /indra/llmessage/llcurl.cpp
parentf423a69864c40f760c1c7e64a2e544fd1dba77fb (diff)
parent15247f086989a43881d79c1ee5416bb00721eb68 (diff)
Fix the reversion imported from viewer-hotfix via: "hg pull -r 1c95812ba38b ../viewer-public" - reviewed by richard
Diffstat (limited to 'indra/llmessage/llcurl.cpp')
-rw-r--r--indra/llmessage/llcurl.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index ac50411de8..36874a5d48 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -364,6 +364,13 @@ U32 LLCurl::Easy::report(CURLcode code)
responseCode = 499;
responseReason = strerror(code) + " : " + mErrorBuffer;
}
+
+ if(responseCode >= 300 && responseCode < 400) //redirect
+ {
+ char new_url[512] ;
+ curl_easy_getinfo(mCurlEasyHandle, CURLINFO_REDIRECT_URL, new_url);
+ responseReason = new_url ; //get the new URL.
+ }
if (mResponder)
{
@@ -462,13 +469,6 @@ void LLCurl::Easy::prepRequest(const std::string& url,
setopt(CURLOPT_HEADERFUNCTION, (void*)&curlHeaderCallback);
setopt(CURLOPT_HEADERDATA, (void*)this);
- // Allow up to five redirects
- if(responder && responder->followRedir())
- {
- setopt(CURLOPT_FOLLOWLOCATION, 1);
- setopt(CURLOPT_MAXREDIRS, MAX_REDIRECTS);
- }
-
setErrorBuffer();
setCA();
@@ -1061,4 +1061,3 @@ void LLCurl::cleanupClass()
curl_global_cleanup();
}
-const unsigned int LLCurl::MAX_REDIRECTS = 5;