aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llhttpclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmessage/llhttpclient.cpp')
-rw-r--r--linden/indra/llmessage/llhttpclient.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp
index 8a62917..4c466c5 100644
--- a/linden/indra/llmessage/llhttpclient.cpp
+++ b/linden/indra/llmessage/llhttpclient.cpp
@@ -1,4 +1,4 @@
1 /** 1/**
2 * @file llhttpclient.cpp 2 * @file llhttpclient.cpp
3 * @brief Implementation of classes for making HTTP requests. 3 * @brief Implementation of classes for making HTTP requests.
4 * 4 *
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -399,6 +400,14 @@ LLSD LLHTTPClient::blockingGet(const std::string& url)
399 curl_easy_setopt(curlp, CURLOPT_ERRORBUFFER, curl_error_buffer); 400 curl_easy_setopt(curlp, CURLOPT_ERRORBUFFER, curl_error_buffer);
400 curl_easy_setopt(curlp, CURLOPT_FAILONERROR, 1); 401 curl_easy_setopt(curlp, CURLOPT_FAILONERROR, 1);
401 402
403 struct curl_slist *header_list = NULL;
404 header_list = curl_slist_append(header_list, "Accept: application/llsd+xml");
405 CURLcode curl_result = curl_easy_setopt(curlp, CURLOPT_HTTPHEADER, header_list);
406 if ( curl_result != CURLE_OK )
407 {
408 llinfos << "Curl is hosed - can't add Accept header for llsd+xml" << llendl;
409 }
410
402 LLSD response = LLSD::emptyMap(); 411 LLSD response = LLSD::emptyMap();
403 412
404 S32 curl_success = curl_easy_perform(curlp); 413 S32 curl_success = curl_easy_perform(curlp);
@@ -420,6 +429,12 @@ LLSD LLHTTPClient::blockingGet(const std::string& url)
420 response["body"] = http_buffer.asLLSD(); 429 response["body"] = http_buffer.asLLSD();
421 } 430 }
422 431
432 if(header_list)
433 { // free the header list
434 curl_slist_free_all(header_list);
435 header_list = NULL;
436 }
437
423 curl_easy_cleanup(curlp); 438 curl_easy_cleanup(curlp);
424 439
425 return response; 440 return response;