Compare commits

...

3 Commits

Author SHA1 Message Date
Ubit Umarov
cf8778f50f Merge pull request #36 from Tampa/webrtc-fix
Fix response for vivox server type under webrtc
2026-06-06 15:17:17 +01:00
Vincent Sylvester
a61b946563 Do not respond to vivox under webrtc 2026-06-04 23:48:20 +02:00
UbitUmarov
93ebb36904 cosmetics 2026-06-04 11:36:33 +01:00
3 changed files with 15 additions and 13 deletions

View File

@@ -417,7 +417,7 @@ namespace osWebRtcVoice
m_log.Warn($"{LogHeader}[ProvisionVoice]: Request detail: {map}");
response.RawBuffer = llsdUndefAnswerBytes;
response.StatusCode = (int)HttpStatusCode.OK;
response.StatusCode = 0;
return;
}
}

View File

@@ -115,32 +115,34 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
}
// This is it! Let's ask the other world
if (words[0].Contains("."))
if (words[0].Contains('.'))
{
string[] names = words[0].Split(Util.SplitDotArray);
if (names.Length >= 2)
{
string uriStr = "http://" + words[1].ToLower();
string SSLuriStr = "https://" + words[1].ToLower();
ReadOnlySpan<char> words1lower = words[1].ToLower();
string uriStr = string.Concat("http://", words1lower);
// Let's check that the last name is a valid address
if(!Uri.TryCreate(uriStr, UriKind.Absolute, out _))
{
m_log.DebugFormat("[USER MANAGEMENT MODULE]: Malformed address {0}", words[1].ToLower());
m_log.Debug($"[USER MANAGEMENT MODULE]: Malformed address {words1lower}");
return;
}
}
UUID userID = UUID.Zero;
if(!WebUtil.GlobalExpiringBadURLs.ContainsKey(uriStr) || !WebUtil.GlobalExpiringBadURLs.ContainsKey(SSLuriStr))
if(!WebUtil.GlobalExpiringBadURLs.ContainsKey(uriStr))
{
UserAgentServiceConnector uasConn = new(uriStr);
// If fail to connect with http... try with https...
if (uasConn is null)
{
string SSLuriStr = string.Concat("https://", words1lower); // words[1] already validated
uasConn = new UserAgentServiceConnector(SSLuriStr);
if (uasConn is null)
{
m_log.DebugFormat("[USER MANAGEMENT MODULE]: UserAgentServiceConnector failed to connect to {0}", words[1].ToLower());
m_log.Debug($"[USER MANAGEMENT MODULE]: UserAgentServiceConnector failed to connect to {words1lower}");
return;
}
uriStr = SSLuriStr;
@@ -156,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
}
}
if (!userID.Equals(UUID.Zero))
if (userID.IsNotZero())
{
UserData ud = new()
{
@@ -166,10 +168,10 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
};
users.Add(ud);
AddUser(userID, names[0], names[1], uriStr);
m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0}@{1} found", words[0], words[1]);
m_log.Debug($"[USER MANAGEMENT MODULE]: User {words[0]}@{words[1]} found");
}
else
m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0}@{1} not found", words[0], words[1]);
m_log.Debug($"[USER MANAGEMENT MODULE]: User {words[0]}@{words[1]} not found");
}
}
}

View File

@@ -78,7 +78,7 @@ namespace OpenSim.Services.HypergridService
if (configName != String.Empty)
m_ConfigName = configName;
Object[] args = new Object[] { config };
Object[] args = [ config ];
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
@@ -309,7 +309,7 @@ namespace OpenSim.Services.HypergridService
// But now we need to confirm that the requester is who he says he is
// before we act on the friendship request.
if (!fromName.Contains("@"))
if (!fromName.Contains('@'))
return;
string[] parts = fromName.Split(new char[] {'@'});