Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Show the current status of read stream.
- procedure ReadingResponse(const Size: Int64; Stream: TStream); virtual;
- (...)
- procedure TFPCustomHTTPClient.ReadResponse(Stream: TStream; Const AllowedResponseCodes : Array of Integer; HeadersOnly: Boolean = False);
- (...)
- Len: Int64;
- begin
- (...)
- Repeat
- LB:=ReadBufLen;
- If (LB>L) then
- LB:=L;
- R:=Transfer(LB);
- ReadingResponse(Len, Stream);
- L:=L-R;
- until (L=0) or (R=0);
- end
- else if L<0 then
- begin
- // No content-length, so we read till no more data available.
- Repeat
- R:=Transfer(ReadBufLen);
- ReadingResponse(Len, Stream);
- until (R=0);
- (...)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement