diff options
author | thickbrick | 2011-03-28 22:30:30 +0200 |
---|---|---|
committer | thickbrick | 2011-03-28 22:30:30 +0200 |
commit | 690f97c62354f15f906834350286519be5637fdb (patch) | |
tree | 67a2e4ebb570c5cb26ec40dbe5701b07677a300c | |
parent | Sync media filter patch to Henri Beauchamp's MediaFilter_v4 (diff) | |
download | meta-impy-690f97c62354f15f906834350286519be5637fdb.zip meta-impy-690f97c62354f15f906834350286519be5637fdb.tar.gz meta-impy-690f97c62354f15f906834350286519be5637fdb.tar.bz2 meta-impy-690f97c62354f15f906834350286519be5637fdb.tar.xz |
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.
-rw-r--r-- | linden/indra/newview/llviewerparcelmedia.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
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) | |||
983 | url = url.substr(pos + 1, count); | 983 | url = url.substr(pos + 1, count); |
984 | } | 984 | } |
985 | 985 | ||
986 | if (url.find(gAgent.getRegion()->getHost().getHostName()) == 0 || url.find(last_region) == 0) | 986 | std::string current_region = gAgent.getRegion()->getHost().getHostName(); |
987 | if (!current_region.size()) | ||
988 | { | ||
989 | current_region = gAgent.getRegion()->getHost().getIPString(); | ||
990 | } | ||
991 | if (url.find(current_region) == 0 || url.find(last_region) == 0) | ||
987 | { | 992 | { |
988 | // This must be a scripted object rezzed in the region: | 993 | // This must be a scripted object rezzed in the region: |
989 | // extend the concept of "domain" to encompass the | 994 | // extend the concept of "domain" to encompass the |
@@ -992,7 +997,7 @@ std::string LLViewerParcelMedia::extractDomain(std::string url) | |||
992 | 997 | ||
993 | // Get rid of any port number | 998 | // Get rid of any port number |
994 | pos = url.find('/'); // We earlier made sure that there's one | 999 | pos = url.find('/'); // We earlier made sure that there's one |
995 | url = gAgent.getRegion()->getHost().getHostName() + url.substr(pos); | 1000 | url = current_region + url.substr(pos); |
996 | 1001 | ||
997 | pos = url.find('?'); | 1002 | pos = url.find('?'); |
998 | if (pos != std::string::npos) | 1003 | if (pos != std::string::npos) |
@@ -1027,6 +1032,10 @@ std::string LLViewerParcelMedia::extractDomain(std::string url) | |||
1027 | // Remember this region, so to cope with requests occuring just after a | 1032 | // Remember this region, so to cope with requests occuring just after a |
1028 | // TP out of it. | 1033 | // TP out of it. |
1029 | last_region = gAgent.getRegion()->getHost().getHostName(); | 1034 | last_region = gAgent.getRegion()->getHost().getHostName(); |
1035 | if (!last_region.size()) | ||
1036 | { | ||
1037 | last_region = gAgent.getRegion()->getHost().getIPString(); | ||
1038 | } | ||
1030 | 1039 | ||
1031 | return url; | 1040 | return url; |
1032 | } | 1041 | } |