TIdCustomHTTPServer.DoExecute

Giganews Newsgroups
Subject: TIdCustomHTTPServer.DoExecute
Posted by:  Christian Gorski (no.spam@no.spam.com)
Date: Thu, 19 Mar 2009

function TIdCustomHTTPServer.DoExecute(AContext:TIdContext): boolean;

....

if LRequestInfo.ContentLength > 0 then begin
  IOHandler.ReadStream(LRequestInfo.PostStr...);
end else if LRequestInfo.CommandType = hcPOST then begin
  if not LRequestInfo.HasContentLength then begin
    IOHandler.ReadStream(LRequestInfo.PostStream, -1, True);
  end;
end;

....

end;

Why do we read a stream in case of POST without forcing the client to
tell us the content-length?

Replies