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 03:01:29 UTC

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

Author: dreiss
Date: Tue Jun 10 18:01:29 2008
New Revision: 666445

URL: http://svn.apache.org/viewvc?rev=666445&view=rev
Log:
make read(string) return a binary rather than a list
tested server side ... still need to test client side

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=666445&r1=666444&r2=666445&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 18:01:29 2008
@@ -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).

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=666445&r1=666444&r2=666445&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl (original)
+++ incubator/thrift/trunk/lib/alterl/src/thrift_processor.erl Tue Jun 10 18:01:29 2008
@@ -63,9 +63,10 @@
 
     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 ->