Call ResetConsumedMessageSize from ReadMessageEndAsync
diff --git a/lib/netstd/Thrift/Protocol/TBinaryProtocol.cs b/lib/netstd/Thrift/Protocol/TBinaryProtocol.cs
index ba2a7ab..7feb698 100644
--- a/lib/netstd/Thrift/Protocol/TBinaryProtocol.cs
+++ b/lib/netstd/Thrift/Protocol/TBinaryProtocol.cs
@@ -253,6 +253,7 @@
public override Task ReadMessageEndAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
+ Transport.ResetConsumedMessageSize();
return Task.CompletedTask;
}
diff --git a/lib/netstd/Thrift/Protocol/TCompactProtocol.cs b/lib/netstd/Thrift/Protocol/TCompactProtocol.cs
index b899d3d..dd38f48 100644
--- a/lib/netstd/Thrift/Protocol/TCompactProtocol.cs
+++ b/lib/netstd/Thrift/Protocol/TCompactProtocol.cs
@@ -459,6 +459,7 @@
public override Task ReadMessageEndAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
+ Transport.ResetConsumedMessageSize();
return Task.CompletedTask;
}
diff --git a/lib/netstd/Thrift/Protocol/TJSONProtocol.cs b/lib/netstd/Thrift/Protocol/TJSONProtocol.cs
index c100d86..82e758b 100644
--- a/lib/netstd/Thrift/Protocol/TJSONProtocol.cs
+++ b/lib/netstd/Thrift/Protocol/TJSONProtocol.cs
@@ -694,7 +694,9 @@
public override async Task ReadMessageEndAsync(CancellationToken cancellationToken)
{
+ cancellationToken.ThrowIfCancellationRequested();
await ReadJsonArrayEndAsync(cancellationToken);
+ Transport.ResetConsumedMessageSize();
}
public override async ValueTask<TStruct> ReadStructBeginAsync(CancellationToken cancellationToken)
diff --git a/lib/netstd/Thrift/Protocol/TProtocolDecorator.cs b/lib/netstd/Thrift/Protocol/TProtocolDecorator.cs
index 1ea9fb9..c75cc63 100644
--- a/lib/netstd/Thrift/Protocol/TProtocolDecorator.cs
+++ b/lib/netstd/Thrift/Protocol/TProtocolDecorator.cs
@@ -156,7 +156,9 @@
public override async Task ReadMessageEndAsync(CancellationToken cancellationToken)
{
+ cancellationToken.ThrowIfCancellationRequested();
await _wrappedProtocol.ReadMessageEndAsync(cancellationToken);
+ Transport.ResetConsumedMessageSize();
}
public override async ValueTask<TStruct> ReadStructBeginAsync(CancellationToken cancellationToken)