Updated Branches: refs/heads/master 836d95f9f -> 26ef743d2
THRIFT-2202 Delphi TServerImpl.DefaultLogDelegate may stop the server with I/O-Error 105 Patch: Jens Geyer Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/26ef743d Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/26ef743d Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/26ef743d Branch: refs/heads/master Commit: 26ef743d2fb9da250bee385cac0bef09a5f09b77 Parents: 836d95f Author: Jens Geyer <[email protected]> Authored: Mon Sep 23 22:01:20 2013 +0200 Committer: Jens Geyer <[email protected]> Committed: Mon Sep 23 22:02:17 2013 +0200 ---------------------------------------------------------------------- lib/delphi/src/Thrift.Server.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/26ef743d/lib/delphi/src/Thrift.Server.pas ---------------------------------------------------------------------- diff --git a/lib/delphi/src/Thrift.Server.pas b/lib/delphi/src/Thrift.Server.pas index 7d39f6b..6d3ff38 100644 --- a/lib/delphi/src/Thrift.Server.pas +++ b/lib/delphi/src/Thrift.Server.pas @@ -19,10 +19,12 @@ unit Thrift.Server; +{$I-} // prevent annoying errors with default log delegate and no console + interface uses - SysUtils, + Windows, SysUtils, Thrift, Thrift.Protocol, Thrift.Transport; @@ -188,7 +190,12 @@ end; class procedure TServerImpl.DefaultLogDelegate( const str: string); begin - Writeln( str ); + try + Writeln( str); + if IoResult <> 0 then OutputDebugString(PChar(str)); + except + OutputDebugString(PChar(str)); + end; end; constructor TServerImpl.Create( const AProcessor: IProcessor;
