You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2021/07/01 22:39:16 UTC

[thrift] branch master updated: THRIFT-5438 Inconsistent handling of exceptions during message read vs. message write phase Client: Delphi Patch: Jens Geyer

This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 4434ee9  THRIFT-5438 Inconsistent handling of exceptions during message read vs. message write phase Client: Delphi Patch: Jens Geyer
4434ee9 is described below

commit 4434ee92d5141578cecac95ee53e3563101b9ecd
Author: Jens Geyer <je...@apache.org>
AuthorDate: Thu Jul 1 23:38:52 2021 +0200

    THRIFT-5438 Inconsistent handling of exceptions during message read vs. message write phase
    Client: Delphi
    Patch: Jens Geyer
---
 compiler/cpp/src/thrift/generate/t_delphi_generator.cc | 14 +++++++-------
 lib/delphi/test/TestClient.pas                         |  1 -
 lib/delphi/test/client.dproj                           |  4 +---
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/compiler/cpp/src/thrift/generate/t_delphi_generator.cc b/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
index eac46a6..8383cea 100644
--- a/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
@@ -2534,6 +2534,13 @@ void t_delphi_generator::generate_process_function(t_service* tservice, t_functi
   indent_impl(s_service_impl) << "begin" << endl;
   indent_up_impl();
 
+  if (!tfunction->is_oneway()) {
+    indent_impl(s_service_impl) << "ret := " << result_clsnm << "Impl.Create;" << endl;
+  }
+
+  indent_impl(s_service_impl) << "try" << endl;
+  indent_up_impl();
+
   if (events_) {
     indent_impl(s_service_impl) << "if events <> nil then events.PreRead;" << endl;
   }
@@ -2548,13 +2555,6 @@ void t_delphi_generator::generate_process_function(t_service* tservice, t_functi
   const std::vector<t_field*>& xceptions = xs->get_members();
   vector<t_field*>::const_iterator x_iter;
 
-  if (!tfunction->is_oneway()) {
-    indent_impl(s_service_impl) << "ret := " << result_clsnm << "Impl.Create;" << endl;
-  }
-
-  indent_impl(s_service_impl) << "try" << endl;
-  indent_up_impl();
-
   t_struct* arg_struct = tfunction->get_arglist();
   const std::vector<t_field*>& fields = arg_struct->get_members();
   vector<t_field*>::const_iterator f_iter;
diff --git a/lib/delphi/test/TestClient.pas b/lib/delphi/test/TestClient.pas
index c8d3fc2..df0b4c5 100644
--- a/lib/delphi/test/TestClient.pas
+++ b/lib/delphi/test/TestClient.pas
@@ -53,7 +53,6 @@ uses
   Thrift.Test,
   Thrift.WinHTTP,
   Thrift.Utils,
-
   Thrift.Configuration,
   Thrift.Collections;
 
diff --git a/lib/delphi/test/client.dproj b/lib/delphi/test/client.dproj
index 8df93a0..c57424d 100644
--- a/lib/delphi/test/client.dproj
+++ b/lib/delphi/test/client.dproj
@@ -142,9 +142,7 @@
 						<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
 						<VersionInfoKeys Name="Comments"/>
 					</VersionInfoKeys>
-					<Parameters>
-						<Parameters Name="RunParams"> --transport=framed --transport=winhttp --host=example.org --port=80</Parameters>
-					</Parameters>
+					<Parameters/>
 				</Delphi.Personality>
 				<Platforms>
 					<Platform value="Win32">True</Platform>