diff options
author | Merov Linden <merov@lindenlab.com> | 2013-06-19 14:06:06 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-06-19 14:06:06 -0700 |
commit | 7da4c651911743707c0cc7cd4bebdcefb52eb379 (patch) | |
tree | 6f99d83a2b2bf3de810dd5a1191a47f7cc53ac9d /indra/llmessage | |
parent | f1e594feceb8ab284e023e164d5410cd53a656cb (diff) | |
parent | 2655c7a17ae38a073dcf8f05b0127b68edc34c95 (diff) |
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/llmessage')
-rwxr-xr-x | indra/llmessage/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | indra/llmessage/llares.cpp | 29 | ||||
-rwxr-xr-x | indra/llmessage/llareslistener.cpp | 9 | ||||
-rwxr-xr-x | indra/llmessage/llhttpclient.cpp | 6 | ||||
-rwxr-xr-x | indra/llmessage/llhttpclientadapter.cpp | 4 | ||||
-rwxr-xr-x | indra/llmessage/llurlrequest.cpp | 10 | ||||
-rwxr-xr-x | indra/llmessage/tests/llhttpclient_test.cpp | 2 |
7 files changed, 42 insertions, 20 deletions
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 1a90c32fe4..d193e367eb 100755 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -246,7 +246,7 @@ if (LL_TESTS) ${LLVFS_LIBRARIES} ${LLMATH_LIBRARIES} ${LLCOMMON_LIBRARIES} - ${GOOGLEMOCK_LIBRARIES} + ${GOOGLEMOCK_LIBRARIES} ) LL_ADD_INTEGRATION_TEST( diff --git a/indra/llmessage/llares.cpp b/indra/llmessage/llares.cpp index 5a67035ed1..7f74247a13 100755 --- a/indra/llmessage/llares.cpp +++ b/indra/llmessage/llares.cpp @@ -99,8 +99,7 @@ void LLAres::QueryResponder::queryError(int code) LLAres::LLAres() : chan_(NULL), - mInitSuccess(false), - mListener(new LLAresListener(this)) + mInitSuccess(false) { if (ares_library_init( ARES_LIB_INIT_ALL ) != ARES_SUCCESS || ares_init(&chan_) != ARES_SUCCESS) @@ -109,6 +108,8 @@ LLAres::LLAres() : return; } + mListener = boost::shared_ptr< LLAresListener >(new LLAresListener(this)); + mInitSuccess = true; } @@ -161,12 +162,26 @@ void LLAres::getSrvRecords(const std::string &name, SrvResponder *resp) } void LLAres::rewriteURI(const std::string &uri, UriRewriteResponder *resp) -{ - llinfos << "Rewriting " << uri << llendl; +{ + if (resp && uri.size()) + { + LLURI* pURI = new LLURI(uri); + + resp->mUri = *pURI; + + delete pURI; + + if (!resp->mUri.scheme().size() || !resp->mUri.hostName().size()) + { + return; + } + + //llinfos << "LLAres::rewriteURI (" << uri << ") search: '" << "_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName() << "'" << llendl; - resp->mUri = LLURI(uri); - search("_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName(), - RES_SRV, resp); + search("_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName(), RES_SRV, resp); + + + } } LLQueryResponder::LLQueryResponder() diff --git a/indra/llmessage/llareslistener.cpp b/indra/llmessage/llareslistener.cpp index 58b8a05a9e..0a4effac19 100755 --- a/indra/llmessage/llareslistener.cpp +++ b/indra/llmessage/llareslistener.cpp @@ -93,5 +93,12 @@ private: void LLAresListener::rewriteURI(const LLSD& data) { - mAres->rewriteURI(data["uri"], new UriRewriteResponder(data)); + if (mAres) + { + mAres->rewriteURI(data["uri"], new UriRewriteResponder(data)); + } + else + { + llinfos << "LLAresListener::rewriteURI requested without Ares present. Ignoring: " << data << llendl; + } } diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 2d16237161..11648717ad 100755 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -225,7 +225,7 @@ static void request( { if (responder) { - responder->completed(U32_MAX, "No pump", LLSD()); + responder->completed(U32_MAX, "No pump", LLSD()); } delete body_injector; return; @@ -239,9 +239,9 @@ static void request( { responder->completed(498, "Internal Error - curl failure", LLSD()); } - delete req; + delete req ; delete body_injector; - return; + return ; } req->setSSLVerifyCallback(LLHTTPClient::getCertVerifyCallback(), (void *)req); diff --git a/indra/llmessage/llhttpclientadapter.cpp b/indra/llmessage/llhttpclientadapter.cpp index 0b59209af1..dcd2d79d67 100755 --- a/indra/llmessage/llhttpclientadapter.cpp +++ b/indra/llmessage/llhttpclientadapter.cpp @@ -45,8 +45,8 @@ void LLHTTPClientAdapter::get(const std::string& url, LLCurl::ResponderPtr respo LLSD empty_pragma_header = headers; if (!empty_pragma_header.has("Pragma")) { - // as above - empty_pragma_header["Pragma"] = " "; + // as above + empty_pragma_header["Pragma"] = " "; } LLHTTPClient::get(url, responder, empty_pragma_header); } diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 49f8144ee7..683065357d 100755 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -317,11 +317,11 @@ LLIOPipe::EStatus LLURLRequest::process_impl( const F32 TIMEOUT_ADJUSTMENT = 2.0f; mDetail->mByteAccumulator = 0; pump->adjustTimeoutSeconds(TIMEOUT_ADJUSTMENT); - lldebugs << "LLURLRequest adjustTimeoutSeconds for request: " << mDetail->mURL << llendl; - if (mState == STATE_INITIALIZED) - { - llinfos << "LLURLRequest adjustTimeoutSeconds called during upload" << llendl; - } + lldebugs << "LLURLRequest adjustTimeoutSeconds for request: " << mDetail->mURL << llendl; + if (mState == STATE_INITIALIZED) + { + llinfos << "LLURLRequest adjustTimeoutSeconds called during upload" << llendl; + } } switch(mState) diff --git a/indra/llmessage/tests/llhttpclient_test.cpp b/indra/llmessage/tests/llhttpclient_test.cpp index 87cbafa404..559001d079 100755 --- a/indra/llmessage/tests/llhttpclient_test.cpp +++ b/indra/llmessage/tests/llhttpclient_test.cpp @@ -241,7 +241,7 @@ namespace tut ensureStatusOK(); ensure_equals("echoed result matches", getResult(), sd); } - + template<> template<> void HTTPClientTestObject::test<4>() { |