From: Jens Geyer Date: Mon, 23 Sep 2013 20:01:20 +0000 (+0200) Subject: THRIFT-2202 Delphi TServerImpl.DefaultLogDelegate may stop the server with I/O-Error 105 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=26ef743d2fb9da250bee385cac0bef09a5f09b77;p=common%2Fthrift.git THRIFT-2202 Delphi TServerImpl.DefaultLogDelegate may stop the server with I/O-Error 105 Patch: Jens Geyer --- diff --git a/lib/delphi/src/Thrift.Server.pas b/lib/delphi/src/Thrift.Server.pas index 7d39f6bd..6d3ff385 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;