From: havoc Date: Thu, 14 Jun 2007 04:06:16 +0000 (+0000) Subject: print a message and call CL_BeginDownloads if a download is corrupt X-Git-Tag: xonotic-v0.1.0preview~3045 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5e2d97acadce5fc9c9d01435bb0b1d15a42e91f6;p=xonotic%2Fdarkplaces.git print a message and call CL_BeginDownloads if a download is corrupt git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7416 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index 31afbd1f..9974a30b 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1154,7 +1154,7 @@ void CL_BeginDownloads_f(void) void CL_StopDownload(int size, int crc) { - if (cls.qw_downloadmemory && cls.qw_downloadmemorycursize == size && CRC_Block(cls.qw_downloadmemory, size) == crc) + if (cls.qw_downloadmemory && cls.qw_downloadmemorycursize == size && CRC_Block(cls.qw_downloadmemory, cls.qw_downloadmemorycursize) == crc) { int existingcrc; size_t existingsize; @@ -1192,6 +1192,11 @@ void CL_StopDownload(int size, int crc) FS_Rescan(); } } + else if (cls.qw_downloadmemory && size) + { + Con_Printf("Download \"%s\" is corrupt (%i bytes, %i CRC, should be %i bytes, %i CRC), discarding\n", cls.qw_downloadname, size, crc, (int)cls.qw_downloadmemorycursize, (int)CRC_Block(cls.qw_downloadmemory, cls.qw_downloadmemorycursize)); + CL_BeginDownloads(true); + } if (cls.qw_downloadmemory) Mem_Free(cls.qw_downloadmemory);