Fix to make sure file handle is closed on failed download.
authorteknolog
Mon, 03 May 2010 15:23:15 +0100
changeset 81 46e6a623d36d
parent 79 ba4dba32295b
child 82 c70a6524a236
Fix to make sure file handle is closed on failed download.
engine/src/HttpEventHandler.cpp
--- a/engine/src/HttpEventHandler.cpp	Sun May 02 13:14:23 2010 +0100
+++ b/engine/src/HttpEventHandler.cpp	Mon May 03 15:23:15 2010 +0100
@@ -193,12 +193,14 @@
 		case THTTPEvent::ESucceeded:
 			{
 			DP("Transaction Successful");
+			iRespBodyFile.Close();
 			aTransaction.Close();
 			iHttpClient->ClientRequestCompleteL(KErrNone);
 			} break;
 		case THTTPEvent::EFailed:
 			{
 			DP("Transaction Failed");
+			iRespBodyFile.Close();
 			aTransaction.Close();
 			
 			if(iLastStatusCode == HTTPStatus::EOk || iLastStatusCode == HTTPStatus::ECreated || iLastStatusCode == HTTPStatus::EAccepted)
@@ -222,6 +224,7 @@
 			// close off the transaction if it's an error
 			if (aEvent.iStatus < 0)
 				{
+				iRespBodyFile.Close();
 				aTransaction.Close();
 				iHttpClient->ClientRequestCompleteL(aEvent.iStatus);
 				}