Rollback a few recent Erlang changes to fix blame data
My combined patch for THRIFT-599 was committed, but it is preferable
commit the individual patches to preserve the more detailed log and
blame data. I'll recommit r987018 as a sequence of patches and r988722
as its own rev.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990957 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/erl/src/test_server.erl b/test/erl/src/test_server.erl
index 28d47b1..cd439cc 100644
--- a/test/erl/src/test_server.erl
+++ b/test/erl/src/test_server.erl
@@ -19,42 +19,12 @@
-module(test_server).
--export([go/0, go/1, start_link/2, handle_function/2]).
+-export([start_link/1, handle_function/2]).
-include("thriftTest_types.hrl").
--record(options, {port = 9090,
- server_opts = []}).
-
-parse_args(Args) -> parse_args(Args, #options{}).
-parse_args([], Opts) -> Opts;
-parse_args([Head | Rest], Opts) ->
- NewOpts =
- case catch list_to_integer(Head) of
- Port when is_integer(Port) ->
- Opts#options{port = Port};
- _Else ->
- case Head of
- "framed" ->
- Opts#options{server_opts = [{framed, true} | Opts#options.server_opts]};
- "" ->
- Opts;
- _Else ->
- erlang:error({bad_arg, Head})
- end
- end,
- parse_args(Rest, NewOpts).
-
-go() -> go([]).
-go(Args) ->
- #options{port = Port, server_opts = ServerOpts} = parse_args(Args),
- spawn(fun() -> start_link(Port, ServerOpts), receive after infinity -> ok end end).
-
-start_link(Port, ServerOpts) ->
- thrift_socket_server:start([{handler, ?MODULE},
- {service, thriftTest_thrift},
- {port, Port}] ++
- ServerOpts).
+start_link(Port) ->
+ thrift_server:start_link(Port, thriftTest_thrift, ?MODULE).
handle_function(testVoid, {}) ->
@@ -154,12 +124,12 @@
{?thriftTest_THREE, Crazy}]),
SecondMap = dict:from_list([{?thriftTest_SIX, Looney}]),
-
+
Insane = dict:from_list([{1, FirstMap},
{2, SecondMap}]),
-
+
io:format("Return = ~p~n", [Insane]),
-
+
{reply, Insane};
handle_function(testMulti, Args = {Arg0, Arg1, Arg2, _Arg3, Arg4, Arg5})
@@ -180,7 +150,7 @@
case String of
<<"Xception">> ->
throw(#xception{errorCode = 1001,
- message = String});
+ message = <<"This is an Xception">>});
_ ->
ok
end;