Set CURLOPT_FORBID_REUSE for XMLRPCResponder
XMLRPCResponder is used to login, which is a HTTP 1.0 server that doesn't support reuse of connections. It's cleaner to close connections from our side too. This changes, 0x7fffdcf93700 CURLIO 0x7fffcd86db40 * Connection #0 to host login.agni.lindenlab.com left intact into 0x7fffdcf93700 CURLIO 0x7fffcd8b0bd0 * Closing connection #0
This commit is contained in:
@@ -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 (""),
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user