Fix bug with host-less rtc:// schemes.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5630 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2020-02-16 19:27:31 +00:00
parent fc6b45a105
commit a5c1adc630
1 changed files with 4 additions and 4 deletions

View File

@ -2203,6 +2203,10 @@ ftenet_generic_connection_t *FTENET_ICE_EstablishConnection(qboolean isserver, c
*/
newcon = Z_Malloc(sizeof(*newcon));
if (!strncmp(address, "ice://", 6)||!strncmp(address, "rtc://", 6))
address+=6;
else if (!strncmp(address, "ices://", 7)||!strncmp(address, "rtcs://", 7))
address+=7;
if (address == path && *path=='/' && fs_manifest->rtcbroker)
{
if (!strncmp(fs_manifest->rtcbroker, "tls://", 6) || !strncmp(fs_manifest->rtcbroker, "tcp://", 6))
@ -2213,10 +2217,6 @@ ftenet_generic_connection_t *FTENET_ICE_EstablishConnection(qboolean isserver, c
}
else
{
if (!strncmp(address, "ice://", 6)||!strncmp(address, "rtc://", 6))
address+=6;
else if (!strncmp(address, "ices://", 7)||!strncmp(address, "rtcs://", 7))
address+=7;
Q_strncpyz(newcon->brokername, address, sizeof(newcon->brokername)); //name is for prints only.
if (path && *path == '/' && path-address < sizeof(newcon->brokername))
{