summaryrefslogtreecommitdiff
path: root/lib/delphi
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2019-11-27 22:18:12 +0100
committerJens Geyer <jensg@apache.org>2019-11-27 22:24:12 +0100
commitc140bb90b0c2ed6175afe8c9c579acd8ea9c7d0b (patch)
tree11c70c806aedc559adea063e06dd4e925ec36f28 /lib/delphi
parentbf2cad9cfae28b602b5bb899e9becacee975057c (diff)
downloadthrift-c140bb90b0c2ed6175afe8c9c579acd8ea9c7d0b.tar.gz
THRIFT-5036 buffered transport over sockets may run into unexpected timeouts [ci skip]
Client: Delphi Patch: Jens Geyer
Diffstat (limited to 'lib/delphi')
-rw-r--r--lib/delphi/src/Thrift.Server.pas9
-rw-r--r--lib/delphi/src/Thrift.Transport.pas2
-rw-r--r--lib/delphi/test/TestServer.pas6
3 files changed, 6 insertions, 11 deletions
diff --git a/lib/delphi/src/Thrift.Server.pas b/lib/delphi/src/Thrift.Server.pas
index 654ab9942..da053b96b 100644
--- a/lib/delphi/src/Thrift.Server.pas
+++ b/lib/delphi/src/Thrift.Server.pas
@@ -390,20 +390,17 @@ begin
end;
except
- on E: TTransportException do
- begin
+ on E: TTransportException do begin
if FStop
then FLogDelegate('TSimpleServer was shutting down, caught ' + E.ToString)
else FLogDelegate( E.ToString);
end;
- on E: Exception do
- begin
+ on E: Exception do begin
FLogDelegate( E.ToString);
end;
end;
- if context <> nil
- then begin
+ if context <> nil then begin
context.CleanupContext;
context := nil;
end;
diff --git a/lib/delphi/src/Thrift.Transport.pas b/lib/delphi/src/Thrift.Transport.pas
index 7695b22da..0a9a39e04 100644
--- a/lib/delphi/src/Thrift.Transport.pas
+++ b/lib/delphi/src/Thrift.Transport.pas
@@ -1628,7 +1628,7 @@ begin
result := 0;
pTmp := pBuf;
Inc( pTmp, offset);
- while count > 0 do begin
+ while (count > 0) and (result = 0) do begin
while TRUE do begin
wfd := WaitForData( msecs, pTmp, count, wsaError, nBytes);
diff --git a/lib/delphi/test/TestServer.pas b/lib/delphi/test/TestServer.pas
index a9c71fb83..da804fdc0 100644
--- a/lib/delphi/test/TestServer.pas
+++ b/lib/delphi/test/TestServer.pas
@@ -157,13 +157,11 @@ end;
procedure TTestServer.TTestHandlerImpl.testException(const arg: string);
begin
Console.WriteLine('testException(' + arg + ')');
- if ( arg = 'Xception') then
- begin
+ if ( arg = 'Xception') then begin
raise TXception.Create( 1001, arg);
end;
- if (arg = 'TException') then
- begin
+ if (arg = 'TException') then begin
raise TException.Create('TException');
end;