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:
Spoike 2006-02-12 04:46:39 +00:00
parent 075988465b
commit 4068fdf967

View file

@ -281,7 +281,12 @@ static qboolean HTTP_CL_Run(http_con_t *con)
con->totalreceived+=con->chunked;
if (con->file && con->chunked) //we've got a chunk in the buffer
{ //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.
con->bufferused -= con->chunked;
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;
if (con->file) //we've got a chunk in the buffer
{ //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;
}
}