From 7255ed4c46581996012e48fe20c7788b9f925e5c Mon Sep 17 00:00:00 2001 From: David Reiss Date: Wed, 11 Jun 2008 01:00:04 +0000 Subject: [PATCH] removed extra debugging statements git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666433 13f79535-47bb-0310-9956-ffa450edef68 --- lib/alterl/src/thrift_binary_protocol.erl | 1 - lib/alterl/src/thrift_buffered_transport.erl | 14 ++++---------- lib/alterl/src/thrift_processor.erl | 7 +++---- lib/alterl/src/thrift_socket_transport.erl | 6 ++---- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/lib/alterl/src/thrift_binary_protocol.erl b/lib/alterl/src/thrift_binary_protocol.erl index 440da229..fbd3d025 100644 --- a/lib/alterl/src/thrift_binary_protocol.erl +++ b/lib/alterl/src/thrift_binary_protocol.erl @@ -32,7 +32,6 @@ flush_transport(#binary_protocol{transport = Transport}) -> thrift_transport:flush(Transport). close_transport(#binary_protocol{transport = Transport}) -> - thrift_transport:flush(Transport), thrift_transport:close(Transport). %%% diff --git a/lib/alterl/src/thrift_buffered_transport.erl b/lib/alterl/src/thrift_buffered_transport.erl index a2ee017d..dac8227d 100644 --- a/lib/alterl/src/thrift_buffered_transport.erl +++ b/lib/alterl/src/thrift_buffered_transport.erl @@ -66,9 +66,9 @@ flush(Transport) -> gen_server:call(Transport, flush). %%-------------------------------------------------------------------- -%% Function: flush(Transport) -> ok +%% Function: close(Transport) -> ok %% -%% Description: Flushes the buffer through to the wrapped transport +%% Description: Closes the transport and the wrapped transport %%-------------------------------------------------------------------- close(Transport) -> gen_server:call(Transport, close). @@ -123,15 +123,9 @@ handle_call(flush, _From, State = #state{buffer = Buffer, handle_call(close, _From, State = #state{buffer = Buffer, wrapped = Wrapped}) -> - case Buffer of - [] -> ok; - Data -> - thrift_transport:write(Wrapped, concat_binary(lists:reverse(Buffer))), - thrift_transport:flush(Wrapped) - end, + thrift_transport:write(Wrapped, concat_binary(lists:reverse(Buffer))), thrift_transport:close(Wrapped), - {reply, ok, State}. % TEST ONLY -%% {stop, normal, State}. + {reply, ok, State}. %%-------------------------------------------------------------------- %% Function: handle_cast(Msg, State) -> {noreply, State} | diff --git a/lib/alterl/src/thrift_processor.erl b/lib/alterl/src/thrift_processor.erl index 2038b564..c78dda34 100644 --- a/lib/alterl/src/thrift_processor.erl +++ b/lib/alterl/src/thrift_processor.erl @@ -25,7 +25,6 @@ init({Server, ProtoGen, Service, Handler}) when is_function(ProtoGen, 0) -> loop(State = #thrift_processor{in_protocol = IProto, out_protocol = OProto}) -> - error_logger:info_msg("loop: ~p", [State]), case thrift_protocol:read(IProto, message_begin) of #protocol_message_begin{name = Function, type = ?tMessageType_CALL} -> @@ -46,9 +45,7 @@ handle_function(State=#thrift_processor{in_protocol = IProto, {ok, Params} = thrift_protocol:read(IProto, InParams), try - error_logger:info_msg("calling: ~p(~p)", [Function, Params]), Result = Handler:handle_function(Function, Params), - error_logger:info_msg("result: ~p", [Result]), %% {Micro, Result} = better_timer(Handler, handle_function, [Function, Params]), %% error_logger:info_msg("Processed ~p(~p) in ~.4fms~n", %% [Function, Params, Micro/1000.0]), @@ -168,4 +165,6 @@ send_reply(OProto, Function, ReplyMessageType, Reply) -> ok. after_reply(OProto) -> - ok = thrift_protocol:close_transport(OProto). + ok = thrift_protocol:flush_transport(OProto) + %% ok = thrift_protocol:close_transport(OProto) + . diff --git a/lib/alterl/src/thrift_socket_transport.erl b/lib/alterl/src/thrift_socket_transport.erl index bd5ac716..d1e56135 100644 --- a/lib/alterl/src/thrift_socket_transport.erl +++ b/lib/alterl/src/thrift_socket_transport.erl @@ -21,7 +21,5 @@ flush(_) -> ok. close(#data{socket = Socket}) -> - error_logger:info_msg("Close called, socket ~p", [Socket]) -%% gen_tcp:close(Socket), -%% exit(normal) - . + gen_tcp:close(Socket), + exit(protocol_closed). -- 2.17.1