From d93521b8807cc2431d4f2f873e366b4685a8d7cc Mon Sep 17 00:00:00 2001 From: David Reiss Date: Tue, 10 Jun 2008 22:58:07 +0000 Subject: [PATCH] Make strings read as lists, not as binary git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666381 13f79535-47bb-0310-9956-ffa450edef68 --- lib/alterl/src/thrift_binary_protocol.erl | 3 ++- lib/alterl/src/thrift_processor.erl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/alterl/src/thrift_binary_protocol.erl b/lib/alterl/src/thrift_binary_protocol.erl index f71e5470..4e8cfb3f 100644 --- a/lib/alterl/src/thrift_binary_protocol.erl +++ b/lib/alterl/src/thrift_binary_protocol.erl @@ -214,7 +214,8 @@ read(This, double) -> read(This, string) -> {ok, Sz} = read(This, i32), - read(This, Sz); + {ok, Bin} = read(This, Sz), + {ok, binary_to_list(Bin)}; read(This, Len) when is_integer(Len), Len >= 0 -> thrift_transport:read(This#binary_protocol.transport, Len). diff --git a/lib/alterl/src/thrift_processor.erl b/lib/alterl/src/thrift_processor.erl index 742bc289..c193946b 100644 --- a/lib/alterl/src/thrift_processor.erl +++ b/lib/alterl/src/thrift_processor.erl @@ -29,7 +29,7 @@ loop(State = #state{in_protocol = IProto, case thrift_protocol:read(IProto, message_begin) of #protocol_message_begin{name = Function, type = ?tMessageType_CALL} -> - ok= handle_function(State, list_to_atom(binary_to_list(Function))), + ok= handle_function(State, list_to_atom(Function)), loop(State); {error, closed} -> error_logger:info_msg("Client disconnected~n"), -- 2.17.1