Changeset 68 for trunk/Components/CoolWeb/WebServer/UWebApp.pas
- Timestamp:
- Dec 26, 2011, 12:07:37 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Components/CoolWeb/WebServer/UWebApp.pas
r67 r68 7 7 uses 8 8 Classes, SysUtils, CustApp, SpecializedList, UWebPage, UHTTPSessionFile, 9 UHTTPServer , UHTTPServerCGI;9 UHTTPServer; 10 10 11 11 type 12 THTTPServerType = (stCGI, stTCP); 13 12 14 TRegistredPage = class 13 15 Name: string; … … 26 28 private 27 29 FOnInitialize: TNotifyEvent; 30 FServerType: THTTPServerType; 28 31 procedure DoRun; override; 29 32 function DumpExceptionCallStack(E: Exception): string; 30 33 procedure HTTPServerRequest(HandlerData: THTTPHandlerData); 34 procedure SetServerType(AValue: THTTPServerType); 31 35 public 32 36 Pages: TRegistredPageList; … … 39 43 destructor Destroy; override; 40 44 property OnInitialize: TNotifyEvent read FOnInitialize write FOnInitialize; 45 property ServerType: THTTPServerType read FServerType write SetServerType; 41 46 end; 42 47 … … 49 54 50 55 implementation 56 57 uses 58 UHTTPServerCGI, UHTTPServerTCP; 51 59 52 60 resourcestring … … 133 141 end else Response.Content.WriteString(SPageNotFound); 134 142 end; 143 end; 144 145 procedure TWebApp.SetServerType(AValue: THTTPServerType); 146 begin 147 if FServerType = AValue then Exit; 148 FServerType := AValue; 149 HTTPServer.Free; 150 case FServerType of 151 stCGI: HTTPServer := THTTPServerCGI.Create(nil); 152 stTCP: HTTPServer := THTTPServerTCP.Create(nil); 153 end; 154 HTTPServer.OnRequest := HTTPServerRequest; 135 155 end; 136 156
Note:
See TracChangeset
for help on using the changeset viewer.