Changeset 130 for trunk/Packages/CoolWeb/WebServer/UHTTPServer.pas
- Timestamp:
- Mar 18, 2022, 1:32:32 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CoolWeb/WebServer/UHTTPServer.pas
r123 r130 6 6 7 7 uses 8 Classes, SysUtils, U TCPServer, UCommon, UMemoryStreamEx, UMIMEType,8 Classes, SysUtils, UCommon, UMemoryStreamEx, UMIMEType, 9 9 Synautil, SpecializedList, SpecializedDictionary, Syncobjs; 10 10 … … 120 120 procedure HTTPExceptionHide(Obj: TObject; Addr: Pointer; FrameCount: Longint; Frames: PPointer); 121 121 122 123 122 resourcestring 124 123 SEmptyHTTPHandler = 'No handler defined for HTTP server.'; 125 124 SFileNotFound = 'File %s not found.'; 126 125 SPageNotFound = 'Page %s not found.'; 126 127 127 128 128 implementation … … 212 212 procedure THTTPServer.Run; 213 213 begin 214 215 214 end; 216 215 … … 278 277 destructor THTTPResponse.Destroy; 279 278 begin 280 Content.Free;281 Headers.Free;282 Cookies.Free;283 inherited Destroy;279 FreeAndNil(Content); 280 FreeAndNil(Headers); 281 FreeAndNil(Cookies); 282 inherited; 284 283 end; 285 284 … … 339 338 destructor THTTPRequest.Destroy; 340 339 begin 341 Content.Free;342 Post.Free;343 Query.Free;344 Path.Free;345 Headers.Free;346 Cookies.Free;347 inherited Destroy;340 FreeAndNil(Content); 341 FreeAndNil(Post); 342 FreeAndNil(Query); 343 FreeAndNil(Path); 344 FreeAndNil(Headers); 345 FreeAndNil(Cookies); 346 inherited; 348 347 end; 349 348 … … 366 365 Add(Pair[0], Pair[1]); 367 366 end; 368 369 367 finally 370 368 Parts.Free; … … 436 434 destructor THTTPSessionStorage.Destroy; 437 435 begin 438 inherited Destroy;436 inherited; 439 437 end; 440 438 … … 470 468 var 471 469 Message: string; 472 i: LongInt;470 I: LongInt; 473 471 hstdout: ^Text; 474 472 begin … … 483 481 end 484 482 else 485 Write ln(hstdout^, 'Exception object ', Obj.ClassName, ' is not of class Exception.<br/>');486 Write ln(hstdout^, BackTraceStrFunc(Addr) + '<br/>');483 WriteLn(hstdout^, 'Exception object ', Obj.ClassName, ' is not of class Exception.<br/>'); 484 WriteLn(hstdout^, BackTraceStrFunc(Addr) + '<br/>'); 487 485 if (FrameCount > 0) then 488 486 begin 489 for i:= 0 to FrameCount - 1 do487 for I := 0 to FrameCount - 1 do 490 488 if I < Length(TArrayOfPointer(Frames)) then 491 Write ln(hstdout^, BackTraceStrFunc(TArrayOfPointer(Frames)[i]) + '<br/>');492 end; 493 Write ln(hstdout^, '');489 WriteLn(hstdout^, BackTraceStrFunc(TArrayOfPointer(Frames)[I]) + '<br/>'); 490 end; 491 WriteLn(hstdout^, ''); 494 492 end; 495 493 … … 499 497 var 500 498 Message: string; 501 i: LongInt;499 I: LongInt; 502 500 hstdout: ^Text; 503 501 hstderr: ^Text; … … 508 506 WriteLn(hstdout^); 509 507 WriteLn(hstdout^, 'Error occured during page generation.'); 510 Write ln(hstderr^, 'An unhandled exception occurred at $', HexStr(PtrUInt(Addr), SizeOf(PtrUInt) * 2), ' :');508 WriteLn(hstderr^, 'An unhandled exception occurred at $', HexStr(PtrUInt(Addr), SizeOf(PtrUInt) * 2), ' :'); 511 509 if Obj is exception then 512 510 begin 513 511 Message := Exception(Obj).ClassName + ' : ' + Exception(Obj).Message; 514 Write ln(hstderr^, Message);512 WriteLn(hstderr^, Message); 515 513 end 516 514 else 517 Write ln(hstderr^, 'Exception object ', Obj.ClassName, ' is not of class Exception.');518 Write ln(hstderr^, BackTraceStrFunc(Addr));515 WriteLn(hstderr^, 'Exception object ', Obj.ClassName, ' is not of class Exception.'); 516 WriteLn(hstderr^, BackTraceStrFunc(Addr)); 519 517 if (FrameCount > 0) then 520 518 begin 521 for i:= 0 to FrameCount - 1 do519 for I := 0 to FrameCount - 1 do 522 520 if I < Length(TArrayOfPointer(Frames)) then 523 Write ln(hstderr^, BackTraceStrFunc(TArrayOfPointer(Frames)[i]));524 end; 525 Write ln(hstderr^, '');521 WriteLn(hstderr^, BackTraceStrFunc(TArrayOfPointer(Frames)[I])); 522 end; 523 WriteLn(hstderr^, ''); 526 524 end; 527 525
Note:
See TracChangeset
for help on using the changeset viewer.