You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2015/11/26 16:09:25 UTC

[1/2] thrift git commit: THRIFT-3087 Pass on errors like "connection closed" Client: Erlang Patch: Андрей Веселов and Nobuaki Sukegawa

Repository: thrift
Updated Branches:
  refs/heads/master e58ed1ad3 -> ef3cf819e


THRIFT-3087 Pass on errors like "connection closed"
Client: Erlang
Patch: Андрей Веселов and Nobuaki Sukegawa

This closes #599


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/54790993
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/54790993
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/54790993

Branch: refs/heads/master
Commit: 547909933c25cbf0b8d2c91958dbd2972320513a
Parents: e58ed1a
Author: Андрей Веселов <gi...@hotmail.com>
Authored: Wed Aug 26 17:52:19 2015 +0300
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Fri Nov 27 00:08:27 2015 +0900

----------------------------------------------------------------------
 lib/erl/src/thrift_client.erl | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/54790993/lib/erl/src/thrift_client.erl
----------------------------------------------------------------------
diff --git a/lib/erl/src/thrift_client.erl b/lib/erl/src/thrift_client.erl
index 7bf50a5..1a9cb50 100644
--- a/lib/erl/src/thrift_client.erl
+++ b/lib/erl/src/thrift_client.erl
@@ -63,7 +63,7 @@ close(#tclient{protocol=Protocol}) ->
 %%--------------------------------------------------------------------
 %%% Internal functions
 %%--------------------------------------------------------------------
--spec send_function_call(#tclient{}, atom(), list()) -> {sync | async | {error, any()}, #tclient{}}.
+-spec send_function_call(#tclient{}, atom(), list()) -> {ok | {error, any()}, #tclient{}}.
 send_function_call(Client = #tclient{service = Service}, Function, Args) ->
   {Params, Reply} = try
     {Service:function_info(Function, params_type), Service:function_info(Function, reply_type)}
@@ -82,17 +82,21 @@ send_function_call(Client = #tclient{service = Service}, Function, Args) ->
   end.
 
 -spec write_message(#tclient{}, atom(), list(), {struct, list()}, integer()) ->
-  {ok, #tclient{}}.
+  {ok | {error, any()}, #tclient{}}.
 write_message(Client = #tclient{protocol = P0, seqid = Seq}, Function, Args, Params, MsgType) ->
-  {P1, ok} = thrift_protocol:write(P0, #protocol_message_begin{
-    name = atom_to_list(Function),
-    type = MsgType,
-    seqid = Seq
-  }),
-  {P2, ok} = thrift_protocol:write(P1, {Params, list_to_tuple([Function|Args])}),
-  {P3, ok} = thrift_protocol:write(P2, message_end),
-  {P4, ok} = thrift_protocol:flush_transport(P3),
-  {ok, Client#tclient{protocol = P4}}.
+  try
+    {P1, ok} = thrift_protocol:write(P0, #protocol_message_begin{
+      name = atom_to_list(Function),
+      type = MsgType,
+      seqid = Seq
+    }),
+    {P2, ok} = thrift_protocol:write(P1, {Params, list_to_tuple([Function|Args])}),
+    {P3, ok} = thrift_protocol:write(P2, message_end),
+    {P4, ok} = thrift_protocol:flush_transport(P3),
+    {ok, Client#tclient{protocol = P4}}
+  catch
+    error:{badmatch, {_, {error, _} = Error}} -> {Error, Client}
+  end.
 
 -spec receive_function_result(#tclient{}, atom()) -> {#tclient{}, {ok, any()} | {error, any()}}.
 receive_function_result(Client = #tclient{service = Service}, Function) ->


[2/2] thrift git commit: THRIFT-3443 Thrift include can generate uncompilable code Client: Go Compiler Patch: Nobuaki Sukegawa

Posted by ns...@apache.org.
THRIFT-3443 Thrift include can generate uncompilable code
Client: Go Compiler
Patch: Nobuaki Sukegawa

This closes #709


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/ef3cf819
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/ef3cf819
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/ef3cf819

Branch: refs/heads/master
Commit: ef3cf819e120cc46ef8e1b35baa07eae3a39126a
Parents: 5479099
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Mon Nov 23 19:20:44 2015 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Fri Nov 27 00:08:41 2015 +0900

----------------------------------------------------------------------
 compiler/cpp/src/generate/t_go_generator.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/ef3cf819/compiler/cpp/src/generate/t_go_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/generate/t_go_generator.cc b/compiler/cpp/src/generate/t_go_generator.cc
index b198d48..cd03359 100644
--- a/compiler/cpp/src/generate/t_go_generator.cc
+++ b/compiler/cpp/src/generate/t_go_generator.cc
@@ -782,7 +782,7 @@ string t_go_generator::render_included_programs() {
       }
     }
 
-    result += "\t\"" + gen_package_prefix_ + go_module + "\"\n";
+    result += "\t_ \"" + gen_package_prefix_ + go_module + "\"\n";
   }
 
   return result;