Merge branch 'curlthreading2' into curlthreading3

Conflicts:
	indra/CMakeLists.txt
	indra/llcommon/llstring.h
	indra/llmessage/CMakeLists.txt
	indra/llmessage/llhttpclient.cpp
	indra/llmessage/llhttpclient.h
	indra/llmessage/llurlrequest.cpp
	indra/llmessage/llurlrequest.h
	indra/newview/hipporestrequest.cpp
	indra/newview/llappviewer.cpp
This commit is contained in:
Aleric Inglewood
2012-08-14 15:53:54 +02:00
884 changed files with 55580 additions and 24106 deletions

View File

@@ -168,8 +168,6 @@ public:
LLCurl::TransferInfo mTransferInfo;
std::string mURI;
char* mRequestText;
int mRequestTextSize;
std::string mProxyAddress;
@@ -200,7 +198,6 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri,
: mCurlEasyRequestStateMachinePtr(NULL),
mStatus(LLXMLRPCTransaction::StatusNotStarted),
mURI(uri),
mRequestText(0),
mResponse(0)
{
init(request, useGzip);
@@ -212,7 +209,6 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri,
: mCurlEasyRequestStateMachinePtr(NULL),
mStatus(LLXMLRPCTransaction::StatusNotStarted),
mURI(uri),
mRequestText(0),
mResponse(0)
{
XMLRPC_REQUEST request = XMLRPC_RequestNew();
@@ -223,8 +219,13 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri,
init(request, useGzip);
}
// Store pointer to data allocated with XMLRPC_REQUEST_ToXML and call XMLRPC_Free to free it upon destruction.
class AIXMLRPCData : public AIPostField
{
public:
AIXMLRPCData(char const* allocated_data) : AIPostField(allocated_data) { }
/*virtual*/ ~AIXMLRPCData() { XMLRPC_Free(const_cast<char*>(mData)); mData = NULL; }
};
void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
{
@@ -250,7 +251,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
/* Setting the DNS cache timeout to -1 disables it completely.
This might help with bug #503 */
curlEasyRequest_w->setopt(CURLOPT_DNS_CACHE_TIMEOUT, -1);
curlEasyRequest_w->setopt(CURLOPT_DNS_CACHE_TIMEOUT, -1L);
curlEasyRequest_w->addHeader("Content-Type: text/xml");
@@ -259,12 +260,11 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
curlEasyRequest_w->setoptString(CURLOPT_ENCODING, "");
}
mRequestText = XMLRPC_REQUEST_ToXML(request, &mRequestTextSize);
if (mRequestText)
int requestTextSize;
char* requestText = XMLRPC_REQUEST_ToXML(request, &requestTextSize);
if (requestText)
{
Dout(dc::curl, "Writing " << mRequestTextSize << " bytes: \"" << libcwd::buf2str(mRequestText, mRequestTextSize) << "\".");;
curlEasyRequest_w->setopt(CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)mRequestTextSize);
curlEasyRequest_w->setoptString(CURLOPT_COPYPOSTFIELDS, mRequestText);
curlEasyRequest_w->setPost(new AIXMLRPCData(requestText), requestTextSize);
}
else
{
@@ -298,11 +298,6 @@ LLXMLRPCTransaction::Impl::~Impl()
{
XMLRPC_RequestFree(mResponse, 1);
}
if (mRequestText)
{
XMLRPC_Free(mRequestText);
}
}
bool LLXMLRPCTransaction::Impl::is_finished(void) const