Changeset 96
- Timestamp:
- Oct 2, 2012, 9:22:02 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 12 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/Modules/User/UModuleUser.pas
r94 r96 84 84 Data.Add('FullName', 'Anonymous'); 85 85 Data.Add('RegistrationTime', 'NOW()'); 86 Data.Add('Password', ''); 87 Data.Add('Salt', ''); 88 Data.Add('Email', ''); 86 89 Core.CommonDatabase.Insert('User', Data); 87 90 -
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 } -
trunk/Packages/TemplateGenerics/Generic/GenericListObject.inc
r90 r96 108 108 begin 109 109 Clear; 110 inherited Destroy;110 inherited; 111 111 end; 112 112 -
trunk/UCore.lfm
r89 r96 2 2 OldCreateOrder = False 3 3 Height = 278 4 HorizontalOffset = 6545 VerticalOffset = 2034 HorizontalOffset = 341 5 VerticalOffset = 187 6 6 Width = 431 7 7 object WebApp1: TWebApp 8 8 OnPageProduce = WebApp1PageProduce 9 ServerType = st CGI9 ServerType = stTCP 10 10 left = 160 11 11 top = 88 -
trunk/UCore.lrs
r89 r96 3 3 LazarusResources.Add('TCore','FORMDATA',[ 4 4 'TPF0'#5'TCore'#4'Core'#14'OldCreateOrder'#8#6'Height'#3#22#1#16'HorizontalOf' 5 +'fset'#3 #142#2#14'VerticalOffset'#3#203#0#5'Width'#3#175#1#0#7'TWebApp'#7'We'6 +' bApp1'#13'OnPageProduce'#7#18'WebApp1PageProduce'#10'ServerType'#7#5'stCGI'7 + #4'left'#3#160#0#3'top'#2'X'#0#0#16'TApplicationInfo'#16'ApplicationInfo1'#145 +'fset'#3'U'#1#14'VerticalOffset'#3#187#0#5'Width'#3#175#1#0#7'TWebApp'#7'Web' 6 +'App1'#13'OnPageProduce'#7#18'WebApp1PageProduce'#10'ServerType'#7#5'stTCP'#4 7 +'left'#3#160#0#3'top'#2'X'#0#0#16'TApplicationInfo'#16'ApplicationInfo1'#14 8 8 +'Identification'#2#1#12'VersionMajor'#2#1#12'VersionMinor'#2#0#13'VersionBug' 9 9 +'Fix'#2#0#11'CompanyName'#6#11'Zd'#196#155'chovNET'#15'CompanyHomePage'#6#23 -
trunk/ZdechovNET.lpi
r92 r96 24 24 <Macro1 Name="LCLWidgetType" Value="nogui"/> 25 25 </MacroValues> 26 <BuildModes Count="1"> 27 <Item1 Name="default" Default="True"/> 26 <BuildModes Count="2"> 27 <Item1 Name="Release" Default="True"/> 28 <Item2 Name="Debug"> 29 <MacroValues Count="1"> 30 <Macro1 Name="LCLWidgetType" Value="nogui"/> 31 </MacroValues> 32 <CompilerOptions> 33 <Version Value="11"/> 34 <Target> 35 <Filename Value="index.cgi"/> 36 </Target> 37 <SearchPaths> 38 <OtherUnitFiles Value="/usr/lib/mysql;/usr/lib64/mysql;Application;WebServer;Network;Pages;Modules/User;Common;Modules/System;Modules/ZdechovNET"/> 39 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 40 </SearchPaths> 41 <Parsing> 42 <SyntaxOptions> 43 <SyntaxMode Value="Delphi"/> 44 <CStyleOperator Value="False"/> 45 <AllowLabel Value="False"/> 46 <CPPInline Value="False"/> 47 </SyntaxOptions> 48 </Parsing> 49 <CodeGeneration> 50 <Checks> 51 <IOChecks Value="True"/> 52 <RangeChecks Value="True"/> 53 <OverflowChecks Value="True"/> 54 <StackChecks Value="True"/> 55 </Checks> 56 </CodeGeneration> 57 <Linking> 58 <Debugging> 59 <UseHeaptrc Value="True"/> 60 </Debugging> 61 </Linking> 62 <Other> 63 <Verbosity> 64 <ShoLineNum Value="True"/> 65 </Verbosity> 66 <WriteFPCLogo Value="False"/> 67 <CompilerMessages> 68 <IgnoredMessages idx5023="True" idx5024="True" idx5025="True" idx5026="True" idx5027="True" idx5028="True" idx5029="True" idx5030="True" idx5031="True"/> 69 <UseMsgFile Value="True"/> 70 </CompilerMessages> 71 <CustomOptions Value="-dDEBUG"/> 72 <CompilerPath Value="$(CompPath)"/> 73 </Other> 74 <LCLWidgetType Value="nogui"/> 75 </CompilerOptions> 76 </Item2> 28 77 </BuildModes> 29 78 <PublishOptions> … … 221 270 <IsPartOfProject Value="True"/> 222 271 <ComponentName Value="PageAdmin"/> 272 <HasResources Value="True"/> 223 273 <ResourceBaseClass Value="DataModule"/> 224 274 <UnitName Value="UPageAdmin"/> … … 237 287 </Target> 238 288 <SearchPaths> 239 <OtherUnitFiles Value="/usr/lib/mysql /;/usr/lib64/mysql/;Application;WebServer;Network;Pages;Modules/User;Common;Modules/System;Modules/ZdechovNET"/>289 <OtherUnitFiles Value="/usr/lib/mysql;/usr/lib64/mysql;Application;WebServer;Network;Pages;Modules/User;Common;Modules/System;Modules/ZdechovNET"/> 240 290 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 241 291 </SearchPaths> … … 249 299 </Parsing> 250 300 <CodeGeneration> 301 <SmartLinkUnit Value="True"/> 251 302 <Checks> 252 303 <IOChecks Value="True"/> … … 255 306 <StackChecks Value="True"/> 256 307 </Checks> 308 <Optimizations> 309 <OptimizationLevel Value="3"/> 310 </Optimizations> 257 311 </CodeGeneration> 312 <Linking> 313 <LinkSmart Value="True"/> 314 </Linking> 258 315 <Other> 259 316 <Verbosity> -
trunk/ZdechovNET.lpr
r81 r96 8 8 {$ENDIF} 9 9 UUtils, USqlDatabase, SysUtils, Contnrs, Forms, 10 UUser, UHTTPSessionMySQL, UHTTPSessionFile, 10 UUser, UHTTPSessionMySQL, UHTTPSessionFile, Printers, 11 11 UCommon, UHTTPServer, UHTTPServerTCP, UHTTPServerCGI, UTCPServer, UPool, 12 12 UMemoryStreamEx, UMIMEType, UPageList, Interfaces, UCore, UWebApp; 13 13 14 {$IFDEF DEBUG} 15 const 16 HeapTraceLog = 'heaptrclog.trc'; 17 {$ENDIF} 18 14 19 begin 20 {$IFDEF DEBUG} 21 // Heap trace 22 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 23 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 24 {$ENDIF} 25 15 26 with Application do begin 16 27 Initialize; … … 18 29 Core.Run; 19 30 Run; 31 Printer.RawMode := True; // Avoid printer finalization exception 20 32 end; 21 33 end.
Note:
See TracChangeset
for help on using the changeset viewer.