Skip to content

Commit

Permalink
Netchan_CreateFileFragments: Fixed a hang connection on verifying res…
Browse files Browse the repository at this point in the history
…ource stage, when precached file exists but is absolutely empty
  • Loading branch information
s1lentq committed Apr 10, 2024
1 parent b870de7 commit 61ee4f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rehlds/engine/net_chan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,9 @@ int Netchan_CreateFileFragments(qboolean server, netchan_t *chan, const char *fi

if (!FS_FileExists(filename))
return FALSE;
if (FS_FileSize(filename) > sv_filetransfermaxsize.value)

unsigned int nSize = FS_FileSize(filename);
if (nSize == 0 || nSize > sv_filetransfermaxsize.value)
return FALSE;

auto wait = (fragbufwaiting_t *)Mem_ZeroMalloc(sizeof(fragbufwaiting_t));
Expand Down

0 comments on commit 61ee4f9

Please sign in to comment.