From 690f97c62354f15f906834350286519be5637fdb Mon Sep 17 00:00:00 2001 From: thickbrick Date: Mon, 28 Mar 2011 22:30:30 +0200 Subject: Fix #832: Media Filter: handle sim hosts with no dns name. This prevents streams from being erronously identified as originating from a scripted object on the current sim, when the sim host doesn't have a name that can be reverese resolved. --- linden/indra/newview/llviewerparcelmedia.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llviewerparcelmedia.cpp b/linden/indra/newview/llviewerparcelmedia.cpp index b816ab4..01e86e2 100644 --- a/linden/indra/newview/llviewerparcelmedia.cpp +++ b/linden/indra/newview/llviewerparcelmedia.cpp @@ -983,7 +983,12 @@ std::string LLViewerParcelMedia::extractDomain(std::string url) url = url.substr(pos + 1, count); } - if (url.find(gAgent.getRegion()->getHost().getHostName()) == 0 || url.find(last_region) == 0) + std::string current_region = gAgent.getRegion()->getHost().getHostName(); + if (!current_region.size()) + { + current_region = gAgent.getRegion()->getHost().getIPString(); + } + if (url.find(current_region) == 0 || url.find(last_region) == 0) { // This must be a scripted object rezzed in the region: // extend the concept of "domain" to encompass the @@ -992,7 +997,7 @@ std::string LLViewerParcelMedia::extractDomain(std::string url) // Get rid of any port number pos = url.find('/'); // We earlier made sure that there's one - url = gAgent.getRegion()->getHost().getHostName() + url.substr(pos); + url = current_region + url.substr(pos); pos = url.find('?'); if (pos != std::string::npos) @@ -1027,6 +1032,10 @@ std::string LLViewerParcelMedia::extractDomain(std::string url) // Remember this region, so to cope with requests occuring just after a // TP out of it. last_region = gAgent.getRegion()->getHost().getHostName(); + if (!last_region.size()) + { + last_region = gAgent.getRegion()->getHost().getIPString(); + } return url; } -- cgit v1.1