Changeset 237 for Network/CoolWeb/WebServer/UHTTPServer.pas
- Timestamp:
- Apr 30, 2011, 10:54:24 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Network/CoolWeb/WebServer/UHTTPServer.pas
r104 r237 77 77 { THTTPSessionStorage } 78 78 79 THTTPSessionStorage = class 79 THTTPSessionStorage = class(TComponent) 80 80 procedure Load(HandlerData: THTTPHandlerData); virtual; 81 81 procedure Save(HandlerData: THTTPHandlerData); virtual; 82 constructor Create ; virtual;82 constructor Create(AOwner: TComponent); override; 83 83 destructor Destroy; override; 84 84 end; … … 86 86 { THTTPServer } 87 87 88 THTTPServer = class 88 THTTPServer = class(TComponent) 89 89 private 90 FDocumentRoot: string; 90 91 FOnRequest: TRequestEvent; 92 FSessionStorage: THTTPSessionStorage; 91 93 FShowExceptions: Boolean; 92 94 procedure SetShowExceptions(const AValue: Boolean); 93 95 public 94 Name: string;95 DocumentRoot: string;96 SessionStorage: THTTPSessionStorage;97 ShowExceptions: Boolean;98 96 procedure Run; virtual; 99 97 procedure ErrorResponse(HandlerData: THTTPHandlerData); 100 98 procedure FileResponse(HandlerData: THTTPHandlerData); 101 99 procedure ServerInfo(HandlerData: THTTPHandlerData); virtual; 102 constructor Create ;100 constructor Create(AOwner: TComponent); override; 103 101 destructor Destroy; override; 102 published 103 property ShowExceptions: Boolean read FShowExceptions write SetShowExceptions; 104 property DocumentRoot: string read FDocumentRoot write FDocumentRoot; 105 property SessionStorage: THTTPSessionStorage read FSessionStorage 106 write FSessionStorage; 104 107 property OnRequest: TRequestEvent read FOnRequest write FOnRequest; 105 property ShowExceptions: Boolean read FShowExceptions write SetShowExceptions;106 108 end; 107 109 … … 200 202 end; 201 203 202 constructor THTTPServer.Create; 203 begin 204 constructor THTTPServer.Create(AOwner: TComponent); 205 begin 206 inherited; 204 207 ShowExceptions := False; 205 208 DocumentRoot := './'; 206 Name := 'THTTPServer';207 209 end; 208 210 209 211 destructor THTTPServer.Destroy; 210 212 begin 211 SessionStorage.Free;212 213 inherited Destroy; 213 214 end; … … 351 352 constructor THTTPSessionStorage.Create; 352 353 begin 353 354 inherited; 354 355 end; 355 356
Note:
See TracChangeset
for help on using the changeset viewer.