Merge remote-tracking branch 'github/master' into curlthreading3
Conflicts: indra/aistatemachine/aistatemachine.cpp
This commit is contained in:
@@ -39,6 +39,9 @@
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include <winsock2.h> //remove classic winsock from windows.h
|
||||
#endif
|
||||
#define OPENSSL_THREAD_DEFINES
|
||||
#include <openssl/opensslconf.h> // OPENSSL_THREADS
|
||||
#include <openssl/crypto.h>
|
||||
@@ -245,7 +248,7 @@ void ssl_init(void)
|
||||
CRYPTO_set_dynlock_destroy_callback(&ssl_dyn_destroy_function);
|
||||
need_renegotiation_hack = (0x10001000UL <= ssleay);
|
||||
llinfos << "Successful initialization of " <<
|
||||
SSLeay_version(SSLEAY_VERSION) << " (0x" << std::hex << SSLeay() << ")." << llendl;
|
||||
SSLeay_version(SSLEAY_VERSION) << " (0x" << std::hex << SSLeay() << std::dec << ")." << llendl;
|
||||
}
|
||||
|
||||
// Cleanup OpenSSL library thread-safety.
|
||||
@@ -314,7 +317,7 @@ void initCurl(void (*flush_hook)())
|
||||
}
|
||||
|
||||
llinfos << "Successful initialization of libcurl " <<
|
||||
version_info->version << " (0x" << std::hex << version_info->version_num << "), (" <<
|
||||
version_info->version << " (0x" << std::hex << version_info->version_num << std::dec << "), (" <<
|
||||
version_info->ssl_version;
|
||||
if (version_info->libz_version)
|
||||
{
|
||||
@@ -652,6 +655,10 @@ void CurlEasyHandle::setErrorBuffer(void)
|
||||
mErrorBuffer = NULL;
|
||||
}
|
||||
}
|
||||
if (mErrorBuffer)
|
||||
{
|
||||
mErrorBuffer[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
CURLcode CurlEasyHandle::getinfo_priv(CURLINFO info, void* data)
|
||||
@@ -1525,15 +1532,7 @@ void CurlResponderBuffer::processOutput(AICurlEasyRequest_wat& curl_easy_request
|
||||
else
|
||||
{
|
||||
responseCode = 499;
|
||||
responseReason = AICurlInterface::strerror(code) + " : ";
|
||||
if (code == CURLE_FAILED_INIT)
|
||||
{
|
||||
responseReason += "Curl Easy Handle initialization failed.";
|
||||
}
|
||||
else
|
||||
{
|
||||
responseReason += curl_easy_request_w->getErrorString();
|
||||
}
|
||||
responseReason = AICurlInterface::strerror(code);
|
||||
curl_easy_request_w->setopt(CURLOPT_FRESH_CONNECT, TRUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -162,10 +162,6 @@ class CurlEasyHandle : public boost::noncopyable, protected AICurlEasyHandleEven
|
||||
// Returns true if this easy handle was added to a curl multi handle.
|
||||
bool active(void) const { return mActiveMultiHandle; }
|
||||
|
||||
// If there was an error code as result, then this returns a human readable error string.
|
||||
// Only valid when setErrorBuffer was called and the curl_easy function returned an error.
|
||||
std::string getErrorString(void) const { return mErrorBuffer ? mErrorBuffer : "(null)"; }
|
||||
|
||||
// Returns true when it is expected that the parent will revoke callbacks before the curl
|
||||
// easy handle is removed from the multi handle; that usually happens when an external
|
||||
// error demands termination of the request (ie, an expiration).
|
||||
@@ -205,8 +201,7 @@ class CurlEasyHandle : public boost::noncopyable, protected AICurlEasyHandleEven
|
||||
// to set the options on a curl easy handle.
|
||||
//
|
||||
// Calling sendRequest() will then connect to the given URL and perform
|
||||
// the data exchange. If an error occurs related to this handle, it can
|
||||
// be read by calling getErrorString().
|
||||
// the data exchange. Use getResult() to determine if an error occurred.
|
||||
//
|
||||
// Note that the life cycle of a CurlEasyRequest is controlled by AICurlEasyRequest:
|
||||
// a CurlEasyRequest is only ever created as base class of a ThreadSafeCurlEasyRequest,
|
||||
@@ -267,13 +262,13 @@ class CurlEasyRequest : public CurlEasyHandle {
|
||||
// This actually adds the headers that were collected with addHeader.
|
||||
void finalizeRequest(std::string const& url);
|
||||
|
||||
// Store result code that is returned by getResult.
|
||||
// Called by MultiHandle::check_run_count() to store result code that is returned by getResult.
|
||||
void store_result(CURLcode result) { mResult = result; }
|
||||
|
||||
// Called when the curl easy handle is done.
|
||||
// Called by MultiHandle::check_run_count() when the curl easy handle is done.
|
||||
void done(AICurlEasyRequest_wat& curl_easy_request_w) { finished(curl_easy_request_w); }
|
||||
|
||||
// Fill info with the transfer info.
|
||||
// Called by MultiHandle::check_run_count() to fill info with the transfer info.
|
||||
void getTransferInfo(AICurlInterface::TransferInfo* info);
|
||||
|
||||
// If result != CURLE_FAILED_INIT then also info was filled.
|
||||
|
||||
@@ -1382,7 +1382,7 @@ char const* action_str(int action)
|
||||
//static
|
||||
int MultiHandle::socket_callback(CURL* easy, curl_socket_t s, int action, void* userp, void* socketp)
|
||||
{
|
||||
DoutEntering(dc::curl, "MultiHandle::socket_callback(" << (void*)easy << ", " << s << ", " << action_str(action) << ", " << (void*)userp << ", " << (void*)socketp << ")");
|
||||
DoutEntering(dc::curl, "MultiHandle::socket_callback((CURL*)" << (void*)easy << ", " << s << ", " << action_str(action) << ", " << (void*)userp << ", " << (void*)socketp << ")");
|
||||
MultiHandle& self = *static_cast<MultiHandle*>(userp);
|
||||
CurlSocketInfo* sock_info = static_cast<CurlSocketInfo*>(socketp);
|
||||
if (action == CURL_POLL_REMOVE)
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
#include "aithreadsafe.h"
|
||||
#include "aistatemachine.h"
|
||||
|
||||
extern F64 calc_clock_frequency(void);
|
||||
|
||||
// Local variables.
|
||||
namespace {
|
||||
struct QueueElementComp;
|
||||
|
||||
@@ -548,7 +548,7 @@ char* debug_curl_easy_escape(CURL* curl, char* url, int length)
|
||||
{
|
||||
char* ret;
|
||||
ret = curl_easy_escape(curl, url, length);
|
||||
Dout(dc::curl, "curl_easy_escape(" << curl << ", \"" << url << "\", " << length << ") = \"" << ret << '"');
|
||||
Dout(dc::curl, "curl_easy_escape(" << (AICURL*)curl << ", \"" << url << "\", " << length << ") = \"" << ret << '"');
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -569,23 +569,23 @@ CURLcode debug_curl_easy_getinfo(CURL* curl, CURLINFO info, ...)
|
||||
ret = curl_easy_getinfo(curl, info, param.some_ptr);
|
||||
if (info == CURLINFO_PRIVATE)
|
||||
{
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << curl << ", " << info << ", 0x" << std::hex << (size_t)param.some_ptr << std::dec << ") = " << ret);
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << (AICURL*)curl << ", " << info << ", 0x" << std::hex << (size_t)param.some_ptr << std::dec << ") = " << ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch((info & CURLINFO_TYPEMASK))
|
||||
{
|
||||
case CURLINFO_STRING:
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << curl << ", " << info << ", (char**){ \"" << (ret == CURLE_OK ? *param.char_ptr : " <unchanged> ") << "\" }) = " << ret);
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << (AICURL*)curl << ", " << info << ", (char**){ \"" << (ret == CURLE_OK ? *param.char_ptr : " <unchanged> ") << "\" }) = " << ret);
|
||||
break;
|
||||
case CURLINFO_LONG:
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << curl << ", " << info << ", (long*){ " << (ret == CURLE_OK ? *param.long_ptr : 0L) << "L }) = " << ret);
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << (AICURL*)curl << ", " << info << ", (long*){ " << (ret == CURLE_OK ? *param.long_ptr : 0L) << "L }) = " << ret);
|
||||
break;
|
||||
case CURLINFO_DOUBLE:
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << curl << ", " << info << ", (double*){" << (ret == CURLE_OK ? *param.double_ptr : 0.) << "}) = " << ret);
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << (AICURL*)curl << ", " << info << ", (double*){" << (ret == CURLE_OK ? *param.double_ptr : 0.) << "}) = " << ret);
|
||||
break;
|
||||
case CURLINFO_SLIST:
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << curl << ", " << info << ", (curl_slist**){ " << (ret == CURLE_OK ? **param.curl_slist_ptr : unchanged_slist) << " }) = " << ret);
|
||||
Dout(dc::curl, "curl_easy_getinfo(" << (AICURL*)curl << ", " << info << ", (curl_slist**){ " << (ret == CURLE_OK ? **param.curl_slist_ptr : unchanged_slist) << " }) = " << ret);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -759,7 +759,7 @@ char* debug_curl_easy_unescape(CURL* curl, char* url, int inlength, int* outleng
|
||||
{
|
||||
char* ret;
|
||||
ret = curl_easy_unescape(curl, url, inlength, outlength);
|
||||
Dout(dc::curl, "curl_easy_unescape(" << curl << ", \"" << url << "\", " << inlength << ", " << ((ret && outlength) ? *outlength : 1) << ") = \"" << ret << '"');
|
||||
Dout(dc::curl, "curl_easy_unescape(" << (AICURL*)curl << ", \"" << url << "\", " << inlength << ", " << ((ret && outlength) ? *outlength : 1) << ") = \"" << ret << '"');
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -325,7 +325,6 @@ static LLSD blocking_request(
|
||||
llwarns << "CURL REQ HEADERS: " << headers.asString() << llendl;
|
||||
llwarns << "CURL REQ BODY: " << ostr.str() << llendl;
|
||||
llwarns << "CURL HTTP_STATUS: " << http_status << llendl;
|
||||
llwarns << "CURL ERROR: " << curlEasyRequest_w->getErrorString() << llendl;
|
||||
llwarns << "CURL ERROR BODY: " << http_buffer.asString() << llendl;
|
||||
response["body"] = http_buffer.asString();
|
||||
}
|
||||
|
||||
@@ -238,14 +238,14 @@ BOOL LLPartSysData::unpack(LLDataPacker &dp)
|
||||
|
||||
std::ostream& operator<<(std::ostream& s, const LLPartSysData &data)
|
||||
{
|
||||
s << "Flags: " << std::hex << data.mFlags;
|
||||
s << " Pattern: " << std::hex << (U32) data.mPattern << "\n";
|
||||
s << "Flags: " << std::hex << data.mFlags << std::dec;
|
||||
s << " Pattern: " << std::hex << (U32) data.mPattern << std::dec << "\n";
|
||||
s << "Age: [" << data.mStartAge << ", " << data.mMaxAge << "]\n";
|
||||
s << "Angle: [" << data.mInnerAngle << ", " << data.mOuterAngle << "]\n";
|
||||
s << "Burst Rate: " << data.mBurstRate << "\n";
|
||||
s << "Burst Radius: " << data.mBurstRadius << "\n";
|
||||
s << "Burst Speed: [" << data.mBurstSpeedMin << ", " << data.mBurstSpeedMax << "]\n";
|
||||
s << "Burst Part Count: " << std::hex << (U32) data.mBurstPartCount << "\n";
|
||||
s << "Burst Part Count: " << std::hex << (U32) data.mBurstPartCount << std::dec << "\n";
|
||||
s << "Angular Velocity: " << data.mAngularVelocity << "\n";
|
||||
s << "Accel: " << data.mPartAccel;
|
||||
return s;
|
||||
|
||||
@@ -97,9 +97,9 @@ void APIENTRY gl_debug_callback(GLenum source,
|
||||
{
|
||||
llwarns << "----- GL WARNING -------" << llendl;
|
||||
}
|
||||
llwarns << "Type: " << std::hex << type << llendl;
|
||||
llwarns << "ID: " << std::hex << id << llendl;
|
||||
llwarns << "Severity: " << std::hex << severity << llendl;
|
||||
llwarns << "Type: " << std::hex << type << std::dec << llendl;
|
||||
llwarns << "ID: " << std::hex << id << std::dec<< llendl;
|
||||
llwarns << "Severity: " << std::hex << severity << std::dec << llendl;
|
||||
llwarns << "Message: " << message << llendl;
|
||||
llwarns << "-----------------------" << llendl;
|
||||
if (severity == GL_DEBUG_SEVERITY_HIGH_ARB)
|
||||
|
||||
@@ -1196,7 +1196,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
|
||||
intformat = GL_COMPRESSED_ALPHA;
|
||||
break;
|
||||
default:
|
||||
llwarns << "Could not compress format: " << std::hex << intformat << llendl;
|
||||
llwarns << "Could not compress format: " << std::hex << intformat << std::dec << llendl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void check_framebuffer_status()
|
||||
case GL_FRAMEBUFFER_COMPLETE:
|
||||
break;
|
||||
default:
|
||||
llwarns << "check_framebuffer_status failed -- " << std::hex << status << llendl;
|
||||
llwarns << "check_framebuffer_status failed -- " << std::hex << status << std::dec << llendl;
|
||||
ll_fail("check_framebuffer_status failed");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1416,7 +1416,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
||||
{
|
||||
found_format = TRUE;
|
||||
}
|
||||
else if(cur_format >= num_formats-1)
|
||||
else if(cur_format >= (S32)num_formats-1)
|
||||
{
|
||||
cur_format = 0;
|
||||
found_format = TRUE;
|
||||
|
||||
@@ -344,7 +344,7 @@ BOOL stop_gloderror()
|
||||
if (error != GLOD_NO_ERROR)
|
||||
{
|
||||
llwarns << "GLOD error detected, cannot generate LOD: " << std::hex
|
||||
<< error << llendl;
|
||||
<< error << std::dec << llendl;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -780,7 +780,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
|
||||
|
||||
calcWorkPriority();
|
||||
mType = host.isOk() ? LLImageBase::TYPE_AVATAR_BAKE : LLImageBase::TYPE_NORMAL;
|
||||
// llinfos << "Create: " << mID << " mHost:" << host << " Discard=" << discard << llendl;
|
||||
llinfos << "Create: " << mID << " mHost:" << host << " Discard=" << discard << " URL:"<< mUrl << llendl;
|
||||
if (!mFetcher->mDebugPause)
|
||||
{
|
||||
U32 work_priority = mWorkPriority | LLWorkerThread::PRIORITY_HIGH;
|
||||
@@ -2107,7 +2107,7 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con
|
||||
worker->unlockWorkMutex();
|
||||
}
|
||||
|
||||
// llinfos << "REQUESTED: " << id << " Discard: " << desired_discard << llendl;
|
||||
llinfos << "REQUESTED: " << id << " Discard: " << desired_discard << llendl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -340,8 +340,8 @@ void LLXMLRPCTransaction::Impl::curlEasyRequestCallback(bool success)
|
||||
if (result != CURLE_OK)
|
||||
{
|
||||
setCurlStatus(result);
|
||||
llwarns << "LLXMLRPCTransaction CURL error "
|
||||
<< mCurlCode << ": " << curlEasyRequest_w->getErrorString() << llendl;
|
||||
llwarns << "LLXMLRPCTransaction CURL error: "
|
||||
<< AICurlInterface::strerror(mCurlCode) << llendl;
|
||||
llwarns << "LLXMLRPCTransaction request URI: "
|
||||
<< mURI << llendl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user