From 225db732c2195e183bcf95ed6b496d09054b0eba Mon Sep 17 00:00:00 2001 From: David Reiss Date: Wed, 11 Jun 2008 00:58:48 +0000 Subject: [PATCH] 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 --- lib/alterl/src/thrift_binary_protocol.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/alterl/src/thrift_binary_protocol.erl b/lib/alterl/src/thrift_binary_protocol.erl index 0605dc1e..05256218 100644 --- a/lib/alterl/src/thrift_binary_protocol.erl +++ b/lib/alterl/src/thrift_binary_protocol.erl @@ -115,6 +115,10 @@ write(This, {string, Str}) when is_list(Str) -> 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, set_end) -> ok; read(This, field_stop) -> {ok, ?tType_STOP} = read(This, byte), - ok; + ok; %% -- 2.17.1