I am downloading different media files via HTTP.
the responce is received in chunks.I am appending all the responces and writing it to a file.
my code looks like this,
MHTTPDataSupplier* body = aTransaction.Response().Body();
TBool isLast = body->GetNextDataPart(dataChunk);
TInt pos = 0;
File.Write(dataChunk); //Responce is received in datachunk
FirstChunkOfResponce = EFalse;
when I download an image file i.e.issue Get() request for the first time,I am able to display the image,if I issue Get() request for same file for the second time and onwards,I get unpredictable results.sometimes image is correctly downloaded and sometimes not.moreover,when I debug it,I never get this problem and image is correctly downloaded each time.In this case,I put breakpoint in IssueHttpGetL().I see that this function gets executed 3 times,I dont know why?
more interesting thing is,my image size is 69.5KB,I never get a total responce of less than 69.5KB. whenever I get total responce of 69.5KB,139KB,208KB the image is correctly displayed.
which happen to be multiple of image size.
what can be the problem,perhaps when I am issuing Get() for second time onwards, I dont get responce from beginning.