From 4068fdf9670175e1452482a0d010f5867ea23ed9 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 12 Feb 2006 04:46:39 +0000 Subject: [PATCH] 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 --- engine/http/httpclient.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/engine/http/httpclient.c b/engine/http/httpclient.c index 4958f9151..ce2dbb31a 100644 --- a/engine/http/httpclient.c +++ b/engine/http/httpclient.c @@ -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; } }