From e5bfdac02449410c13a837dfc05d10fafe2eb042 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 20 Jan 2016 09:46:25 -0800 Subject: [PATCH 1/7] MAINT-6071: Change reference to a copy to avoid later use of erased variable. --- indra/newview/llmaterialmgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index 9ac560c217..f996557c17 100755 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -599,7 +599,7 @@ void LLMaterialMgr::processGetQueue() // get_queue_t::iterator itRegionQueue = loopRegionQueue++; - const LLUUID& region_id = itRegionQueue->first; + LLUUID region_id = itRegionQueue->first; if (isGetAllPending(region_id)) { continue; @@ -647,6 +647,7 @@ void LLMaterialMgr::processGetQueue() if (materials.empty()) { mGetQueue.erase(itRegionQueue); + // $TODO*: We may be able to issue a continue here. Research. } std::string materialString = zip_llsd(materialsData); From f51a240755a22c904f177d80bb76136a5f3e72c8 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 20 Jan 2016 14:15:54 -0800 Subject: [PATCH 2/7] MAINT-6064: If an add and join is "rejected" (rather than "failed") this the run session routine should return success (since technically it did not fail... was simply rejected by the other party) This prevents the Vivox coroutine from attempting to tear down the voice connection. --- indra/newview/llvoicevivox.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 8823bbce73..e9e004f492 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -821,7 +821,7 @@ bool LLVivoxVoiceClient::establishVoiceConnection() do { result = llcoro::suspendUntilEventOn(voiceConnectPump); - LL_DEBUGS("Voice") << "event=" << ll_pretty_print_sd(result) << LL_ENDL; + LL_WARNS("Voice") << "event=" << ll_pretty_print_sd(result) << LL_ENDL; } while (!result.has("connector")); @@ -1184,7 +1184,7 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession) { result = llcoro::suspendUntilEventOn(voicePump); - LL_DEBUGS("Voice") << "event=" << ll_pretty_print_sd(result) << LL_ENDL; + LL_WARNS("Voice") << "event=" << ll_pretty_print_sd(result) << LL_ENDL; if (result.has("session")) { if (result.has("handle")) @@ -1437,7 +1437,11 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session) if (mSessionTerminateRequested) terminateAudioSession(true); - return false; + // if a relog has been requested then addAndJoineSession + // failed in a spectacular way and we need to back out. + // If this is not the case then we were simply trying to + // make a call and the other party rejected it. + return !mRelogRequested; } notifyParticipantObservers(); From 28921896f18eaf51583ffac1f29fbae2d227ab8b Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 20 Jan 2016 16:08:33 -0800 Subject: [PATCH 3/7] OPEN-312: Removed add_dependency entries for items listed in target_link_libraries. Superfluous. --- indra/llplugin/CMakeLists.txt | 1 + indra/llplugin/slplugin/CMakeLists.txt | 6 ------ indra/media_plugins/cef/CMakeLists.txt | 11 +++++------ indra/media_plugins/quicktime/CMakeLists.txt | 7 +------ 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 8c4ddd524e..84667f1b82 100755 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -11,6 +11,7 @@ include(LLMessage) include(LLRender) include(LLXML) include(LLWindow) +include(Boost) include_directories( ${LLCOMMON_INCLUDE_DIRS} diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 6e7fefeb21..0e5e835777 100755 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -69,12 +69,6 @@ target_link_libraries(SLPlugin ${PLUGIN_API_WINDOWS_LIBRARIES} ) -add_dependencies(SLPlugin - ${LLPLUGIN_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLCOMMON_LIBRARIES} -) - if (DARWIN) # Mac version needs to link against Carbon target_link_libraries(SLPlugin ${COCOA_LIBRARY}) diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 1f6163e41e..07b5af819e 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -2,6 +2,7 @@ project(media_plugin_cef) +include(Boost) include(00-Common) include(LLCommon) include(LLImage) @@ -52,8 +53,8 @@ set(media_plugin_cef_HEADER_FILES set (media_plugin_cef_LINK_LIBRARIES ${LLPLUGIN_LIBRARIES} ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} ${CEF_PLUGIN_LIBRARIES} + ${LLCOMMON_LIBRARIES} ${PLUGIN_API_WINDOWS_LIBRARIES}) @@ -84,11 +85,9 @@ add_library(media_plugin_cef ${media_plugin_cef_SOURCE_FILES} ) -add_dependencies(media_plugin_cef - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} -) +#add_dependencies(media_plugin_cef +# ${MEDIA_PLUGIN_BASE_LIBRARIES} +#) target_link_libraries(media_plugin_cef ${media_plugin_cef_LINK_LIBRARIES} diff --git a/indra/media_plugins/quicktime/CMakeLists.txt b/indra/media_plugins/quicktime/CMakeLists.txt index d7a1874bf3..c5615145be 100755 --- a/indra/media_plugins/quicktime/CMakeLists.txt +++ b/indra/media_plugins/quicktime/CMakeLists.txt @@ -14,6 +14,7 @@ include(PluginAPI) include(MediaPluginBase) include(OpenGL) include(QuickTimePlugin) +include(Boost) include_directories( ${LLPLUGIN_INCLUDE_DIRS} @@ -53,12 +54,6 @@ target_link_libraries(media_plugin_quicktime ${PLUGIN_API_WINDOWS_LIBRARIES} ) -add_dependencies(media_plugin_quicktime - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} -) - if (WINDOWS) set_target_properties( media_plugin_quicktime From 65ab91ff46b73855a2134fdc16ee0fbae5ac669f Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 20 Jan 2016 17:11:50 -0800 Subject: [PATCH 4/7] MAINT-6004 (Fix) Add non blocking file upload picker support --- autobuild.xml | 10 ++++----- indra/media_plugins/cef/media_plugin_cef.cpp | 22 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 72f55fce1d..ff436a7ef8 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -1536,11 +1536,11 @@ archive hash - 6b9eaaf83fcf8bfd4bb6966c24df7f29 + fe4b09930b509d322b10bd27821bd876 hash_algorithm md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310043/arch/Darwin/installer/llceflib-1.5.1.310043-darwin-310043.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310159/arch/Darwin/installer/llceflib-1.5.3.310159-darwin-310159.tar.bz2 name darwin @@ -1550,18 +1550,18 @@ archive hash - 578f21be02efc98bbf426529f916fce8 + 8fe98baea7ecb950d9611e9f6850cb1f hash_algorithm md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310043/arch/CYGWIN/installer/llceflib-1.5.1.310043-windows-310043.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310159/arch/CYGWIN/installer/llceflib-1.5.3.310159-windows-310159.tar.bz2 name windows version - 1.5.1.310043 + 1.5.3.310159 llphysicsextensions_source diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 9028f73e30..1bb97f3291 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -69,6 +69,7 @@ private: bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); void onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle); void onFileDownloadCallback(std::string filename); + const std::string onFileDialogCallback(); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); @@ -95,6 +96,7 @@ private: bool mCanPaste; std::string mCachePath; std::string mCookiePath; + std::string mPickedFile; LLCEFLib* mLLCEFLib; VolumeCatcher mVolumeCatcher; @@ -123,6 +125,7 @@ MediaPluginBase(host_send_func, host_user_data) mCanPaste = false; mCachePath = ""; mCookiePath = ""; + mPickedFile = ""; mLLCEFLib = new LLCEFLib(); } @@ -305,6 +308,20 @@ void MediaPluginCEF::onFileDownloadCallback(const std::string filename) sendMessage(message); } +//////////////////////////////////////////////////////////////////////////////// +// +const std::string MediaPluginCEF::onFileDialogCallback() +{ + mPickedFile.clear(); + + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file"); + message.setValueBoolean("blocking_request", true); + + sendMessage(message); + + return mPickedFile; +} + void MediaPluginCEF::onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle) { std::string name = ""; @@ -439,6 +456,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2)); mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4)); mLLCEFLib->setOnFileDownloadCallback(boost::bind(&MediaPluginCEF::onFileDownloadCallback, this, _1)); + mLLCEFLib->setOnFileDialogCallback(boost::bind(&MediaPluginCEF::onFileDialogCallback, this)); mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2)); mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this)); @@ -648,6 +666,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mEnableMediaPluginDebugging = message_in.getValueBoolean("enable"); } + if (message_name == "pick_file_response") + { + mPickedFile = message_in.getValue("file"); + } if (message_name == "auth_response") { authResponse(message_in); From 73c0b004d1750a75f37a445be032ba73e0b72ca8 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 20 Jan 2016 17:13:12 -0800 Subject: [PATCH 5/7] Backed out changeset 2e77fb7b61b6 --- autobuild.xml | 10 ++++----- indra/media_plugins/cef/media_plugin_cef.cpp | 22 -------------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index ff436a7ef8..72f55fce1d 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -1536,11 +1536,11 @@ archive hash - fe4b09930b509d322b10bd27821bd876 + 6b9eaaf83fcf8bfd4bb6966c24df7f29 hash_algorithm md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310159/arch/Darwin/installer/llceflib-1.5.3.310159-darwin-310159.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310043/arch/Darwin/installer/llceflib-1.5.1.310043-darwin-310043.tar.bz2 name darwin @@ -1550,18 +1550,18 @@ archive hash - 8fe98baea7ecb950d9611e9f6850cb1f + 578f21be02efc98bbf426529f916fce8 hash_algorithm md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310159/arch/CYGWIN/installer/llceflib-1.5.3.310159-windows-310159.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310043/arch/CYGWIN/installer/llceflib-1.5.1.310043-windows-310043.tar.bz2 name windows version - 1.5.3.310159 + 1.5.1.310043 llphysicsextensions_source diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 1bb97f3291..9028f73e30 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -69,7 +69,6 @@ private: bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); void onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle); void onFileDownloadCallback(std::string filename); - const std::string onFileDialogCallback(); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); @@ -96,7 +95,6 @@ private: bool mCanPaste; std::string mCachePath; std::string mCookiePath; - std::string mPickedFile; LLCEFLib* mLLCEFLib; VolumeCatcher mVolumeCatcher; @@ -125,7 +123,6 @@ MediaPluginBase(host_send_func, host_user_data) mCanPaste = false; mCachePath = ""; mCookiePath = ""; - mPickedFile = ""; mLLCEFLib = new LLCEFLib(); } @@ -308,20 +305,6 @@ void MediaPluginCEF::onFileDownloadCallback(const std::string filename) sendMessage(message); } -//////////////////////////////////////////////////////////////////////////////// -// -const std::string MediaPluginCEF::onFileDialogCallback() -{ - mPickedFile.clear(); - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file"); - message.setValueBoolean("blocking_request", true); - - sendMessage(message); - - return mPickedFile; -} - void MediaPluginCEF::onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle) { std::string name = ""; @@ -456,7 +439,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2)); mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4)); mLLCEFLib->setOnFileDownloadCallback(boost::bind(&MediaPluginCEF::onFileDownloadCallback, this, _1)); - mLLCEFLib->setOnFileDialogCallback(boost::bind(&MediaPluginCEF::onFileDialogCallback, this)); mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2)); mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this)); @@ -666,10 +648,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mEnableMediaPluginDebugging = message_in.getValueBoolean("enable"); } - if (message_name == "pick_file_response") - { - mPickedFile = message_in.getValue("file"); - } if (message_name == "auth_response") { authResponse(message_in); From 0f265ebf724b3c781afc234875171ed90f45d4e9 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 20 Jan 2016 17:15:02 -0800 Subject: [PATCH 6/7] Backed out changeset 672bd34768c6 --- autobuild.xml | 10 ++++----- indra/media_plugins/cef/media_plugin_cef.cpp | 22 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 72f55fce1d..ff436a7ef8 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -1536,11 +1536,11 @@ archive hash - 6b9eaaf83fcf8bfd4bb6966c24df7f29 + fe4b09930b509d322b10bd27821bd876 hash_algorithm md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310043/arch/Darwin/installer/llceflib-1.5.1.310043-darwin-310043.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310159/arch/Darwin/installer/llceflib-1.5.3.310159-darwin-310159.tar.bz2 name darwin @@ -1550,18 +1550,18 @@ archive hash - 578f21be02efc98bbf426529f916fce8 + 8fe98baea7ecb950d9611e9f6850cb1f hash_algorithm md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310043/arch/CYGWIN/installer/llceflib-1.5.1.310043-windows-310043.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/310159/arch/CYGWIN/installer/llceflib-1.5.3.310159-windows-310159.tar.bz2 name windows version - 1.5.1.310043 + 1.5.3.310159 llphysicsextensions_source diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 9028f73e30..1bb97f3291 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -69,6 +69,7 @@ private: bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); void onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle); void onFileDownloadCallback(std::string filename); + const std::string onFileDialogCallback(); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); @@ -95,6 +96,7 @@ private: bool mCanPaste; std::string mCachePath; std::string mCookiePath; + std::string mPickedFile; LLCEFLib* mLLCEFLib; VolumeCatcher mVolumeCatcher; @@ -123,6 +125,7 @@ MediaPluginBase(host_send_func, host_user_data) mCanPaste = false; mCachePath = ""; mCookiePath = ""; + mPickedFile = ""; mLLCEFLib = new LLCEFLib(); } @@ -305,6 +308,20 @@ void MediaPluginCEF::onFileDownloadCallback(const std::string filename) sendMessage(message); } +//////////////////////////////////////////////////////////////////////////////// +// +const std::string MediaPluginCEF::onFileDialogCallback() +{ + mPickedFile.clear(); + + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file"); + message.setValueBoolean("blocking_request", true); + + sendMessage(message); + + return mPickedFile; +} + void MediaPluginCEF::onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle) { std::string name = ""; @@ -439,6 +456,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2)); mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4)); mLLCEFLib->setOnFileDownloadCallback(boost::bind(&MediaPluginCEF::onFileDownloadCallback, this, _1)); + mLLCEFLib->setOnFileDialogCallback(boost::bind(&MediaPluginCEF::onFileDialogCallback, this)); mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2)); mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this)); @@ -648,6 +666,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mEnableMediaPluginDebugging = message_in.getValueBoolean("enable"); } + if (message_name == "pick_file_response") + { + mPickedFile = message_in.getValue("file"); + } if (message_name == "auth_response") { authResponse(message_in); From 37286b3d39d2e7946b9cc8cc34f51fd63b1c4aa2 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 21 Jan 2016 16:08:07 -0800 Subject: [PATCH 7/7] MAINT-5915: Put in some extra null checks around completed HTTP checks to try and eliminate a crash in the wild. --- indra/llcorehttp/_httplibcurl.cpp | 71 ++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index 4ebe14e740..d918c2ee1b 100755 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -304,6 +304,11 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode curl_easy_getinfo(handle, CURLINFO_PRIVATE, &ophandle); HttpOpRequest::ptr_t op(HttpOpRequest::fromHandle(ophandle)); + if (!op) + { + LL_WARNS() << "Unable to locate operation by handle. May have expired!" << LL_ENDL; + return false; + } if (handle != op->mCurlHandle || ! op->mCurlActive) { @@ -332,34 +337,50 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode { op->mStatus = HttpStatus(HttpStatus::EXT_CURL_EASY, status); } - if (op->mStatus) - { - int http_status(HTTP_OK); + if (op->mStatus) + { + int http_status(HTTP_OK); - curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &http_status); - if (http_status >= 100 && http_status <= 999) - { - char * cont_type(NULL); - curl_easy_getinfo(handle, CURLINFO_CONTENT_TYPE, &cont_type); - if (cont_type) - { - op->mReplyConType = cont_type; - } - op->mStatus = HttpStatus(http_status); - } - else - { - LL_WARNS(LOG_CORE) << "Invalid HTTP response code (" - << http_status << ") received from server." - << LL_ENDL; - op->mStatus = HttpStatus(HttpStatus::LLCORE, HE_INVALID_HTTP_STATUS); - } + if (handle) + { + curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &http_status); + if (http_status >= 100 && http_status <= 999) + { + char * cont_type(NULL); + curl_easy_getinfo(handle, CURLINFO_CONTENT_TYPE, &cont_type); + if (cont_type) + { + op->mReplyConType = cont_type; + } + op->mStatus = HttpStatus(http_status); + } + else + { + LL_WARNS(LOG_CORE) << "Invalid HTTP response code (" + << http_status << ") received from server." + << LL_ENDL; + op->mStatus = HttpStatus(HttpStatus::LLCORE, HE_INVALID_HTTP_STATUS); + } + } + else + { + LL_WARNS(LOG_CORE) << "Attempt to retrieve status from NULL handle!" << LL_ENDL; + } } - // Detach from multi and recycle handle - curl_multi_remove_handle(multi_handle, handle); - mHandleCache.freeHandle(op->mCurlHandle); - op->mCurlHandle = NULL; + if (multi_handle && handle) + { + // Detach from multi and recycle handle + curl_multi_remove_handle(multi_handle, handle); + mHandleCache.freeHandle(op->mCurlHandle); + } + else + { + LL_WARNS(LOG_CORE) << "Curl multi_handle or handle is NULL on remove! multi:" + << std::hex << multi_handle << " h:" << std::hex << handle << std::dec << LL_ENDL; + } + + op->mCurlHandle = NULL; // Tracing if (op->mTracing > HTTP_TRACE_OFF)