You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-19 00:26:30 +09:00
Modified UPnP response handling
This commit is contained in:
@@ -408,7 +408,7 @@ namespace Lidgren.Network
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
string resp = System.Text.Encoding.ASCII.GetString(m_receiveBuffer, 0, bytesReceived);
|
string resp = System.Text.Encoding.ASCII.GetString(m_receiveBuffer, 0, bytesReceived);
|
||||||
if (resp.Contains("upnp:rootdevice"))
|
if (resp.Contains("upnp:rootdevice") || resp.Contains("UPnP/1.0"))
|
||||||
{
|
{
|
||||||
resp = resp.Substring(resp.ToLower().IndexOf("location:") + 9);
|
resp = resp.Substring(resp.ToLower().IndexOf("location:") + 9);
|
||||||
resp = resp.Substring(0, resp.IndexOf("\r")).Trim();
|
resp = resp.Substring(0, resp.IndexOf("\r")).Trim();
|
||||||
|
|||||||
@@ -114,7 +114,11 @@ namespace Lidgren.Network
|
|||||||
m_discoveryComplete.Set();
|
m_discoveryComplete.Set();
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
}
|
}
|
||||||
catch { return; }
|
catch
|
||||||
|
{
|
||||||
|
m_peer.LogVerbose("Exception ignored trying to parse UPnP XML response");
|
||||||
|
return;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user