# HG changeset patch # User Sebastian Brannstrom # Date 1287850298 -3600 # Node ID e6aa20533d0130d37a822a4f90a4c825d044a4d5 # Parent 03ad04f315db3dbfcd5ef07c0590ccb18a5de11d Merged fix for 3843 diff -r 03ad04f315db -r e6aa20533d01 application/group/Podcast.mmp --- a/application/group/Podcast.mmp Sat Oct 23 17:09:23 2010 +0100 +++ b/application/group/Podcast.mmp Sat Oct 23 17:11:38 2010 +0100 @@ -109,3 +109,5 @@ LIBRARY estlib.lib //LIBRARY libc.lib LIBRARY centralrepository.lib +LIBRARY sysutil.lib + diff -r 03ad04f315db -r e6aa20533d01 engine/inc/HttpEventHandler.h --- a/engine/inc/HttpEventHandler.h Sat Oct 23 17:09:23 2010 +0100 +++ b/engine/inc/HttpEventHandler.h Sat Oct 23 17:11:38 2010 +0100 @@ -71,6 +71,7 @@ TBool iSilent; TBool iContinue; TInt iLastStatusCode; + TInt iDriveNo; }; #endif diff -r 03ad04f315db -r e6aa20533d01 engine/src/HttpEventHandler.cpp --- a/engine/src/HttpEventHandler.cpp Sat Oct 23 17:09:23 2010 +0100 +++ b/engine/src/HttpEventHandler.cpp Sat Oct 23 17:11:38 2010 +0100 @@ -19,10 +19,13 @@ // HttpEventHandler.cpp #include #include +#include #include "HttpEventHandler.h" #include "bautils.h" #include "Httpclient.h" +const TInt64 KMinDiskSpace = 1024 * 1024; // at least 1 MB must remain + void CHttpEventHandler::ConstructL() { //iVerbose = ETrue; @@ -148,6 +151,18 @@ // Some (more) body data has been received (in the HTTP response) //DumpRespBody(aTransaction); //DP1("Saving: %d", iSavingResponseBody); + + // check if we have enough disk space + if (iDriveNo != -1 && SysUtil::DiskSpaceBelowCriticalLevelL( &iFileServ, KMinDiskSpace, iDriveNo )) + { + TInt error = KErrDiskFull; + iFileOpen = EFalse; + iRespBodyFile.Close(); + iCallbacks.FileError(error); + iHttpClient->ClientRequestCompleteL(error); + return; + } + // Append to the output file if we're saving responses if (iFileOpen) { @@ -239,6 +254,26 @@ DP1("CHttpEventHandler::SetSaveFileName, aContinue=%d", aContinue); iFileName.Copy(fName); iContinue = aContinue; + + switch(fName[0]) + { + case 'C': + iDriveNo = EDriveC; + break; + case 'E': + iDriveNo = EDriveE; + break; + case 'F': + iDriveNo = EDriveF; + break; + case 'G': + iDriveNo = EDriveG; + break; + default: + iDriveNo = -1; + break; + } + DP1("iDriveNo set to %d", iDriveNo); } void CHttpEventHandler::DumpRespHeadersL(RHTTPTransaction& aTrans)