diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-07-23 16:34:17 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-07-23 16:34:17 -0400 |
commit | 0c5a5934d87cb7e64cb8db96551009b9b9ed8be9 (patch) | |
tree | a8973a0ab6ec43469a71ea80e1d6328a9ad779de /indra/llmessage/llcurl.cpp | |
parent | d9f01a7c5a70d184bb5fac1f620cfbe1ad4c957d (diff) | |
parent | 056685d9d4ac82aad45e46ae5d5226690d416513 (diff) |
merge
Diffstat (limited to 'indra/llmessage/llcurl.cpp')
-rw-r--r-- | indra/llmessage/llcurl.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 36874a5d48..ac50411de8 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -364,13 +364,6 @@ 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) { @@ -469,6 +462,13 @@ 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,3 +1061,4 @@ void LLCurl::cleanupClass() curl_global_cleanup(); } +const unsigned int LLCurl::MAX_REDIRECTS = 5; |