From 4ec777e9986b24f12a20fbe37775f3f59ef2a330 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Wed, 11 Jun 2008 01:01:29 +0000 Subject: [PATCH] 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 --- lib/alterl/src/thrift_binary_protocol.erl | 8 ++++---- lib/alterl/src/thrift_processor.erl | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/alterl/src/thrift_binary_protocol.erl b/lib/alterl/src/thrift_binary_protocol.erl index fbd3d025..f115b2f4 100644 --- a/lib/alterl/src/thrift_binary_protocol.erl +++ b/lib/alterl/src/thrift_binary_protocol.erl @@ -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). diff --git a/lib/alterl/src/thrift_processor.erl b/lib/alterl/src/thrift_processor.erl index 0eccba6e..233c3090 100644 --- a/lib/alterl/src/thrift_processor.erl +++ b/lib/alterl/src/thrift_processor.erl @@ -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 -> -- 2.17.1