summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage')
-rwxr-xr-xindra/llmessage/CMakeLists.txt2
-rwxr-xr-xindra/llmessage/llares.cpp29
-rwxr-xr-xindra/llmessage/llareslistener.cpp9
-rwxr-xr-xindra/llmessage/llhttpclient.cpp6
-rwxr-xr-xindra/llmessage/llhttpclientadapter.cpp4
-rwxr-xr-xindra/llmessage/llurlrequest.cpp10
-rwxr-xr-xindra/llmessage/tests/llhttpclient_test.cpp2
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 3561459bb4..6110b035dc 100755
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -224,7 +224,7 @@ static void request(
{
if (responder)
{
- responder->completed(U32_MAX, "No pump", LLSD());
+ responder->completed(U32_MAX, "No pump", LLSD());
}
delete body_injector;
return;
@@ -238,9 +238,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 627d591839..de9e2fe294 100755
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -314,11 +314,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>()
{