THRIFT-5304 TWinHTTPClientImpl may incorrectly report that the message size is reached
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/src/Thrift.Transport.WinHTTP.pas b/lib/delphi/src/Thrift.Transport.WinHTTP.pas
index 5794b1c..b0f32ef 100644
--- a/lib/delphi/src/Thrift.Transport.WinHTTP.pas
+++ b/lib/delphi/src/Thrift.Transport.WinHTTP.pas
@@ -333,6 +333,8 @@
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 1b8300c..6a69d93 100644
--- a/lib/delphi/src/Thrift.Transport.pas
+++ b/lib/delphi/src/Thrift.Transport.pas
@@ -110,7 +110,7 @@
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;