Indy10 bug with Pipelining?

Giganews Newsgroups
Subject: Indy10 bug with Pipelining?
Posted by:  nd (no@spam.com)
Date: Tue, 10 May 2005

Hello,

I'm struggling somewhat to stabilize my tidSMTPserver (D6, Indy 10.0.52)...
see my earlier postings.
After implementing  my other  workarounds things still wasn't stable. A few
emails, when received, still simply terminated the SMTP dialog with the
sender. After some creative debugging I was able to get out a stack dump,
finding the cause of this:

In TidSMTPserver.CommandDATA:
(snip)
    if LS.HELO or LS.EHLO then
    begin
      SetEnhReply(ASender.Reply,354, '',RSSMTPSvrStartData,(ASender.Context
as TIdSMTPServerContext).EHLO);
      ASender.SendReply;
      LS.PipeLining := False; //This call sometimes throws an exception
(snip)

Drilling further down to find the cause,

procedure TIdSMTPServerContext.SetPipeLining(const AValue: Boolean);
(snip)
      Connection.IOHandler.WriteBufferClose;  // Exception here
(snip)

Drilling further:

procedure TIdIOHandler.WriteBufferClose;
begin
  try
    WriteBufferFlush; //exception here, thown inside the TidIOhandler :
"read of address 0020"
(snip)

So, it seems there are a bug somwhere in the pipelining or IOhandler code. I
was unable to determine the exact nature of the problem, but it happens
quite often when the server is deployed for "real work" on the internet.
Wonder why can't I find any postings about this? Am I totally wrong here?

** How to Fix: (no guarantees)

In TidSMTPserver.EHLO:
(snip)
//  LS.Text.Add('PIPELINING'); {do not localize}  //REMark out this line -
don't advertize pipelining

And:

procedure TIdSMTPServerContext.SetPipeLining(const AValue: Boolean);
begin
  exit;  // Add this line - Ensure never to turn on pipelining

Replies