mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +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)
|
||||
{
|
||||
unsigned short runningcrc;
|
||||
unsigned short runningcrc = 0;
|
||||
char buffer[8192];
|
||||
int size, pos, chunk;
|
||||
if (!cls.downloadqw)
|
||||
|
@ -1426,6 +1426,13 @@ void CLDP_ParseDownloadFinished(char *s)
|
|||
QCRC_AddBlock(&runningcrc, buffer, chunk);
|
||||
}
|
||||
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);
|
||||
if (size != atoi(Cmd_Argv(1)))
|
||||
|
@ -1440,7 +1447,6 @@ void CLDP_ParseDownloadFinished(char *s)
|
|||
CL_DownloadFailed(cls.downloadname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
CL_FinishDownload(cls.downloadname, cls.downloadtempname);
|
||||
*cls.downloadname = '\0';
|
||||
|
|
Loading…
Reference in a new issue