diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index e5dcb6ae8..7e6fc9236 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -1392,6 +1392,10 @@ void BufferedCurlEasyRequest::prepRequest(AICurlEasyRequest_wat& curl_easy_reque // to id.secondlife.com for marketplace.secondlife.com. allow_cookies = true; } + if (responder->forbidReuse()) + { + curl_easy_request_w->setopt(CURLOPT_FORBID_REUSE, 1); + } if (allow_cookies) { // Given an empty or non-existing file or by passing the empty string (""), diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index af11a6687..b4ce6facc 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -217,6 +217,10 @@ public: // Derived classes that implement completed_headers()/completedHeaders() should return true here. virtual bool needsHeaders(void) const { return false; } + // A derived class should return true if curl should close the connection when done. + // The default is to keep connections open for possible reuse. + virtual bool forbidReuse(void) const { return false; } + // A derived class should return true if curl should follow redirections. // The default is not to follow redirections. virtual bool followRedir(void) const { return false; } diff --git a/indra/newview/llxmlrpcresponder.h b/indra/newview/llxmlrpcresponder.h index 3c32cd2a6..4a5f29077 100644 --- a/indra/newview/llxmlrpcresponder.h +++ b/indra/newview/llxmlrpcresponder.h @@ -107,6 +107,7 @@ public: LLXMLRPCValue responseValue(void) const; /*virtual*/ bool needsHeaders(void) const { return true; } + /*virtual*/ bool forbidReuse(void) const { return true; } /*virtual*/ void received_HTTP_header(void) { mReceivedHTTPHeader = true; LLHTTPClient::ResponderBase::received_HTTP_header(); } /*virtual*/ void completed_headers(U32 status, std::string const& reason, AITransferInfo* info); /*virtual*/ void completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer);