diff options
author | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
commit | 117e22047c5752352342d64e3fb7ce00a4eb8113 (patch) | |
tree | e32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/llmessage/llhttpclient.cpp | |
parent | Second Life viewer sources 1.18.0.6 (diff) | |
download | meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2 meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz |
Second Life viewer sources 1.18.1.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmessage/llhttpclient.cpp | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp index 392dfd0..e36503a 100644 --- a/linden/indra/llmessage/llhttpclient.cpp +++ b/linden/indra/llmessage/llhttpclient.cpp | |||
@@ -252,6 +252,7 @@ static void request( | |||
252 | LLURLRequest::ERequestAction method, | 252 | LLURLRequest::ERequestAction method, |
253 | Injector* body_injector, | 253 | Injector* body_injector, |
254 | LLHTTPClient::ResponderPtr responder, | 254 | LLHTTPClient::ResponderPtr responder, |
255 | const LLSD& headers, | ||
255 | const F32 timeout=HTTP_REQUEST_EXPIRY_SECS) | 256 | const F32 timeout=HTTP_REQUEST_EXPIRY_SECS) |
256 | { | 257 | { |
257 | if (!LLHTTPClient::hasPump()) | 258 | if (!LLHTTPClient::hasPump()) |
@@ -263,6 +264,19 @@ static void request( | |||
263 | 264 | ||
264 | LLURLRequest *req = new LLURLRequest(method, url); | 265 | LLURLRequest *req = new LLURLRequest(method, url); |
265 | req->requestEncoding(""); | 266 | req->requestEncoding(""); |
267 | |||
268 | if (headers.isMap()) | ||
269 | { | ||
270 | LLSD::map_const_iterator iter = headers.beginMap(); | ||
271 | LLSD::map_const_iterator end = headers.endMap(); | ||
272 | |||
273 | for (; iter != end; ++iter) | ||
274 | { | ||
275 | std::ostringstream header; | ||
276 | header << iter->first << ": " << iter->second.asString() ; | ||
277 | req->addHeader(header.str().c_str()); | ||
278 | } | ||
279 | } | ||
266 | if (!gCABundle.empty()) | 280 | if (!gCABundle.empty()) |
267 | { | 281 | { |
268 | req->checkRootCertificate(true, gCABundle.c_str()); | 282 | req->checkRootCertificate(true, gCABundle.c_str()); |
@@ -287,17 +301,37 @@ static void request( | |||
287 | theClientPump->addChain(chain, timeout); | 301 | theClientPump->addChain(chain, timeout); |
288 | } | 302 | } |
289 | 303 | ||
304 | static void request( | ||
305 | const std::string& url, | ||
306 | LLURLRequest::ERequestAction method, | ||
307 | Injector* body_injector, | ||
308 | LLHTTPClient::ResponderPtr responder, | ||
309 | const F32 timeout=HTTP_REQUEST_EXPIRY_SECS) | ||
310 | { | ||
311 | request(url, method, body_injector, responder, LLSD(), timeout); | ||
312 | } | ||
313 | |||
314 | void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout) | ||
315 | { | ||
316 | request(url, LLURLRequest::HTTP_GET, NULL, responder, headers, timeout); | ||
317 | } | ||
318 | |||
290 | void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const F32 timeout) | 319 | void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const F32 timeout) |
291 | { | 320 | { |
292 | request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout); | 321 | get(url, responder, LLSD(), timeout); |
293 | } | 322 | } |
294 | 323 | ||
295 | void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const F32 timeout) | 324 | void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const LLSD& headers, const F32 timeout) |
296 | { | 325 | { |
297 | LLURI uri; | 326 | LLURI uri; |
298 | 327 | ||
299 | uri = LLURI::buildHTTP(url, LLSD::emptyArray(), query); | 328 | uri = LLURI::buildHTTP(url, LLSD::emptyArray(), query); |
300 | get(uri.asString(), responder, timeout); | 329 | get(uri.asString(), responder, headers, timeout); |
330 | } | ||
331 | |||
332 | void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const F32 timeout) | ||
333 | { | ||
334 | get(url, query, responder, LLSD(), timeout); | ||
301 | } | 335 | } |
302 | 336 | ||
303 | // A simple class for managing data returned from a curl http request. | 337 | // A simple class for managing data returned from a curl http request. |