Changeset 96


Ignore:
Timestamp:
Oct 2, 2012, 9:22:02 AM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Neuvolňovaly se správně registrované stránky.
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        55backup
        66ZdechovNET.lps
         7heaptrclog.trc
  • trunk/Modules/User/UModuleUser.pas

    r94 r96  
    8484    Data.Add('FullName', 'Anonymous');
    8585    Data.Add('RegistrationTime', 'NOW()');
     86    Data.Add('Password', '');
     87    Data.Add('Salt', '');
     88    Data.Add('Email', '');
    8689    Core.CommonDatabase.Insert('User', Data);
    8790
  • trunk/Packages/CoolWeb/CoolWeb.lpk

    r84 r96  
    99      <SearchPaths>
    1010        <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"/>
    1212        <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    1313      </SearchPaths>
     
    145145      <Version Value="2"/>
    146146    </PublishOptions>
     147    <CustomOptions Items="ExternHelp" Version="2">
     148      <_ExternHelp Items="Count"/>
     149    </CustomOptions>
    147150  </Package>
    148151</CONFIG>
  • trunk/Packages/CoolWeb/Network/UTCPServer.pas

    r84 r96  
    2121
    2222  TTCPClientThread = class(TResetableThread)
     23    Id: Integer;
    2324    Parent: TTCPServer;
    2425    Socket: TTCPBlockSocket;
     
    5556    FActive: Boolean;
    5657    AcceptThread: TAcceptThread;
     58    NewId: Integer;
    5759    procedure SetActive(const AValue: Boolean);
    5860  public
     
    9496      AcceptThread.Terminate;
    9597      AcceptThread.WaitFor;
    96       AcceptThread.Destroy;
     98      FreeAndNil(AcceptThread);
    9799      ThreadPool.Active := False;
    98100      CloseSocket;
     
    115117destructor TTCPServer.Destroy;
    116118begin
    117   ThreadPool.Destroy;
    118119  Active := False;
    119   Socket.Destroy;
    120   inherited Destroy;
     120  FreeAndNil(ThreadPool);
     121  FreeAndNil(Socket);
     122  inherited;
    121123end;
    122124
     
    136138        NewObject.Socket.Socket := NewSocket;
    137139        NewObject.Start;
     140        NewObject.Id := Parent.NewId;
     141        Inc(Parent.NewId);
    138142      end;
    139143    end;
     
    160164destructor TTCPClientThread.Destroy;
    161165begin
    162   Socket.Destroy;
     166  FreeAndNil(Socket);
    163167  inherited;
    164168end;
  • trunk/Packages/CoolWeb/WebServer/UHTTPServer.pas

    r84 r96  
    77uses
    88  Classes, SysUtils, UTCPServer, UCommon, UMemoryStreamEx, UMIMEType,
    9   Synautil, SpecializedList, SpecializedDictionary;
     9  Synautil, SpecializedList, SpecializedDictionary, Syncobjs;
    1010
    1111type
     
    102102    procedure SetShowExceptions(const AValue: Boolean);
    103103  public
     104    Lock: TCriticalSection;
    104105    procedure Run; virtual;
    105106    procedure ErrorResponse(HandlerData: THTTPHandlerData);
     
    228229begin
    229230  inherited;
     231  Lock := TCriticalSection.Create;
    230232  ShowExceptions := False;
    231233  DocumentRoot := './';
     
    234236destructor THTTPServer.Destroy;
    235237begin
    236   inherited Destroy;
     238  FreeAndNil(Lock);
     239  inherited;
    237240end;
    238241
  • trunk/Packages/CoolWeb/WebServer/UHTTPServerTCP.pas

    r84 r96  
    4444begin
    4545  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);
    4747
    4848    HandlerData := THTTPHandlerData.Create;
     
    5858        repeat
    5959          Line := RecvString(10000);
     60          WriteLn(IntToStr(Id) + ' ' + Line);
    6061          if (LineIndex = 0) then begin
    6162            LineParts.Explode(Line, ' ', StrToStr);
     
    115116      // Send headers
    116117      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);
    118119        SendString(Headers.Keys[I] + ': ' + Headers.Items[I].Value + #13#10);
    119120      end;
  • trunk/Packages/CoolWeb/WebServer/UWebApp.pas

    r91 r96  
    1212  THTTPServerType = (stCGI, stTCP, stTurboPower);
    1313
     14  { TRegistredPage }
     15
    1416  TRegistredPage = class
    1517    Name: string;
    1618    Page: TWebPage;
     19    destructor Destroy; override;
    1720  end;
    1821
     
    6568end;
    6669
     70{ TRegistredPage }
     71
     72destructor TRegistredPage.Destroy;
     73begin
     74  if Assigned(Page) then FreeAndNil(Page);
     75end;
     76
    6777
    6878{ TPageList }
  • trunk/Packages/TemplateGenerics/Generic/GenericListObject.inc

    r90 r96  
    108108begin
    109109  Clear;
    110   inherited Destroy;
     110  inherited;
    111111end;
    112112
  • trunk/UCore.lfm

    r89 r96  
    22  OldCreateOrder = False
    33  Height = 278
    4   HorizontalOffset = 654
    5   VerticalOffset = 203
     4  HorizontalOffset = 341
     5  VerticalOffset = 187
    66  Width = 431
    77  object WebApp1: TWebApp
    88    OnPageProduce = WebApp1PageProduce
    9     ServerType = stCGI
     9    ServerType = stTCP
    1010    left = 160
    1111    top = 88
  • trunk/UCore.lrs

    r89 r96  
    33LazarusResources.Add('TCore','FORMDATA',[
    44  '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'#14
     5  +'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
    88  +'Identification'#2#1#12'VersionMajor'#2#1#12'VersionMinor'#2#0#13'VersionBug'
    99  +'Fix'#2#0#11'CompanyName'#6#11'Zd'#196#155'chovNET'#15'CompanyHomePage'#6#23
  • trunk/ZdechovNET.lpi

    r92 r96  
    2424      <Macro1 Name="LCLWidgetType" Value="nogui"/>
    2525    </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>
    2877    </BuildModes>
    2978    <PublishOptions>
     
    221270        <IsPartOfProject Value="True"/>
    222271        <ComponentName Value="PageAdmin"/>
     272        <HasResources Value="True"/>
    223273        <ResourceBaseClass Value="DataModule"/>
    224274        <UnitName Value="UPageAdmin"/>
     
    237287    </Target>
    238288    <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"/>
    240290      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    241291    </SearchPaths>
     
    249299    </Parsing>
    250300    <CodeGeneration>
     301      <SmartLinkUnit Value="True"/>
    251302      <Checks>
    252303        <IOChecks Value="True"/>
     
    255306        <StackChecks Value="True"/>
    256307      </Checks>
     308      <Optimizations>
     309        <OptimizationLevel Value="3"/>
     310      </Optimizations>
    257311    </CodeGeneration>
     312    <Linking>
     313      <LinkSmart Value="True"/>
     314    </Linking>
    258315    <Other>
    259316      <Verbosity>
  • trunk/ZdechovNET.lpr

    r81 r96  
    88  {$ENDIF}
    99  UUtils, USqlDatabase, SysUtils, Contnrs, Forms,
    10   UUser, UHTTPSessionMySQL, UHTTPSessionFile,
     10  UUser, UHTTPSessionMySQL, UHTTPSessionFile, Printers,
    1111  UCommon, UHTTPServer, UHTTPServerTCP, UHTTPServerCGI, UTCPServer, UPool,
    1212  UMemoryStreamEx, UMIMEType, UPageList, Interfaces, UCore, UWebApp;
    1313
     14{$IFDEF DEBUG}
     15const
     16  HeapTraceLog = 'heaptrclog.trc';
     17{$ENDIF}
     18
    1419begin
     20  {$IFDEF DEBUG}
     21  // Heap trace
     22  DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
     23  SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
     24  {$ENDIF}
     25
    1526  with Application do begin
    1627    Initialize;
     
    1829    Core.Run;
    1930    Run;
     31    Printer.RawMode := True; // Avoid printer finalization exception
    2032  end;
    2133end.
Note: See TracChangeset for help on using the changeset viewer.