mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-29 23:22:01 +00:00
Give an error when disk is full.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1958 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
075988465b
commit
4068fdf967
1 changed files with 11 additions and 2 deletions
|
@ -281,7 +281,12 @@ static qboolean HTTP_CL_Run(http_con_t *con)
|
||||||
con->totalreceived+=con->chunked;
|
con->totalreceived+=con->chunked;
|
||||||
if (con->file && con->chunked) //we've got a chunk in the buffer
|
if (con->file && con->chunked) //we've got a chunk in the buffer
|
||||||
{ //write it
|
{ //write it
|
||||||
VFS_WRITE(con->file, con->buffer, con->chunked);
|
if (VFS_WRITE(con->file, con->buffer, con->chunked) != con->chunked)
|
||||||
|
{
|
||||||
|
Con_Printf("Write error whilst downloading %s\nDisk full?\n", con->filename);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//and move the unparsed chunk to the front.
|
//and move the unparsed chunk to the front.
|
||||||
con->bufferused -= con->chunked;
|
con->bufferused -= con->chunked;
|
||||||
memmove(con->buffer, con->buffer+con->chunked, con->bufferused);
|
memmove(con->buffer, con->buffer+con->chunked, con->bufferused);
|
||||||
|
@ -293,7 +298,11 @@ static qboolean HTTP_CL_Run(http_con_t *con)
|
||||||
con->totalreceived+=ammount;
|
con->totalreceived+=ammount;
|
||||||
if (con->file) //we've got a chunk in the buffer
|
if (con->file) //we've got a chunk in the buffer
|
||||||
{ //write it
|
{ //write it
|
||||||
VFS_WRITE(con->file, con->buffer, con->bufferused);
|
if (VFS_WRITE(con->file, con->buffer, con->bufferused) != con->bufferused)
|
||||||
|
{
|
||||||
|
Con_Printf("Write error whilst downloading %s\nDisk full?\n", con->filename);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
con->bufferused = 0;
|
con->bufferused = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue