diff options
author | Nyx Linden <nyx@lindenlab.com> | 2013-08-16 19:31:16 -0400 |
---|---|---|
committer | Nyx Linden <nyx@lindenlab.com> | 2013-08-16 19:31:16 -0400 |
commit | 5ae117aff6bfbc3c07876146ca270129dd91a047 (patch) | |
tree | 462f491cc055aa296b9da0041a322cd9512c045b /indra/llmessage | |
parent | 8abd6ed6b8c294ec6bfca59929dbcc71cd65c3a3 (diff) | |
parent | 32b8d398eca5eaa4ca99aa48839ad64d97954cae (diff) |
merge with 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/llurlrequest.cpp | 10 | ||||
-rwxr-xr-x | indra/llmessage/tests/llhttpclient_test.cpp | 2 |
5 files changed, 37 insertions, 15 deletions
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 6fa2669be6..d43ea5b2cb 100755 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -242,7 +242,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/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 7bf930aeb0..d6448e83fe 100755 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -300,11 +300,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 43fac83c57..a32bfa59ce 100755 --- a/indra/llmessage/tests/llhttpclient_test.cpp +++ b/indra/llmessage/tests/llhttpclient_test.cpp @@ -232,7 +232,7 @@ namespace tut ensureStatusOK(); ensure_equals("echoed result matches", getResult(), sd); } - + template<> template<> void HTTPClientTestObject::test<4>() { |