make read(string) return a binary rather than a list
authorDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 01:01:29 +0000 (01:01 +0000)
committerDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 01:01:29 +0000 (01:01 +0000)
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

lib/alterl/src/thrift_binary_protocol.erl
lib/alterl/src/thrift_processor.erl

index fbd3d02..f115b2f 100644 (file)
@@ -132,8 +132,8 @@ read(This, message_begin) ->
             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 @@ read(This, double) ->
         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).
index 0eccba6..233c309 100644 (file)
@@ -63,9 +63,10 @@ handle_function_catch(State = #thrift_processor{service = Service},
 
     case {ErrType, ErrData} of
         _ when IsAsync ->
+            Stack = erlang:get_stacktrace(),
             error_logger:warning_msg(
               "async void ~p threw error which must be ignored: ~p",
-              [Function, {ErrType, ErrData}]),
+              [Function, {ErrType, ErrData, Stack}]),
             ok;
 
         {throw, Exception} when is_tuple(Exception), size(Exception) > 0 ->