mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 02:19:24 +02:00
* don't execute DoBeforeDataRead unless OnIdle is set
This commit is contained in:
parent
35c45dfbe5
commit
ae0cf1b50f
@ -136,7 +136,7 @@ Type
|
||||
// Called before data is read.
|
||||
Procedure DoBeforeDataRead; virtual;
|
||||
// Called when the client is waiting for the server.
|
||||
Procedure DoOnIdle; virtual;
|
||||
Procedure DoOnIdle;
|
||||
// Called whenever data is read.
|
||||
Procedure DoDataRead; virtual;
|
||||
// Called whenever data is written.
|
||||
@ -704,7 +704,10 @@ procedure TFPCustomHTTPClient.DoBeforeDataRead;
|
||||
var
|
||||
BreakUTC: TDateTime;
|
||||
begin
|
||||
// use CanRead to keep the client responsive in case the server needs a lot of time to respond
|
||||
// Use CanRead to keep the client responsive in case the server needs a lot of time to respond.
|
||||
// The request can be terminated in OnIdle - therefore it makes sense only if FOnIdle is set
|
||||
If not Assigned(FOnIdle) Then
|
||||
Exit;
|
||||
if IOTimeout>0 then
|
||||
BreakUTC := IncMilliSecond(NowUTC, IOTimeout);
|
||||
while not Terminated and not FSocket.CanRead(10) and (FSocket.LastError=0) do
|
||||
|
Loading…
Reference in New Issue
Block a user