allow writing binaries in thrift_binary_protocol
Summary: they come packed in {string, Bin} so pull them out
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666424 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/alterl/src/thrift_binary_protocol.erl b/lib/alterl/src/thrift_binary_protocol.erl
index 0605dc1..0525621 100644
--- a/lib/alterl/src/thrift_binary_protocol.erl
+++ b/lib/alterl/src/thrift_binary_protocol.erl
@@ -115,6 +115,10 @@
write(This, {i32, length(Str)}),
write(This, list_to_binary(Str));
+write(This, {string, Bin}) when is_binary(Bin) ->
+ write(This, {i32, size(Bin)}),
+ write(This, Bin);
+
write(This, Binary) when is_binary(Binary) ->
thrift_transport:write(This#binary_protocol.transport, Binary).
@@ -176,7 +180,7 @@
read(This, field_stop) ->
{ok, ?tType_STOP} = read(This, byte),
- ok;
+ ok;
%%