Changeset 139 for trunk/Packages
- Timestamp:
- Sep 9, 2022, 9:41:42 PM (2 years ago)
- Location:
- trunk/Packages
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UFormAbout.pas
r137 r139 20 20 PanelButtons: TPanel; 21 21 procedure ButtonHomePageClick(Sender: TObject); 22 procedure FormCreate(Sender: TObject);23 22 procedure FormShow(Sender: TObject); 24 private25 { private declarations }26 23 public 27 24 AboutDialog: TObject; //TAboutDialog … … 77 74 end; 78 75 79 procedure TFormAbout.FormCreate(Sender: TObject);80 begin81 end;82 83 76 end. 84 77 -
trunk/Packages/Common/UGenerics.pas
r138 r139 43 43 for I := 0 to Count - 1 do begin 44 44 Result := Result + Items[I]; 45 if I > 0then Result := Result + Separator;45 if I < Count - 1 then Result := Result + Separator; 46 46 end; 47 47 end; -
trunk/Packages/CoolWeb/WebServer/UHTTPServer.pas
r138 r139 43 43 44 44 THTTPResponse = class 45 StatusCode: string; 45 46 ContentType: string; 46 47 Content: TMemoryStreamEx; … … 123 124 SPageNotFound = 'Page %s not found.'; 124 125 126 const 127 StatusCodeNotFound = '404 Not Found'; 128 125 129 126 130 implementation … … 134 138 begin 135 139 with HandlerData, Response.Content do begin 136 //Response.Cookies.Values['Test'] := 'Halo';137 //Response.Cookies.Values['Test2'] := 'Halo2';138 139 //HTTPServer.SessionHandler.Variables.Values['Session1'] := 'Value1';140 //HTTPServer.SessionHandler.Variables.Values['Session2'] := 'Value2';141 142 140 WriteString('<a href="?ServerInfo">Refresh</a>'); 143 141 … … 192 190 begin 193 191 with HandlerData, Response.Content do begin 192 Response.StatusCode := StatusCodeNotFound; 194 193 WriteString('<html><body>' + Format(SPageNotFound, [Implode('/', Request.Path)]) + '</body></html>'); 195 194 end; … … 224 223 end else 225 224 with Response.Content do begin 226 //WriteLn(Format(SFileNotFound, [Request.Path.Implode('/', StrToStr)]));225 Response.StatusCode := StatusCodeNotFound; 227 226 WriteString('<html><body>' + Format(SFileNotFound, [Implode('/', Request.Path)]) + '</body></html>'); 228 227 end; … … 248 247 procedure THTTPResponse.Assign(Source: THTTPResponse); 249 248 begin 249 StatusCode := Source.StatusCode; 250 250 Content.Assign(Source.Content); 251 251 ContentType := Source.ContentType; … … 263 263 constructor THTTPResponse.Create; 264 264 begin 265 StatusCode := '200 OK'; 265 266 Content := TMemoryStreamEx.Create; 266 267 Cookies := TCookieList.Create; … … 291 292 begin 292 293 I := 0; 293 while (I < Count) and (TRequestHandler(Items[I]).Name <> AName) do Inc(I); 294 if I < Count then Result := TRequestHandler(Items[I]) else Result := nil; 294 while (I < Count) and (Items[I].Name <> AName) do Inc(I); 295 if I < Count then Result := Items[I] 296 else Result := nil; 295 297 end; 296 298 -
trunk/Packages/CoolWeb/WebServer/UHTTPServerTCP.pas
r138 r139 117 117 118 118 with Response do begin 119 SendString('HTTP/1.0 200 OK'#13#10);119 SendString('HTTP/1.0 ' + StatusCode + #13#10); 120 120 Headers.Add('Content-Length', IntToStr(Content.Size)); 121 121 Headers.Add('Connection', 'close'); -
trunk/Packages/CoolWeb/WebServer/UTurboPowerForm.pas
r137 r139 24 24 procedure AShowSourceExecute(Sender: TObject); 25 25 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 26 private27 { private declarations }28 26 public 29 27 HtmlSource: string; -
trunk/Packages/PersistentData/Demo/UFormMain.pas
r137 r139 20 20 procedure ComboBox1Change(Sender: TObject); 21 21 procedure FormShow(Sender: TObject); 22 private23 { private declarations }24 22 public 25 23 Client: TPDClient;
Note:
See TracChangeset
for help on using the changeset viewer.