From: David Reiss Date: Tue, 10 Jun 2008 22:58:07 +0000 (+0000) Subject: Make strings read as lists, not as binary X-Git-Tag: 0.2.0~763 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=d93521b8807cc2431d4f2f873e366b4685a8d7cc;p=common%2Fthrift.git 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 --- 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"),