diff options
author | Jens Geyer <jensg@apache.org> | 2013-09-23 22:01:20 +0200 |
---|---|---|
committer | Jens Geyer <jensg@apache.org> | 2013-09-23 22:02:17 +0200 |
commit | 26ef743d2fb9da250bee385cac0bef09a5f09b77 (patch) | |
tree | 916f77b4ff27f3f10fc352204cecb3e034fac6df /lib/delphi | |
parent | 836d95f9f00be73c6936d407977796181d1a506c (diff) | |
download | thrift-26ef743d2fb9da250bee385cac0bef09a5f09b77.tar.gz |
THRIFT-2202 Delphi TServerImpl.DefaultLogDelegate may stop the server with I/O-Error 105
Patch: Jens Geyer
Diffstat (limited to 'lib/delphi')
-rw-r--r-- | lib/delphi/src/Thrift.Server.pas | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/delphi/src/Thrift.Server.pas b/lib/delphi/src/Thrift.Server.pas index 7d39f6bd3..6d3ff3855 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; |