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
{
ICodedInputStream codedInput = CreateInputStream(options, contentType, input);
codedInput.ReadMessageStart();
return (TBuilder)builder.WeakMergeFrom(codedInput, options.ExtensionRegistry);
builder.WeakMergeFrom(codedInput, options.ExtensionRegistry);
codedInput.ReadMessageEnd();
return builder;
}
/// <summary>
......@@ -110,6 +112,7 @@ namespace Google.ProtocolBuffers.Serialization.Http
// Write the closing message fragment
codedOutput.WriteMessageEnd();
codedOutput.Flush();
}
private static ICodedInputStream ContentTypeToInputStream(string contentType, MessageFormatOptions options, Stream input)
......
......@@ -27,6 +27,7 @@ namespace Google.ProtocolBuffers.Serialization.Http
ICodedInputStream codedInput = MessageFormatFactory.CreateInputStream(options, contentType, input);
codedInput.ReadMessageStart();
IMessageLite response = stub.CallMethod(methodName, codedInput, options.ExtensionRegistry);
codedInput.ReadMessageEnd();
response.WriteTo(options, responseType, output);
}
}
......
......@@ -88,6 +88,7 @@
</Compile>
<Compile Include="Compatibility\TextCompatibilityTests.cs" />
<Compile Include="Compatibility\XmlCompatibilityTests.cs" />
<Compile Include="TestRpcForMimeTypes.cs" />
<Compile Include="TestReaderForUrlEncoded.cs" />
<Compile Include="CSharpOptionsTest.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