make read(string) return a binary rather than a list
tested server side ... still need to test client side


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666445 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/alterl/src/thrift_binary_protocol.erl b/lib/alterl/src/thrift_binary_protocol.erl
index fbd3d02..f115b2f 100644
--- a/lib/alterl/src/thrift_binary_protocol.erl
+++ b/lib/alterl/src/thrift_binary_protocol.erl
@@ -132,8 +132,8 @@
             Type = Version band 16#000000ff,
             {ok, Name}  = read(This, string),
             {ok, SeqId} = read(This, i32),
-            #protocol_message_begin{name = Name,
-                                    type = Type,
+            #protocol_message_begin{name  = binary_to_list(Name),
+                                    type  = Type,
                                     seqid = SeqId};
         Err = {error, closed} -> Err;
         Err = {error, ebadf}  -> Err
@@ -221,10 +221,10 @@
         Else -> Else
     end;
 
+% returns a binary directly, call binary_to_list if necessary
 read(This, string) ->
     {ok, Sz}  = read(This, i32),
-    {ok, Bin} = read(This, Sz),
-    {ok, binary_to_list(Bin)};
+    {ok, Bin} = read(This, Sz);
 
 read(This, Len) when is_integer(Len), Len >= 0 ->
     thrift_transport:read(This#binary_protocol.transport, Len).