You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2008/06/11 00:58:07 UTC

svn commit: r666381 - in /incubator/thrift/trunk/lib/alterl/src: thrift_binary_protocol.erl thrift_processor.erl

Author: dreiss
Date: Tue Jun 10 15:58:07 2008
New Revision: 666381

URL: http://svn.apache.org/viewvc?rev=666381&view=rev
Log:
Make strings read as lists, not as binary

Modified:
    incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl
    incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl

Modified: incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl?rev=666381&r1=666380&r2=666381&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl (original)
+++ incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl Tue Jun 10 15:58:07 2008
@@ -214,7 +214,8 @@
 
 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).

Modified: incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl?rev=666381&r1=666380&r2=666381&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl (original)
+++ incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl Tue Jun 10 15:58:07 2008
@@ -29,7 +29,7 @@
     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"),