Changeset 295 for Network/CoolWeb


Ignore:
Timestamp:
Nov 15, 2011, 8:46:43 AM (13 years ago)
Author:
george
Message:
  • Moved: Units UPool and UResetableThread moved from CoolWeb to Common. Both units redone to more abstract reprezentation.
  • Added: New Port property in class TSqlDatabase.
Location:
Network/CoolWeb
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • Network/CoolWeb/CoolWeb.lpk

    r255 r295  
    1111        <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    1212      </SearchPaths>
     13      <Linking>
     14        <Debugging>
     15          <GenerateDebugInfo Value="True"/>
     16          <DebugInfoType Value="dsAuto"/>
     17        </Debugging>
     18      </Linking>
    1319      <Other>
    1420        <CompilerMessages>
     
    2127    <License Value="GNU/GPL"/>
    2228    <Version Minor="2"/>
    23     <Files Count="18">
     29    <Files Count="16">
    2430      <Item1>
    2531        <Filename Value="WebServer/UHTTPServer.pas"/>
     
    7682      </Item12>
    7783      <Item13>
    78         <Filename Value="Common/UPool.pas"/>
    79         <UnitName Value="UPool"/>
     84        <Filename Value="Common/UXmlClasses.pas"/>
     85        <UnitName Value="UXmlClasses"/>
    8086      </Item13>
    8187      <Item14>
    82         <Filename Value="Common/UResetableThread.pas"/>
    83         <UnitName Value="UResetableThread"/>
    84       </Item14>
    85       <Item15>
    86         <Filename Value="Common/UXmlClasses.pas"/>
    87         <UnitName Value="UXmlClasses"/>
    88       </Item15>
    89       <Item16>
    9088        <Filename Value="WebServer/UWebPage.pas"/>
    9189        <HasRegisterProc Value="True"/>
    9290        <UnitName Value="UWebPage"/>
    93       </Item16>
    94       <Item17>
     91      </Item14>
     92      <Item15>
    9593        <Filename Value="WebServer/UWebApp.pas"/>
    9694        <HasRegisterProc Value="True"/>
    9795        <UnitName Value="UWebApp"/>
    98       </Item17>
    99       <Item18>
     96      </Item15>
     97      <Item16>
    10098        <Filename Value="LazIDEReg.pas"/>
    10199        <HasRegisterProc Value="True"/>
    102100        <UnitName Value="LazIDEReg"/>
    103       </Item18>
     101      </Item16>
    104102    </Files>
    105103    <Type Value="RunAndDesignTime"/>
  • Network/CoolWeb/CoolWeb.pas

    r254 r295  
    1010  UHTTPServer, UHTTPServerCGI, UHTTPServerTCP, UHTTPSessionFile,
    1111  UHTTPSessionMySQL, USqlDatabase, UTCPServer, UPageList, UUser, UHtmlClasses,
    12   UMemoryStreamEx, UMIMEType, UPool, UResetableThread, UXmlClasses, UWebPage,
    13   UWebApp, LazIDEReg, LazarusPackageIntf;
     12  UMemoryStreamEx, UMIMEType, UXmlClasses, UWebPage, UWebApp, LazIDEReg,
     13  LazarusPackageIntf;
    1414
    1515implementation
  • Network/CoolWeb/Network/UTCPServer.pas

    r94 r295  
    11unit UTCPServer;
    22
    3 {$mode objfpc}{$H+}
     3{$mode Delphi}{$H+}
    44
    55interface
     
    2323    Parent: TTCPServer;
    2424    Socket: TTCPBlockSocket;
    25     procedure Execute; override;
     25    procedure Execute;
    2626    constructor Create;
    2727    destructor Destroy; override;
     
    3030  { TClientThreadedPool }
    3131
    32   TClientThreadedPool = class(TThreadedPool)
     32  TClientThreadedPool = class(TThreadPool)
    3333  private
    3434    FActive: Boolean;
     
    152152begin
    153153  inherited;
     154  Method := Execute;
    154155  Socket := TTCPBlockSocket.Create;
    155156end;
     
    164165
    165166procedure TClientThreadedPool.SetActive(const AValue: Boolean);
    166 var
    167   I: Integer;
    168167begin
    169   if not FActive and AValue then begin
    170     for I := 0 to TotalCount - 1 do begin
    171       TThreadedPoolItem(Items[I]).Item := TTCPClientThread.Create;
    172     end;
    173   end else
    174   if FActive and not AValue then begin
    175 
    176   end;
    177168  FActive := AValue;
    178169end;
  • Network/CoolWeb/Persistence/USqlDatabase.pas

    r258 r295  
    3939    FHostName: string;
    4040    FPassword: string;
     41    FPort: Word;
    4142    FSession: PMYSQL;
    4243    FConnected: Boolean;
     
    8182    property UserName: string read FUserName write FUserName;
    8283    property Password: string read FPassword write FPassword;
     84    property Port: Word read FPort write FPort;
    8385    property Encoding: string read FEncoding write FEncoding;
    8486    property OnLogQuery: TLogEvent read FOnLogQuery write FOnLogQuery;
     
    184186//  FSession.charset := 'latin2';
    185187  NewSession := mysql_real_connect(FSession, PChar(HostName), PChar(UserName),
    186     PChar(Password), PChar(Database), 3306, nil, CLIENT_LONG_PASSWORD + CLIENT_CONNECT_WITH_DB);
     188    PChar(Password), PChar(Database), FPort, nil, CLIENT_LONG_PASSWORD + CLIENT_CONNECT_WITH_DB);
    187189  if Assigned(NewSession) then begin
    188190    FConnected := True;
     
    360362  FSession := nil;
    361363  Encoding := 'utf8';
     364  FPort := 3306;
    362365end;
    363366
Note: See TracChangeset for help on using the changeset viewer.