From f1c635d103c6cbc326a923cc82127e8b36f022e6 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 4 Sep 2012 23:34:11 +0200 Subject: [PATCH 1/9] Cherry pick from curlthreading2 --- indra/llimage/llpngwrapper.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h index 7def0c713..276709d1a 100644 --- a/indra/llimage/llpngwrapper.h +++ b/indra/llimage/llpngwrapper.h @@ -32,7 +32,12 @@ #ifndef LL_LLPNGWRAPPER_H #define LL_LLPNGWRAPPER_H +#ifdef LL_STANDALONE +#include +#else +// Workaround for wrongly packaged prebuilt. #include "libpng15/png.h" +#endif #include "llimage.h" class LLPngWrapper From 3a3605b812ce1a6329e5d4955544f4212f47d6fc Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 4 Sep 2012 23:34:56 +0200 Subject: [PATCH 2/9] Cherry pick from curlthreading2 --- indra/plugins/webkit/media_plugin_webkit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/plugins/webkit/media_plugin_webkit.cpp b/indra/plugins/webkit/media_plugin_webkit.cpp index 9809a9e5e..e64a89d88 100644 --- a/indra/plugins/webkit/media_plugin_webkit.cpp +++ b/indra/plugins/webkit/media_plugin_webkit.cpp @@ -25,8 +25,8 @@ * $/LicenseInfo$ * @endcond */ -#include "llqtwebkit.h" #include "linden_common.h" +#include "llqtwebkit.h" #include "indra_constants.h" // for indra keyboard codes #include "lltimer.h" From 5f8eac9dc87755922b979ac687da475d19a4b71d Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sat, 15 Sep 2012 21:15:59 +0200 Subject: [PATCH 3/9] Have i beaten you now, evil extortionists? --- indra/llplugin/slplugin/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index ea9afec16..32fd89e9a 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -52,6 +52,7 @@ add_executable(SLPlugin set_target_properties(SLPlugin PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist + LINK_FLAGS "/OPT:NOREF" ) target_link_libraries(SLPlugin From a7b9b0da42b5337528530768ece5ff217b9ba729 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sat, 15 Sep 2012 21:17:16 +0200 Subject: [PATCH 4/9] Version 1.7.2 --- indra/llcommon/llversionviewer.h.in | 2 +- indra/newview/lltexturefetch.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llcommon/llversionviewer.h.in b/indra/llcommon/llversionviewer.h.in index 82285523d..40933fcd4 100644 --- a/indra/llcommon/llversionviewer.h.in +++ b/indra/llcommon/llversionviewer.h.in @@ -35,7 +35,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 7; -const S32 LL_VERSION_PATCH = 1; +const S32 LL_VERSION_PATCH = 2; const S32 LL_VERSION_BUILD = ${vBUILD}; const char * const LL_CHANNEL = "${VIEWER_CHANNEL}"; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f507d22ba..120ed5eb0 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -779,7 +779,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; @@ -2100,7 +2100,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; } From b7f5d7e4153bc9c6650ac8d398379737eedefe88 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Thu, 20 Sep 2012 01:37:40 +0200 Subject: [PATCH 5/9] Windows build fixes --- indra/llmessage/aicurl.cpp | 3 +++ indra/llwindow/llwindowwin32.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index a5010b7e6..8237fcaa4 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/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 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; From 27090c541ff30404e30e87c98c5cab9bb1850b9f Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Thu, 20 Sep 2012 05:36:11 +0200 Subject: [PATCH 6/9] Remove inconsistent dll linkage (missing LL_COMMON_API) --- indra/newview/statemachine/aistatemachine.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/statemachine/aistatemachine.cpp b/indra/newview/statemachine/aistatemachine.cpp index a6a646ec9..d6b7c620f 100644 --- a/indra/newview/statemachine/aistatemachine.cpp +++ b/indra/newview/statemachine/aistatemachine.cpp @@ -38,8 +38,6 @@ #include "aithreadsafe.h" #include "aistatemachine.h" -extern F64 calc_clock_frequency(void); - extern LLControlGroup gSavedSettings; // Local variables. From f3780998ed38d156a0ddc5694a8668e9136f76f5 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Thu, 20 Sep 2012 16:50:03 +0200 Subject: [PATCH 7/9] Always reset stream state after using std::hex --- indra/llmessage/aicurl.cpp | 4 ++-- indra/llmessage/llpartdata.cpp | 6 +++--- indra/llrender/llgl.cpp | 6 +++--- indra/llrender/llimagegl.cpp | 2 +- indra/llrender/llrendertarget.cpp | 2 +- indra/newview/llfloatermodelpreview.cpp | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index 8237fcaa4..bfffd5a1d 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -247,7 +247,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. @@ -316,7 +316,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) { 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/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; } From 81bc6b49f8afec7ba3de03258e59236a1d1a707d Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 21 Sep 2012 01:28:26 +0200 Subject: [PATCH 8/9] Debug code bug fix; removal of CurlEasyHandle::getErrorString() CurlEasyHandle::mErrorBuffer (CURLOPT_ERRORBUFFER) can NOT be used to retrieve information about an error returned by curl_multi_info_read in CURLMsg::data::result. This buffer is only initialized when a curl_easy_* call returns an error, and those errors are already printed automagically. Initialize the buffer with an empty string upon invokation of an curl_easy_* call, so we are sure the error belongs to the last call. --- indra/llmessage/aicurl.cpp | 14 +++++--------- indra/llmessage/aicurlprivate.h | 13 ++++--------- indra/llmessage/llhttpclient.cpp | 1 - indra/newview/llxmlrpctransaction.cpp | 4 ++-- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index bfffd5a1d..fe743effa 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -653,6 +653,10 @@ void CurlEasyHandle::setErrorBuffer(void) mErrorBuffer = NULL; } } + if (mErrorBuffer) + { + mErrorBuffer[0] = '\0'; + } } CURLcode CurlEasyHandle::getinfo_priv(CURLINFO info, void* data) @@ -1448,15 +1452,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/llmessage/aicurlprivate.h b/indra/llmessage/aicurlprivate.h index 1acf08e14..ab5045fe7 100644 --- a/indra/llmessage/aicurlprivate.h +++ b/indra/llmessage/aicurlprivate.h @@ -160,10 +160,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). @@ -203,8 +199,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, @@ -264,13 +259,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/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index c04bad5e4..2f6a40050 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -480,7 +480,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/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 227904f90..2b967a1a2 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; From 5bcb350d89c48b6e4c32b59eb8e3e45c73a9b533 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 21 Sep 2012 01:48:21 +0200 Subject: [PATCH 9/9] Always print '(CURL*)' in front of CURL*'s in debug output. --- indra/llmessage/aicurlthread.cpp | 2 +- indra/llmessage/debug_libcurl.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index 0b1b85c0a..71302accb 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/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/llmessage/debug_libcurl.cpp b/indra/llmessage/debug_libcurl.cpp index 40b75d200..0610344f9 100644 --- a/indra/llmessage/debug_libcurl.cpp +++ b/indra/llmessage/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; } } @@ -755,7 +755,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; }