diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-07-15 11:20:15 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-07-15 11:21:21 +0300 |
commit | 881b12910fe44f479fca50cdee965f602bce3162 (patch) | |
tree | 272e8d3ca83c8fe33a55bb9b01a97efe8630ec27 /indra/llcorehttp | |
parent | 77aac9579170369a11f0884e16bd730f8cbb8bdb (diff) | |
parent | be6066eae218856f7fd74b98968a75e5062fa830 (diff) |
Merge branch 'master' into DRTVWR-539
Diffstat (limited to 'indra/llcorehttp')
-rw-r--r-- | indra/llcorehttp/CMakeLists.txt | 1 | ||||
-rw-r--r-- | indra/llcorehttp/_httpreplyqueue.cpp | 1 | ||||
-rw-r--r-- | indra/llcorehttp/_httpreplyqueue.h | 1 | ||||
-rw-r--r-- | indra/llcorehttp/_httprequestqueue.cpp | 12 | ||||
-rw-r--r-- | indra/llcorehttp/_httprequestqueue.h | 2 | ||||
-rw-r--r-- | indra/llcorehttp/_httpservice.cpp | 6 | ||||
-rw-r--r-- | indra/llcorehttp/httpoptions.cpp | 11 | ||||
-rw-r--r-- | indra/llcorehttp/httpoptions.h | 11 |
8 files changed, 36 insertions, 9 deletions
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 240ea2da83..8bb6a657b1 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -13,6 +13,7 @@ include(LLAddBuildTest) include(LLMessage) include(LLCommon) include(Tut) +include(bugsplat) include_directories (${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/indra/llcorehttp/_httpreplyqueue.cpp b/indra/llcorehttp/_httpreplyqueue.cpp index 2b138f3ad5..229bfdbe07 100644 --- a/indra/llcorehttp/_httpreplyqueue.cpp +++ b/indra/llcorehttp/_httpreplyqueue.cpp @@ -56,7 +56,6 @@ void HttpReplyQueue::addOp(const HttpReplyQueue::opPtr_t &op) mQueue.push_back(op); } - mQueueCV.notify_all(); } diff --git a/indra/llcorehttp/_httpreplyqueue.h b/indra/llcorehttp/_httpreplyqueue.h index 928ee10a83..33e205c1c9 100644 --- a/indra/llcorehttp/_httpreplyqueue.h +++ b/indra/llcorehttp/_httpreplyqueue.h @@ -98,7 +98,6 @@ protected: OpContainer mQueue; LLCoreInt::HttpMutex mQueueMutex; - LLCoreInt::HttpConditionVariable mQueueCV; }; // end class HttpReplyQueue diff --git a/indra/llcorehttp/_httprequestqueue.cpp b/indra/llcorehttp/_httprequestqueue.cpp index c6f4ad789f..ad72bdcce6 100644 --- a/indra/llcorehttp/_httprequestqueue.cpp +++ b/indra/llcorehttp/_httprequestqueue.cpp @@ -142,13 +142,19 @@ void HttpRequestQueue::wakeAll() } -void HttpRequestQueue::stopQueue() +bool HttpRequestQueue::stopQueue() { { HttpScopedLock lock(mQueueMutex); - mQueueStopped = true; - wakeAll(); + if (!mQueueStopped) + { + mQueueStopped = true; + wakeAll(); + return true; + } + wakeAll(); + return false; } } diff --git a/indra/llcorehttp/_httprequestqueue.h b/indra/llcorehttp/_httprequestqueue.h index 3c3d134b07..f0296f30e3 100644 --- a/indra/llcorehttp/_httprequestqueue.h +++ b/indra/llcorehttp/_httprequestqueue.h @@ -124,7 +124,7 @@ public: /// them on their way. /// /// Threading: callable by any thread. - void stopQueue(); + bool stopQueue(); protected: static HttpRequestQueue * sInstance; diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 34268d94f6..56f52f1b09 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -87,7 +87,11 @@ HttpService::~HttpService() // is a bit tricky. if (mRequestQueue) { - mRequestQueue->stopQueue(); + if (mRequestQueue->stopQueue()) + { + // Give mRequestQueue a chance to finish + ms_sleep(10); + } } if (mThread) diff --git a/indra/llcorehttp/httpoptions.cpp b/indra/llcorehttp/httpoptions.cpp index df5aa52fa9..c6365e5091 100644 --- a/indra/llcorehttp/httpoptions.cpp +++ b/indra/llcorehttp/httpoptions.cpp @@ -32,6 +32,7 @@ namespace LLCore { + bool HttpOptions::sDefaultVerifyPeer = false; HttpOptions::HttpOptions() : mWantHeaders(false), @@ -43,7 +44,7 @@ HttpOptions::HttpOptions() : mMaxRetryBackoff(HTTP_RETRY_BACKOFF_MAX_DEFAULT), mUseRetryAfter(HTTP_USE_RETRY_AFTER_DEFAULT), mFollowRedirects(true), - mVerifyPeer(false), + mVerifyPeer(sDefaultVerifyPeer), mVerifyHost(false), mDNSCacheTimeout(-1L), mNoBody(false) @@ -122,7 +123,15 @@ void HttpOptions::setHeadersOnly(bool nobody) { mNoBody = nobody; if (mNoBody) + { setWantHeaders(true); + setSSLVerifyPeer(false); + } +} + +void HttpOptions::setDefaultSSLVerifyPeer(bool verify) +{ + sDefaultVerifyPeer = verify; } } // end namespace LLCore diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h index 8a6de61b04..41f71896b0 100644 --- a/indra/llcorehttp/httpoptions.h +++ b/indra/llcorehttp/httpoptions.h @@ -143,7 +143,7 @@ public: /// Instructs the LLCore::HTTPRequest to verify that the exchanged security /// certificate is authentic. - /// Default: false + /// Default: sDefaultVerifyPeer void setSSLVerifyPeer(bool verify); bool getSSLVerifyPeer() const { @@ -177,6 +177,13 @@ public: { return mNoBody; } + + /// Sets default behavior for verifying that the name in the + /// security certificate matches the name of the host contacted. + /// Defaults false if not set, but should be set according to + /// viewer's initialization options and command argunments, see + /// NoVerifySSLCert + static void setDefaultSSLVerifyPeer(bool verify); protected: bool mWantHeaders; @@ -192,6 +199,8 @@ protected: bool mVerifyHost; int mDNSCacheTimeout; bool mNoBody; + + static bool sDefaultVerifyPeer; }; // end class HttpOptions |