diff options
author | Jens Geyer <jensg@apache.org> | 2020-10-30 17:15:18 +0100 |
---|---|---|
committer | Jens Geyer <jensg@apache.org> | 2020-10-30 18:26:21 +0100 |
commit | 6762cad25cad7997d09931ba942212d2d0ef61f1 (patch) | |
tree | e8e9e87f4f6e37ced40e4d674ad6102058a6b157 | |
parent | 22671db01f5c349f2fa54b393581cb4d61bdd895 (diff) | |
download | thrift-6762cad25cad7997d09931ba942212d2d0ef61f1.tar.gz |
THRIFT-5304 TWinHTTPClientImpl may incorrectly report that the message size is reached
Client: Delphi
Patch: Jens Geyer
-rw-r--r-- | lib/delphi/src/Thrift.Transport.WinHTTP.pas | 2 | ||||
-rw-r--r-- | lib/delphi/src/Thrift.Transport.pas | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/delphi/src/Thrift.Transport.WinHTTP.pas b/lib/delphi/src/Thrift.Transport.WinHTTP.pas index 5794b1c23..b0f32ef3b 100644 --- a/lib/delphi/src/Thrift.Transport.WinHTTP.pas +++ b/lib/delphi/src/Thrift.Transport.WinHTTP.pas @@ -333,6 +333,8 @@ begin else raise TTransportExceptionInterrupted.Create( sMsg); end; + // we're about to receive a new message, so reset everyting + ResetConsumedMessageSize(-1); FInputStream := THTTPResponseStream.Create( http); if http.QueryTotalResponseSize( dwSize) // FALSE indicates "no info available" then UpdateKnownMessageSize( dwSize); diff --git a/lib/delphi/src/Thrift.Transport.pas b/lib/delphi/src/Thrift.Transport.pas index 1b8300c84..6a69d9338 100644 --- a/lib/delphi/src/Thrift.Transport.pas +++ b/lib/delphi/src/Thrift.Transport.pas @@ -110,7 +110,7 @@ type function MaxMessageSize : Integer; property RemainingMessageSize : Int64 read FRemainingMessageSize; property KnownMessageSize : Int64 read FKnownMessageSize; - procedure ResetConsumedMessageSize( const newSize : Int64 = -1); inline; + procedure ResetConsumedMessageSize( const newSize : Int64 = -1); procedure UpdateKnownMessageSize(const size : Int64); override; procedure CheckReadBytesAvailable(const numBytes : Int64); inline; procedure CountConsumedMessageBytes(const numBytes : Int64); inline; |