Ignore:
Timestamp:
Feb 4, 2024, 3:53:52 PM (9 months ago)
Author:
chronos
Message:
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CoolWeb/WebServer/HTTPServer.pas

    r150 r151  
    1 unit UHTTPServer;
     1unit HTTPServer;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, Common, UMemoryStreamEx, UMIMEType, Synautil, Syncobjs,
     6  Classes, SysUtils, Common, MemoryStreamEx, MIMEType, Synautil, Syncobjs,
    77  Generics.Collections, Generics;
    88
     
    7777
    7878  TRequestHandlerList = class(TObjectList<TRequestHandler>)
    79     procedure Add(AName: string; AHandler: TRequestEvent);
     79    function AddNew(AName: string; AHandler: TRequestEvent): TRequestHandler;
    8080    function IndexOfName(AName: string): TRequestHandler;
    8181  end;
     
    279279{ TRequestHandlerList }
    280280
    281 procedure TRequestHandlerList.Add(AName: string; AHandler: TRequestEvent);
    282 begin
    283   with TRequestHandler(Items[inherited Add(TRequestHandler.Create)]) do begin
    284     Name := AName;
    285     Handler := AHandler;
    286   end;
     281function TRequestHandlerList.AddNew(AName: string; AHandler: TRequestEvent): TRequestHandler;
     282begin
     283  Result := TRequestHandler.Create;
     284  Result.Name := AName;
     285  Result.Handler := AHandler;
     286  Add(Result);
    287287end;
    288288
Note: See TracChangeset for help on using the changeset viewer.