diff options
author | Thilo Schulz <arny@ats.s.bawue.de> | 2011-07-12 00:34:25 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-10 21:57:39 +0000 |
commit | c22cbd3e5552c0599dad9d60c1ea80a56b48f883 (patch) | |
tree | d1869bd39892c1b927fa9acc7dc685e16ef8c619 /src | |
parent | c84057a904efd68ec14861d416dbf72a519da22e (diff) |
Permit downloading files larger than 65 Megabytes via UDP by working around short int wraparound.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/cl_parse.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index 7a75239e..1b0e2802 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -557,7 +557,7 @@ A download message has been received from the server void CL_ParseDownload ( msg_t *msg ) { int size; unsigned char data[MAX_MSGLEN]; - int block; + uint16_t block; if (!*clc.downloadTempName) { Com_Printf("Server sending download, but no download was requested\n"); @@ -568,7 +568,7 @@ void CL_ParseDownload ( msg_t *msg ) { // read the data block = MSG_ReadShort ( msg ); - if ( !block ) + if(!block && !clc.downloadBlock) { // block zero is special, contains file size clc.downloadSize = MSG_ReadLong ( msg ); @@ -591,8 +591,9 @@ void CL_ParseDownload ( msg_t *msg ) { MSG_ReadData(msg, data, size); - if (clc.downloadBlock != block) { - Com_DPrintf( "CL_ParseDownload: Expected block %d, got %d\n", clc.downloadBlock, block); + if((clc.downloadBlock & 0xFFFF) != block) + { + Com_DPrintf( "CL_ParseDownload: Expected block %d, got %d\n", (clc.downloadBlock & 0xFFFF), block); return; } |