diff --git a/indra/aistatemachine/aicurl.cpp b/indra/aistatemachine/aicurl.cpp index 84e584282..9d6627054 100644 --- a/indra/aistatemachine/aicurl.cpp +++ b/indra/aistatemachine/aicurl.cpp @@ -39,6 +39,9 @@ #include "linden_common.h" +#if LL_WINDOWS +#include //remove classic winsock from windows.h +#endif #define OPENSSL_THREAD_DEFINES #include // OPENSSL_THREADS #include @@ -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); } diff --git a/indra/aistatemachine/aicurlprivate.h b/indra/aistatemachine/aicurlprivate.h index 60835ab70..bef49e0f0 100644 --- a/indra/aistatemachine/aicurlprivate.h +++ b/indra/aistatemachine/aicurlprivate.h @@ -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. diff --git a/indra/aistatemachine/aicurlthread.cpp b/indra/aistatemachine/aicurlthread.cpp index 0b1b85c0a..71302accb 100644 --- a/indra/aistatemachine/aicurlthread.cpp +++ b/indra/aistatemachine/aicurlthread.cpp @@ -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(userp); CurlSocketInfo* sock_info = static_cast(socketp); if (action == CURL_POLL_REMOVE) diff --git a/indra/aistatemachine/aistatemachine.cpp b/indra/aistatemachine/aistatemachine.cpp index 57160256f..065724961 100644 --- a/indra/aistatemachine/aistatemachine.cpp +++ b/indra/aistatemachine/aistatemachine.cpp @@ -37,8 +37,6 @@ #include "aithreadsafe.h" #include "aistatemachine.h" -extern F64 calc_clock_frequency(void); - // Local variables. namespace { struct QueueElementComp; diff --git a/indra/aistatemachine/debug_libcurl.cpp b/indra/aistatemachine/debug_libcurl.cpp index bacf78480..85833d4b1 100644 --- a/indra/aistatemachine/debug_libcurl.cpp +++ b/indra/aistatemachine/debug_libcurl.cpp @@ -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 : " ") << "\" }) = " << ret); + Dout(dc::curl, "curl_easy_getinfo(" << (AICURL*)curl << ", " << info << ", (char**){ \"" << (ret == CURLE_OK ? *param.char_ptr : " ") << "\" }) = " << 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; } diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 70ebb3995..077d3302d 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -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(); } diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp index 26cafa025..de369dc3c 100644 --- a/indra/llmessage/llpartdata.cpp +++ b/indra/llmessage/llpartdata.cpp @@ -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; diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 762571adc..eba807ece 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -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) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index dfac4c2af..210ea7167 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -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; } } diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 6454f92d9..d770e67c9 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -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; } diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 70c6f771f..53ba137d0 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -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; diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 004d11646..89d34dea3 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -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; } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 143090cdf..5c0f7935b 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -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; } diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index cd2d02f19..b1c3c4269 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -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;