From 5e2d97acadce5fc9c9d01435bb0b1d15a42e91f6 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 14 Jun 2007 04:06:16 +0000 Subject: [PATCH] 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 --- cl_parse.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.39.2