From 74055542902b590cd4d7868aa1c14bf4da7c6399 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Wed, 13 Mar 2013 08:49:26 +0000 Subject: Fixed potential memory leak in LLHTTPClient. Fixed potential hanging http requests in LLHTTPClient. Fixed munging of "Pragma" headers in LLHTTPClientAdapter --- indra/llmessage/llhttpclient.cpp | 15 ++++++++++++--- indra/llmessage/llhttpclientadapter.cpp | 7 +++++-- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 0c325a68aa..46b0311cce 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -222,7 +222,11 @@ static void request( { if (!LLHTTPClient::hasPump()) { - responder->completed(U32_MAX, "No pump", LLSD()); + if (responder) + { + responder->completed(U32_MAX, "No pump", LLSD()); + } + delete body_injector; return; } LLPumpIO::chain_t chain; @@ -230,8 +234,13 @@ static void request( LLURLRequest* req = new LLURLRequest(method, url); if(!req->isValid())//failed { - delete req ; - return ; + if (responder) + { + responder->completed(498, "Internal Error - curl failure"); + } + delete req; + delete body_injector; + return; } req->setSSLVerifyCallback(LLHTTPClient::getCertVerifyCallback(), (void *)req); diff --git a/indra/llmessage/llhttpclientadapter.cpp b/indra/llmessage/llhttpclientadapter.cpp index f5d7a9abb6..0b59209af1 100644 --- a/indra/llmessage/llhttpclientadapter.cpp +++ b/indra/llmessage/llhttpclientadapter.cpp @@ -43,8 +43,11 @@ void LLHTTPClientAdapter::get(const std::string& url, LLCurl::ResponderPtr respo void LLHTTPClientAdapter::get(const std::string& url, LLCurl::ResponderPtr responder, const LLSD& headers) { LLSD empty_pragma_header = headers; - // as above - empty_pragma_header["Pragma"] = " "; + if (!empty_pragma_header.has("Pragma")) + { + // as above + empty_pragma_header["Pragma"] = " "; + } LLHTTPClient::get(url, responder, empty_pragma_header); } -- cgit v1.2.3 From 45838b8b07a61af9b85ab9bc3013f1ac867e70d8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Mar 2013 11:19:21 -0400 Subject: fix for build failure --- indra/llmessage/llhttpclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 indra/llmessage/llhttpclient.cpp (limited to 'indra/llmessage') diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp old mode 100644 new mode 100755 index 46b0311cce..3561459bb4 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -236,7 +236,7 @@ static void request( { if (responder) { - responder->completed(498, "Internal Error - curl failure"); + responder->completed(498, "Internal Error - curl failure", LLSD()); } delete req; delete body_injector; -- cgit v1.2.3