Home > Software engineering > Through CHttpFile read read out data have duplicate content is how to return a responsibility?
Through CHttpFile read read out data have duplicate content is how to return a responsibility?
Time:09-20
Read the content part code is as follows:
do { BYTE pbData [1024] 10 *={} '\ 0'; IReaded=pHttpFile - & gt; Read (pbData, _countof (pbData) - 2); If (0==iReaded) { break; } StrOut +=pwData; } the while (TRUE);
The content of the code above read, finally appeared at the end of a duplicate data, detailed as follows: Through wireShark capturing packet content is as follows:
But see the above code in windbg read read back the data content is as follows:
As you can see, in the end how out entREQ> this seven characters, Why is this?
Wireshark to see the data content is large, the server of data USES is chunked mode,
CodePudding user response:
PbData [iReaded]=0;//try to add an ending sign StrOut +=pbData;