TLS bugfixes.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3183 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-04-19 01:48:10 +00:00
parent ed78c773e5
commit c889ac9225
1 changed files with 27 additions and 5 deletions

View File

@ -275,11 +275,11 @@ jclient_t *JCL_Connect(char *server, int defport, qboolean usesecure, char *acco
if (usesecure)
{
if (Net_SetTLSClient(jclient->socket)<0)
if (Net_SetTLSClient(jcl->socket)<0)
{
Net_Close(jclient->socket);
free(jclient);
jclient = NULL;
Net_Close(jcl->socket);
free(jcl);
jcl = NULL;
return NULL;
}
@ -809,7 +809,7 @@ int JCL_ClientFrame(jclient_t *jcl)
{
if (jcl->tagdepth != 1)
{
if (jcl->tagdepth < 1)
if (jcl->tagdepth < 1 && jcl->bufferedinammount==jcl->instreampos)
{
Con_Printf("End of XML stream\n");
return JCL_KILL;
@ -1093,6 +1093,12 @@ void JCL_Command(void)
{
if (!strcmp(arg[0]+1, "tlsopen") || !strcmp(arg[0]+1, "tlsconnect"))
{
if (!*arg[1])
{
Con_Printf("tlsopen [server] [account] [password]\n");
return;
}
if (jclient)
{
Con_Printf("You are already connected\nPlease /quit first\n");
@ -1104,9 +1110,20 @@ void JCL_Command(void)
return;
}
jclient = JCL_Connect(arg[1], 5223, true, arg[2], arg[3]);
if (!jclient)
{
Con_Printf("Connect failed\n");
return;
}
}
else if (!strcmp(arg[0]+1, "open") || !strcmp(arg[0]+1, "connect"))
{
if (!*arg[1])
{
Con_Printf("open [server] [account] [password]\n");
return;
}
if (jclient)
{
Con_Printf("You are already connected\nPlease /quit first\n");
@ -1118,6 +1135,11 @@ void JCL_Command(void)
return;
}
jclient = JCL_Connect(arg[1], 5222, false, arg[2], arg[3]);
if (!jclient)
{
Con_Printf("Connect failed\n");
return;
}
}
else if (!jclient)
{