Commit fa8fa924 authored by csharptest's avatar csharptest Committed by rogerk

Added missing calls to ReadMessageEnd and writer.Flush.

Added unit tests for mime-type services extension.
parent 4b75bbe4
...@@ -44,7 +44,9 @@ namespace Google.ProtocolBuffers.Serialization.Http ...@@ -44,7 +44,9 @@ namespace Google.ProtocolBuffers.Serialization.Http
{ {
ICodedInputStream codedInput = CreateInputStream(options, contentType, input); ICodedInputStream codedInput = CreateInputStream(options, contentType, input);
codedInput.ReadMessageStart(); codedInput.ReadMessageStart();
return (TBuilder)builder.WeakMergeFrom(codedInput, options.ExtensionRegistry); builder.WeakMergeFrom(codedInput, options.ExtensionRegistry);
codedInput.ReadMessageEnd();
return builder;
} }
/// <summary> /// <summary>
...@@ -110,6 +112,7 @@ namespace Google.ProtocolBuffers.Serialization.Http ...@@ -110,6 +112,7 @@ namespace Google.ProtocolBuffers.Serialization.Http
// Write the closing message fragment // Write the closing message fragment
codedOutput.WriteMessageEnd(); codedOutput.WriteMessageEnd();
codedOutput.Flush();
} }
private static ICodedInputStream ContentTypeToInputStream(string contentType, MessageFormatOptions options, Stream input) private static ICodedInputStream ContentTypeToInputStream(string contentType, MessageFormatOptions options, Stream input)
......
...@@ -27,6 +27,7 @@ namespace Google.ProtocolBuffers.Serialization.Http ...@@ -27,6 +27,7 @@ namespace Google.ProtocolBuffers.Serialization.Http
ICodedInputStream codedInput = MessageFormatFactory.CreateInputStream(options, contentType, input); ICodedInputStream codedInput = MessageFormatFactory.CreateInputStream(options, contentType, input);
codedInput.ReadMessageStart(); codedInput.ReadMessageStart();
IMessageLite response = stub.CallMethod(methodName, codedInput, options.ExtensionRegistry); IMessageLite response = stub.CallMethod(methodName, codedInput, options.ExtensionRegistry);
codedInput.ReadMessageEnd();
response.WriteTo(options, responseType, output); response.WriteTo(options, responseType, output);
} }
} }
......
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
</Compile> </Compile>
<Compile Include="Compatibility\TextCompatibilityTests.cs" /> <Compile Include="Compatibility\TextCompatibilityTests.cs" />
<Compile Include="Compatibility\XmlCompatibilityTests.cs" /> <Compile Include="Compatibility\XmlCompatibilityTests.cs" />
<Compile Include="TestRpcForMimeTypes.cs" />
<Compile Include="TestReaderForUrlEncoded.cs" /> <Compile Include="TestReaderForUrlEncoded.cs" />
<Compile Include="CSharpOptionsTest.cs" /> <Compile Include="CSharpOptionsTest.cs" />
<Compile Include="DeprecatedMemberTest.cs" /> <Compile Include="DeprecatedMemberTest.cs" />
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment