diff options
Diffstat (limited to 'indra/newview/llappcorehttp.cpp')
-rwxr-xr-x | indra/newview/llappcorehttp.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp index 51cca273d8..8c276c0fe9 100755 --- a/indra/newview/llappcorehttp.cpp +++ b/indra/newview/llappcorehttp.cpp @@ -138,6 +138,9 @@ LLAppCoreHttp::~LLAppCoreHttp() void LLAppCoreHttp::init() { + + LLCore::LLHttp::initialize(); + LLCore::HttpStatus status = LLCore::HttpRequest::createService(); if (! status) { @@ -275,12 +278,25 @@ void setting_changed() LLAppViewer::instance()->getAppCoreHttp().refreshSettings(false); } +namespace +{ + // The NoOpDeletor is used when wrapping LLAppCoreHttp in a smart pointer below for + // passage into the LLCore::Http libararies. When the smart pointer is destroyed, + // no action will be taken since we do not in this case want the entire LLAppCoreHttp object + // to be destroyed at the end of the call. + // + // *NOTE$: Yes! It is "Deletor" + // http://english.stackexchange.com/questions/4733/what-s-the-rule-for-adding-er-vs-or-when-nouning-a-verb + // "delete" derives from Latin "deletus" + void NoOpDeletor(LLCore::HttpHandler *) + { /*NoOp*/ } +} void LLAppCoreHttp::requestStop() { llassert_always(mRequest); - mStopHandle = mRequest->requestStopThread(this); + mStopHandle = mRequest->requestStopThread(LLCore::HttpHandler::ptr_t(this, NoOpDeletor)); if (LLCORE_HTTP_HANDLE_INVALID != mStopHandle) { mStopRequested = LLTimer::getTotalSeconds(); @@ -393,7 +409,7 @@ void LLAppCoreHttp::refreshSettings(bool initial) handle = mRequest->setPolicyOption(LLCore::HttpRequest::PO_PIPELINING_DEPTH, mHttpClasses[app_policy].mPolicy, new_depth, - NULL); + LLCore::HttpHandler::ptr_t()); if (LLCORE_HTTP_HANDLE_INVALID == handle) { status = mRequest->getStatus(); @@ -443,7 +459,7 @@ void LLAppCoreHttp::refreshSettings(bool initial) handle = mRequest->setPolicyOption(LLCore::HttpRequest::PO_CONNECTION_LIMIT, mHttpClasses[app_policy].mPolicy, (mHttpClasses[app_policy].mPipelined ? 2 * setting : setting), - NULL); + LLCore::HttpHandler::ptr_t()); if (LLCORE_HTTP_HANDLE_INVALID == handle) { status = mRequest->getStatus(); @@ -456,7 +472,7 @@ void LLAppCoreHttp::refreshSettings(bool initial) handle = mRequest->setPolicyOption(LLCore::HttpRequest::PO_PER_HOST_CONNECTION_LIMIT, mHttpClasses[app_policy].mPolicy, setting, - NULL); + LLCore::HttpHandler::ptr_t()); if (LLCORE_HTTP_HANDLE_INVALID == handle) { status = mRequest->getStatus(); @@ -483,7 +499,7 @@ void LLAppCoreHttp::refreshSettings(bool initial) } LLCore::HttpStatus LLAppCoreHttp::sslVerify(const std::string &url, - LLCore::HttpHandler const * const handler, void *appdata) + const LLCore::HttpHandler::ptr_t &handler, void *appdata) { X509_STORE_CTX *ctx = static_cast<X509_STORE_CTX *>(appdata); LLCore::HttpStatus result; |