Changeset 96 for trunk/Packages/CoolWeb
- Timestamp:
- Oct 2, 2012, 9:22:02 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 5 5 backup 6 6 ZdechovNET.lps 7 heaptrclog.trc
-
- Property svn:ignore
-
trunk/Packages/CoolWeb/CoolWeb.lpk
r84 r96 9 9 <SearchPaths> 10 10 <IncludeFiles Value="WebServer"/> 11 <OtherUnitFiles Value="WebServer;Persistence;Network;Modules;Common;/usr/lib/mysql /;/usr/lib64/mysql/"/>11 <OtherUnitFiles Value="WebServer;Persistence;Network;Modules;Common;/usr/lib/mysql;/usr/lib64/mysql"/> 12 12 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 13 13 </SearchPaths> … … 145 145 <Version Value="2"/> 146 146 </PublishOptions> 147 <CustomOptions Items="ExternHelp" Version="2"> 148 <_ExternHelp Items="Count"/> 149 </CustomOptions> 147 150 </Package> 148 151 </CONFIG> -
trunk/Packages/CoolWeb/Network/UTCPServer.pas
r84 r96 21 21 22 22 TTCPClientThread = class(TResetableThread) 23 Id: Integer; 23 24 Parent: TTCPServer; 24 25 Socket: TTCPBlockSocket; … … 55 56 FActive: Boolean; 56 57 AcceptThread: TAcceptThread; 58 NewId: Integer; 57 59 procedure SetActive(const AValue: Boolean); 58 60 public … … 94 96 AcceptThread.Terminate; 95 97 AcceptThread.WaitFor; 96 AcceptThread.Destroy;98 FreeAndNil(AcceptThread); 97 99 ThreadPool.Active := False; 98 100 CloseSocket; … … 115 117 destructor TTCPServer.Destroy; 116 118 begin 117 ThreadPool.Destroy;118 119 Active := False; 119 Socket.Destroy; 120 inherited Destroy; 120 FreeAndNil(ThreadPool); 121 FreeAndNil(Socket); 122 inherited; 121 123 end; 122 124 … … 136 138 NewObject.Socket.Socket := NewSocket; 137 139 NewObject.Start; 140 NewObject.Id := Parent.NewId; 141 Inc(Parent.NewId); 138 142 end; 139 143 end; … … 160 164 destructor TTCPClientThread.Destroy; 161 165 begin 162 Socket.Destroy;166 FreeAndNil(Socket); 163 167 inherited; 164 168 end; -
trunk/Packages/CoolWeb/WebServer/UHTTPServer.pas
r84 r96 7 7 uses 8 8 Classes, SysUtils, UTCPServer, UCommon, UMemoryStreamEx, UMIMEType, 9 Synautil, SpecializedList, SpecializedDictionary ;9 Synautil, SpecializedList, SpecializedDictionary, Syncobjs; 10 10 11 11 type … … 102 102 procedure SetShowExceptions(const AValue: Boolean); 103 103 public 104 Lock: TCriticalSection; 104 105 procedure Run; virtual; 105 106 procedure ErrorResponse(HandlerData: THTTPHandlerData); … … 228 229 begin 229 230 inherited; 231 Lock := TCriticalSection.Create; 230 232 ShowExceptions := False; 231 233 DocumentRoot := './'; … … 234 236 destructor THTTPServer.Destroy; 235 237 begin 236 inherited Destroy; 238 FreeAndNil(Lock); 239 inherited; 237 240 end; 238 241 -
trunk/Packages/CoolWeb/WebServer/UHTTPServerTCP.pas
r84 r96 44 44 begin 45 45 with TTCPClientThread(Sender), Socket do begin 46 WriteLn(' Used thrads' + IntToStr(Parent.ThreadPool.UsedCount) + '. Client connected from ' + GetRemoteSinIP);46 WriteLn('Thread ' + IntToStr(Id) + ' from ' + IntToStr(Parent.ThreadPool.UsedCount) + '. Client connected from ' + GetRemoteSinIP); 47 47 48 48 HandlerData := THTTPHandlerData.Create; … … 58 58 repeat 59 59 Line := RecvString(10000); 60 WriteLn(IntToStr(Id) + ' ' + Line); 60 61 if (LineIndex = 0) then begin 61 62 LineParts.Explode(Line, ' ', StrToStr); … … 115 116 // Send headers 116 117 for I := 0 to Headers.Count - 1 do begin 117 WriteLn(Headers.Keys[I] + ': ' + Headers.Items[I].Value + #13#10);118 //WriteLn(Headers.Keys[I] + ': ' + Headers.Items[I].Value + #13#10); 118 119 SendString(Headers.Keys[I] + ': ' + Headers.Items[I].Value + #13#10); 119 120 end; -
trunk/Packages/CoolWeb/WebServer/UWebApp.pas
r91 r96 12 12 THTTPServerType = (stCGI, stTCP, stTurboPower); 13 13 14 { TRegistredPage } 15 14 16 TRegistredPage = class 15 17 Name: string; 16 18 Page: TWebPage; 19 destructor Destroy; override; 17 20 end; 18 21 … … 65 68 end; 66 69 70 { TRegistredPage } 71 72 destructor TRegistredPage.Destroy; 73 begin 74 if Assigned(Page) then FreeAndNil(Page); 75 end; 76 67 77 68 78 { TPageList }
Note:
See TracChangeset
for help on using the changeset viewer.