mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-13 07:47:45 +00:00
fix rare error condition with downloads under DP protocol
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2587 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
cf1a12ee11
commit
03ce73bb55
1 changed files with 20 additions and 14 deletions
|
@ -1402,7 +1402,7 @@ void CLDP_ParseDownloadBegin(char *s)
|
||||||
|
|
||||||
void CLDP_ParseDownloadFinished(char *s)
|
void CLDP_ParseDownloadFinished(char *s)
|
||||||
{
|
{
|
||||||
unsigned short runningcrc;
|
unsigned short runningcrc = 0;
|
||||||
char buffer[8192];
|
char buffer[8192];
|
||||||
int size, pos, chunk;
|
int size, pos, chunk;
|
||||||
if (!cls.downloadqw)
|
if (!cls.downloadqw)
|
||||||
|
@ -1426,6 +1426,13 @@ void CLDP_ParseDownloadFinished(char *s)
|
||||||
QCRC_AddBlock(&runningcrc, buffer, chunk);
|
QCRC_AddBlock(&runningcrc, buffer, chunk);
|
||||||
}
|
}
|
||||||
VFS_CLOSE (cls.downloadqw);
|
VFS_CLOSE (cls.downloadqw);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Con_Printf("Download failed: unable to check CRC of download\n");
|
||||||
|
CL_DownloadFailed(cls.downloadname);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Cmd_TokenizeString(s+1, false, false);
|
Cmd_TokenizeString(s+1, false, false);
|
||||||
if (size != atoi(Cmd_Argv(1)))
|
if (size != atoi(Cmd_Argv(1)))
|
||||||
|
@ -1440,7 +1447,6 @@ void CLDP_ParseDownloadFinished(char *s)
|
||||||
CL_DownloadFailed(cls.downloadname);
|
CL_DownloadFailed(cls.downloadname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
CL_FinishDownload(cls.downloadname, cls.downloadtempname);
|
CL_FinishDownload(cls.downloadname, cls.downloadtempname);
|
||||||
*cls.downloadname = '\0';
|
*cls.downloadname = '\0';
|
||||||
|
|
Loading…
Reference in a new issue