aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llurlrequest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmessage/llurlrequest.cpp')
-rw-r--r--linden/indra/llmessage/llurlrequest.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/linden/indra/llmessage/llurlrequest.cpp b/linden/indra/llmessage/llurlrequest.cpp
index 1c7648b..00c0577 100644
--- a/linden/indra/llmessage/llurlrequest.cpp
+++ b/linden/indra/llmessage/llurlrequest.cpp
@@ -39,6 +39,7 @@
39#include "llpumpio.h" 39#include "llpumpio.h"
40#include "llsd.h" 40#include "llsd.h"
41#include "llstring.h" 41#include "llstring.h"
42#include "apr-1/apr_env.h"
42 43
43static const U32 HTTP_STATUS_PIPE_ERROR = 499; 44static const U32 HTTP_STATUS_PIPE_ERROR = 499;
44 45
@@ -202,6 +203,47 @@ void LLURLRequest::setCallback(LLURLRequestComplete* callback)
202 curl_easy_setopt(mDetail->mCurl, CURLOPT_WRITEHEADER, callback); 203 curl_easy_setopt(mDetail->mCurl, CURLOPT_WRITEHEADER, callback);
203} 204}
204 205
206// Added to mitigate the effect of libcurl looking
207// for the ALL_PROXY and http_proxy env variables
208// and deciding to insert a Pragma: no-cache
209// header! The only usage of this method at the
210// time of this writing is in llhttpclient.cpp
211// in the request() method, where this method
212// is called with use_proxy = FALSE
213void LLURLRequest::useProxy(bool use_proxy)
214{
215 static char *env_proxy;
216
217 if (use_proxy && (env_proxy == NULL))
218 {
219 apr_status_t status;
220 apr_pool_t* pool;
221 apr_pool_create(&pool, NULL);
222 status = apr_env_get(&env_proxy, "ALL_PROXY", pool);
223 if (status != APR_SUCCESS)
224 {
225 status = apr_env_get(&env_proxy, "http_proxy", pool);
226 }
227 if (status != APR_SUCCESS)
228 {
229 use_proxy = FALSE;
230 }
231 apr_pool_destroy(pool);
232 }
233
234
235 lldebugs << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = " << env_proxy << llendl;
236
237 if (env_proxy && use_proxy)
238 {
239 curl_easy_setopt(mDetail->mCurl, CURLOPT_PROXY, env_proxy);
240 }
241 else
242 {
243 curl_easy_setopt(mDetail->mCurl, CURLOPT_PROXY, "");
244 }
245}
246
205// virtual 247// virtual
206LLIOPipe::EStatus LLURLRequest::handleError( 248LLIOPipe::EStatus LLURLRequest::handleError(
207 LLIOPipe::EStatus status, 249 LLIOPipe::EStatus status,