Make strings read as lists, not as binary
authorDavid Reiss <dreiss@apache.org>
Tue, 10 Jun 2008 22:58:07 +0000 (22:58 +0000)
committerDavid Reiss <dreiss@apache.org>
Tue, 10 Jun 2008 22:58:07 +0000 (22:58 +0000)
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
lib/alterl/src/thrift_processor.erl

index f71e547..4e8cfb3 100644 (file)
@@ -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).
index 742bc28..c193946 100644 (file)
@@ -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"),