Changeset 88


Ignore:
Timestamp:
Dec 18, 2009, 12:21:39 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Nedokončené přepracování správy vláken. Použit systém přidělování ze společné sady o dané velikosti namísto přidělování vláken ke každému požadavku samostatně. Vlákna jsou inicializována při spuštění aplikace, jsou opakovaně používána a uvolněna až při ukončení běhu aplikace.
  • Přidáno: Třída pro práci s opakovaně spustitelnými vlákny.
  • Přidáno: Třída přidělování objektů ze zásoby o dané velikosti.
  • Přidáno: Třída pro zobrazování stránkování seznamů položek.
Location:
branches/DirectWeb
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/DirectWeb/UHTTPServer.pas

    r87 r88  
    1010
    1111type
     12  THTTPServer = class;
    1213
    1314  TQueryParameterList = class(TStringList)
     
    2829    Query: TQueryParameterList;
    2930    Path: string;
    30     Host: string;
    3131    Method: string;
    3232    Headers: TStringList;
     
    4747  end;
    4848
    49   TRequestEvent = procedure(Request: THTTPRequest; Response: THTTPResponse) of object;
     49  { THTTPHandlerData }
     50
     51  THTTPHandlerData = class
     52    Server: THTTPServer;
     53    Request: THTTPRequest;
     54    Response: THTTPResponse;
     55    SessionId: string;
     56    Session: TStringList;
     57    constructor Create;
     58    destructor Destroy; override;
     59  end;
     60
     61  TRequestEvent = procedure(HandlerData: THTTPHandlerData) of object;
    5062
    5163  TRequestHandler = class
     
    6375  { THTTPSession }
    6476
    65   THTTPSession = class
    66     Variables: TStringList;
    67     procedure Load(Request: THTTPRequest); virtual;
    68     procedure Save(Response: THTTPResponse); virtual;
     77  { THTTPSessionStorage }
     78
     79  THTTPSessionStorage = class
     80    procedure Load(HandlerData: THTTPHandlerData); virtual;
     81    procedure Save(HandlerData: THTTPHandlerData); virtual;
    6982    constructor Create; virtual;
    7083    destructor Destroy; override;
     
    7689  private
    7790    procedure HandleClient(Sender: TObject);
    78     procedure ErrorResponse(Request: THTTPRequest; Response: THTTPResponse);
     91    procedure ErrorResponse(HandlerData: THTTPHandlerData);
    7992  public
    8093    Name: string;
     
    8396    MaxConnection: Integer;
    8497    RequestHandlerList: TRequestHandlerList;
    85     SessionHandler: THTTPSession;
    86     procedure FileResponse(Request: THTTPRequest;
    87       Response: THTTPResponse);
     98    SessionStorage: THTTPSessionStorage;
     99    procedure FileResponse(HandlerData: THTTPHandlerData);
    88100    constructor Create;
    89101    destructor Destroy; override;
     
    100112  LineIndex: Integer;
    101113  LineParts: array of string;
    102   Request: THTTPRequest;
    103   Response: THTTPResponse;
     114  HandlerData: THTTPHandlerData;
    104115  I: Integer;
    105116  QueryString: string;
    106117begin
    107118  with TTCPClientThread(Sender), Socket do begin
    108     WriteLn('Client ' + IntToStr(Parent.IndexOf(Sender)) + ' connected from ' + GetRemoteSinIP);
     119    WriteLn('Used thrads ' + IntToStr(Parent.ThreadPool.UsedCount) + '. Client connected from ' + GetRemoteSinIP);
     120
     121    HandlerData := THTTPHandlerData.Create;
     122    with HandlerData do begin
     123      Server := Self;
    109124
    110125    Response := THTTPResponse.Create;
     
    128143          LineParts[0] := Copy(LineParts[0], 1, Length(LineParts[0]) - 1);
    129144          Request.Headers.Values[LineParts[0]] := LineParts[1];
    130           WriteLn(Line);
     145          //WriteLn(Line);
    131146        end;
    132147      end;
     
    138153      Request.Cookies.Parse(Request.Headers.Values['Cookie']);
    139154
    140     // Process session
    141     if Assigned(SessionHandler) then
    142       SessionHandler.Load(Request);
     155    // Load session variables
     156    if Assigned(SessionStorage) then
     157      SessionStorage.Load(HandlerData);
    143158
    144159    Response.Stream.Clear;
     
    148163    RequestHandler := RequestHandlerList.IndexOfName(Request.Path);
    149164
    150     if Assigned(RequestHandler) then RequestHandler.Handler(Request, Response)
    151       else ErrorResponse(Request, Response);
    152 
    153     if Assigned(SessionHandler) then
    154       SessionHandler.Save(Response);
     165    if Assigned(RequestHandler) then RequestHandler.Handler(HandlerData)
     166      else ErrorResponse(HandlerData);
     167
     168    // Store session variables
     169    if Assigned(SessionStorage) then
     170      SessionStorage.Save(HandlerData);
    155171
    156172    with Response do begin
     
    167183      // Send headers
    168184      for I := 0 to Headers.Count - 1 do begin
    169         WriteLn(Headers.Names[I] + ': ' + Headers.ValueFromIndex[I] + #13#10);
     185        //WriteLn(Headers.Names[I] + ': ' + Headers.ValueFromIndex[I] + #13#10);
    170186        SendString(Headers.Names[I] + ': ' + Headers.ValueFromIndex[I] + #13#10);
    171187      end;
     
    175191    end;
    176192
    177     Request.Destroy;
    178     Response.Destroy;
    179   end;
    180 end;
    181 
    182 procedure THTTPServer.ErrorResponse(Request: THTTPRequest;
    183   Response: THTTPResponse);
    184 begin
    185   with Response.Stream do begin
     193      Destroy;
     194    end;
     195  end;
     196end;
     197
     198procedure THTTPServer.ErrorResponse(HandlerData: THTTPHandlerData);
     199begin
     200  with HandlerData, Response.Stream do begin
    186201    WriteString('<html><body>Page ' + Request.Path + ' not found.</body></html>');
    187202  end;
    188203end;
    189204
    190 procedure THTTPServer.FileResponse(Request: THTTPRequest;
    191   Response: THTTPResponse);
     205procedure THTTPServer.FileResponse(HandlerData: THTTPHandlerData);
    192206var
    193207  BinaryFile: TFileStream;
    194208  FileName: string;
    195209begin
    196   FileName := DocumentRoot + Request.Path;
    197   if FileExists(FileName) then begin
    198     Response.Headers.Values['Content-Type'] := GetMIMEType(Copy(ExtractFileExt(FileName), 2, 255));
    199     BinaryFile := TFileStream.Create(FileName, fmOpenRead);
    200     Response.Stream.WriteStream(BinaryFile);
    201     BinaryFile.Destroy;
    202   end else
    203   with Response.Stream do begin
    204     WriteLn('File ' + Request.Path + ' not found.');
    205     WriteString('<html><body>File ' + Request.Path + ' not found.</body></html>');
     210  with HandlerData do begin
     211    FileName := DocumentRoot + Request.Path;
     212    if FileExists(FileName) then begin
     213      Response.Headers.Values['Content-Type'] := GetMIMEType(Copy(ExtractFileExt(FileName), 2, 255));
     214      BinaryFile := TFileStream.Create(FileName, fmOpenRead);
     215      Response.Stream.WriteStream(BinaryFile);
     216      BinaryFile.Destroy;
     217    end else
     218    with Response.Stream do begin
     219      WriteLn('File ' + Request.Path + ' not found.');
     220      WriteString('<html><body>File ' + Request.Path + ' not found.</body></html>');
     221    end;
    206222  end;
    207223end;
     
    329345end;
    330346
    331 { THTTPSession }
    332 
    333 procedure THTTPSession.Load(Request: THTTPRequest);
    334 begin
    335 
    336 end;
    337 
    338 procedure THTTPSession.Save(Response: THTTPResponse);
    339 begin
    340 
    341 end;
    342 
    343 constructor THTTPSession.Create;
    344 begin
    345   Variables := TStringList.Create;
    346 end;
    347 
    348 destructor THTTPSession.Destroy;
    349 begin
    350   Variables.Destroy;
     347{ THTTPSessionStorage }
     348
     349procedure THTTPSessionStorage.Load(HandlerData: THTTPHandlerData);
     350begin
     351
     352end;
     353
     354procedure THTTPSessionStorage.Save(HandlerData: THTTPHandlerData);
     355begin
     356
     357end;
     358
     359constructor THTTPSessionStorage.Create;
     360begin
     361
     362end;
     363
     364destructor THTTPSessionStorage.Destroy;
     365begin
     366  inherited Destroy;
     367end;
     368
     369{ THTTPHandlerData }
     370
     371constructor THTTPHandlerData.Create;
     372begin
     373  Request := THTTPRequest.Create;
     374  Response := THTTPResponse.Create;
     375  Session := TStringList.Create;
     376end;
     377
     378destructor THTTPHandlerData.Destroy;
     379begin
     380  Request.Destroy;
     381  Response.Destroy;
     382  Session.Destroy;
    351383  inherited Destroy;
    352384end;
  • branches/DirectWeb/UHTTPSessionFile.pas

    r87 r88  
    66
    77uses
    8   Classes, SysUtils, UHTTPServer;
     8  Classes, SysUtils, UHTTPServer, syncobjs;
    99
    10 type 
     10type
    1111
    12   { THTTPSessionFile }
     12  { TFileHTTPSessionStorage }
    1313
    14   THTTPSessionFile = class(THTTPSession)
     14  TFileHTTPSessionStorage = class(THTTPSessionStorage)
     15  private
     16    Lock: TCriticalSection;
     17    procedure GetSessionId(HandlerData: THTTPHandlerData);
     18  public
    1519    Directory: string;
    1620    SessionIdCookieName: string;
    17     SessionId: string;
    18     procedure Load(Request: THTTPRequest); override;
    19     procedure Save(Response: THTTPResponse); override;
     21    Sessions: TStringList;
     22    procedure Load(HandlerData: THTTPHandlerData); override;
     23    procedure Save(HandlerData: THTTPHandlerData); override;
    2024    constructor Create; override;
    2125    destructor Destroy; override;
     
    2630{ THTTPSession }
    2731
    28 procedure THTTPSessionFile.Load(Request: THTTPRequest);
     32procedure TFileHTTPSessionStorage.GetSessionId(HandlerData: THTTPHandlerData);
    2933begin
     34  with HandlerData do
    3035  if Request.Cookies.IndexOfName(SessionIdCookieName) <> -1 then begin
    31     SessionId := Request.Cookies.Values[SessionIdCookieName];
    32   end else begin
    33     SessionId := IntToStr(Random(1000));
    34     // TODO: Check if new id already used
     36      SessionId := Request.Cookies.Values[SessionIdCookieName];
     37    end else begin
     38      SessionId := IntToStr(Random(2000000000));
     39      // TODO: Check if new id already used
     40    end;
     41end;
     42
     43procedure TFileHTTPSessionStorage.Load(HandlerData: THTTPHandlerData);
     44var
     45  SessionFile: string;
     46begin
     47  GetSessionId(HandlerData);
     48  try
     49    Lock.Acquire;
     50    SessionFile := Directory + '/' + HandlerData.SessionId;
     51    if FileExists(SessionFile) then
     52      HandlerData.Session.LoadFromFile(SessionFile);
     53  finally
     54    Lock.Release;
    3555  end;
    36 
    37   if FileExists(Directory + '/' + SessionId) then
    38     Variables.LoadFromFile(Directory + '/' + SessionId);
    3956  inherited;
    4057end;
    4158
    42 procedure THTTPSessionFile.Save(Response: THTTPResponse);
     59procedure TFileHTTPSessionStorage.Save(HandlerData: THTTPHandlerData);
     60var
     61  SessionFile: string;
    4362begin
    44   ForceDirectories(Directory);
    45   if DirectoryExists(Directory) then
    46     Variables.SaveToFile(Directory + '/' + SessionId)
    47     else raise Exception.Create('Can''t create session storage directory.');
     63  try
     64    Lock.Acquire;
     65    SessionFile := Directory + '/' + HandlerData.SessionId;
     66    ForceDirectories(Directory);
     67    if DirectoryExists(Directory) then begin
     68      DeleteFile(SessionFile);
     69      HandlerData.Session.SaveToFile(SessionFile)
     70    end else raise Exception.Create('Can''t create session storage directory.');
    4871
    49   Response.Cookies.Values[SessionIdCookieName] := SessionId;
    50   inherited Save(Response);
     72    HandlerData.Response.Cookies.Values[SessionIdCookieName] := HandlerData.SessionId;
     73  finally
     74    Lock.Release;
     75  end;
     76  inherited;
    5177end;
    5278
    53 constructor THTTPSessionFile.Create;
     79constructor TFileHTTPSessionStorage.Create;
    5480begin
    55   inherited;
     81  inherited Create;
     82  Lock := TCriticalSection.Create;
     83  Sessions := TStringList.Create;
    5684  SessionIdCookieName := 'SessionId';
    5785  Directory := 'Session';
    5886end;
    5987
    60 destructor THTTPSessionFile.Destroy;
     88destructor TFileHTTPSessionStorage.Destroy;
    6189begin
     90  Sessions.Destroy;
     91  Lock.Destroy;
    6292  inherited Destroy;
    6393end;
  • branches/DirectWeb/UTCPServer.pas

    r84 r88  
    1313  //LibC,
    1414  {$ENDIF}
    15   BlckSock;
     15  BlckSock, UPool, UResetableThread;
    1616
    1717type
    1818  TTCPServer = class;
    19   TTCPClientList = class;
    2019
    2120  { TTCPClientThread }
    2221
    23   TTCPClientThread = class(TThread)
    24     Parent: TTCPClientList;
     22  TTCPClientThread = class(TResetableThread)
     23    Parent: TTCPServer;
    2524    Socket: TTCPBlockSocket;
    2625    procedure Execute; override;
    27     constructor Create(CreateSuspended: Boolean;
    28       const StackSize: SizeUInt = DefaultStackSize);
     26    constructor Create;
    2927    destructor Destroy; override;
     28  end;
     29
     30  { TClientThreadedPool }
     31
     32  TClientThreadedPool = class(TThreadedPool)
     33  private
     34    FActive: Boolean;
     35    procedure SetActive(const AValue: Boolean);
     36  public
     37    property Active: Boolean read FActive write SetActive;
    3038  end;
    3139
     
    3543    Parent: TTCPServer;
    3644    procedure Execute; override;
    37   end;
    38 
    39   { TTCPClientList }
    40 
    41   TTCPClientList = class(TList)
    42     Parent: TTCPServer;
    43     procedure Add(ASocket: TSocket);
    44     procedure Remove(Item: TTCPClientThread);
    45     procedure Terminate;
    46     procedure WaitFor;
    47     constructor Create;
    48     destructor Destroy; override;
    4945  end;
    5046
     
    5955    procedure SetActive(const AValue: Boolean);
    6056  public
    61     Clients: TTCPClientList;
     57    ThreadPool: TClientThreadedPool;
    6258    Address: string;
    6359    Port: Word;
     
    7773  if AValue and not FActive then begin
    7874    with Socket do begin
     75      ThreadPool.Active := True;
    7976      CreateSocket;
    8077      SetLinger(True, 10);
     
    9693      AcceptThread.WaitFor;
    9794      AcceptThread.Destroy;
    98       Clients.Terminate;
    99       Clients.WaitFor;
     95      ThreadPool.Active := False;
    10096      CloseSocket;
    10197    end;
     
    105101
    106102constructor TTCPServer.Create;
     103var
     104  I: Integer;
    107105begin
    108   Clients := TTCPClientList.Create;
    109   Clients.Parent := Self;
     106  ThreadPool := TClientThreadedPool.Create;
     107  ThreadPool.TotalCount := 10;
     108
    110109  Socket := TTCPBlockSocket.Create;
    111110  Address := '0.0.0.0';
     
    115114destructor TTCPServer.Destroy;
    116115begin
     116  ThreadPool.Destroy;
    117117  Active := False;
    118118  Socket.Destroy;
    119   Clients.Destroy;
    120119  inherited Destroy;
    121120end;
     
    126125var
    127126  NewSocket: TSocket;
     127  NewObject: TTCPClientThread;
    128128begin
    129129  repeat
     
    131131      NewSocket := Parent.Socket.Accept;
    132132      if Parent.Socket.LastError = 0 then begin
    133         Parent.Clients.Add(NewSocket);
     133        NewObject := TTCPClientThread(Parent.ThreadPool.Acquire);
     134        NewObject.Parent := Parent;
     135        NewObject.Socket.Socket := NewSocket;
     136        NewObject.Start;
    134137      end;
    135138    end;
    136139  until Terminated;
    137 end;
    138 
    139 { TTCPClientList }
    140 
    141 procedure TTCPClientList.Add(ASocket: TSocket);
    142 begin
    143   with TTCPClientThread(Items[inherited Add(TTCPClientThread.Create(True))]) do begin
    144     Socket.Socket := ASocket;
    145     Parent := Self;
    146     Resume;
    147   end;
    148 end;
    149 
    150 procedure TTCPClientList.Remove(Item: TTCPClientThread);
    151 begin
    152   inherited Remove(Item);
    153   Item.Destroy;
    154 end;
    155 
    156 procedure TTCPClientList.Terminate;
    157 var
    158   I: Integer;
    159 begin
    160   for I := 0 to Count - 1 do
    161     TTCPClientThread(Items[I]).Terminate;
    162 end;
    163 
    164 procedure TTCPClientList.WaitFor;
    165 var
    166   I: Integer;
    167 begin
    168   for I := 0 to Count - 1 do
    169     TTCPClientThread(Items[I]).WaitFor;
    170 end;
    171 
    172 constructor TTCPClientList.Create;
    173 begin
    174   inherited;
    175 end;
    176 
    177 destructor TTCPClientList.Destroy;
    178 var
    179   I: Integer;
    180 begin
    181   for I := 0 to Count - 1 do
    182     TTCPClientThread(Items[I]).Destroy;
    183   inherited Destroy;
    184140end;
    185141
     
    188144procedure TTCPClientThread.Execute;
    189145begin
    190   if Assigned(Parent.Parent.FOnClientConnect) then
    191     Parent.Parent.FOnClientConnect(Self);
    192   Parent.Remove(Self);
     146  if Assigned(Parent.FOnClientConnect) then
     147    Parent.FOnClientConnect(Self);
    193148end;
    194149
    195 constructor TTCPClientThread.Create(CreateSuspended: Boolean;
    196   const StackSize: SizeUInt);
     150constructor TTCPClientThread.Create;
    197151begin
    198   inherited Create(CreateSuspended, StackSize);
     152  inherited;
    199153  Socket := TTCPBlockSocket.Create;
    200154end;
     
    202156destructor TTCPClientThread.Destroy;
    203157begin
    204   //Socket.Destroy;
    205   inherited Destroy;
     158  Socket.Destroy;
     159  inherited;
     160end;
     161
     162{ TClientThreadedPool }
     163
     164procedure TClientThreadedPool.SetActive(const AValue: Boolean);
     165var
     166  I: Integer;
     167begin
     168  if not FActive and Active then begin
     169    Allocate;
     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 Active then begin
     175
     176  end;
     177  FActive := Active;
    206178end;
    207179
  • branches/DirectWeb/UWebServer.pas

    r87 r88  
    77uses
    88  Classes, SysUtils, UHTTPServer, UHTTPSessionFile,
    9   UTCPServer,
    10   UCommon,
     9  UTCPServer, Contnrs,
     10  UCommon, syncobjs,
    1111  UMemoryStreamEx,
    1212  UMIMEType, Synautil,
    13   USqlDatabase, DOM, XMLRead;
     13  USqlDatabase, DOM, XMLRead, UHTMLControls;
    1414
    1515const
     
    1717
    1818type
    19   { TWebServer }
    20 
    21   TWebServer = class
     19
     20  { TDatabasePool }
     21
     22  TDatabasePool = class(TObjectList)
    2223  private
    23     HTTPSessionFile: THTTPSessionFile;
    24     function PagesList(URL: string; Page, TotalCount, CountPerPage: Integer
    25       ): string;
    26     procedure ServerInfo(Request: THTTPRequest; Response: THTTPResponse);
     24    Lock: TCriticalSection;
    2725  public
    28     HTTPServer: THTTPServer;
     26    PoolSize: Integer;
    2927    HostName: string;
    3028    Schema: string;
    3129    UserName: string;
    3230    Password: string;
    33 
    34     procedure ViewList(Request: THTTPRequest; Response: THTTPResponse);
    35     procedure ViewItem(Request: THTTPRequest; Response: THTTPResponse);
    36     procedure SendIndex(Request: THTTPRequest; Response: THTTPResponse);
     31    procedure Allocate;
     32    function Acquire: TSqlDatabase;
     33    procedure Release(Database: TSqlDatabase);
     34    constructor Create;
     35    destructor Destroy; override;
     36  end;
     37
     38  { TWebServer }
     39
     40  TWebServer = class
     41  private
     42    SessionStorage: TFileHTTPSessionStorage;
     43    procedure ServerInfo(HandlerData: THTTPHandlerData);
     44  public
     45    HTTPServer: THTTPServer;
     46    DatabasePool: TDatabasePool;
     47
     48    procedure ViewList(HandlerData: THTTPHandlerData);
     49    procedure ViewItem(HandlerData: THTTPHandlerData);
     50    procedure SendIndex(HandlerData: THTTPHandlerData);
    3751    procedure WriteHeader(Stream: TMemoryStreamEx);
    3852    procedure WriteFooter(Stream: TMemoryStreamEx);
     
    6377        with ChildNodes[I3] do begin
    6478          if NodeName = 'hostname' then
    65             HostName := TextContent;
     79            DatabasePool.HostName := TextContent;
    6680          if NodeName = 'schema' then
    67             Schema := TextContent;
     81            DatabasePool.Schema := TextContent;
    6882          if NodeName = 'username' then
    69             UserName := TextContent;
     83            DatabasePool.UserName := TextContent;
    7084          if NodeName = 'password' then
    71             Password := TextContent;
     85            DatabasePool.Password := TextContent;
    7286        end;
    7387        if NodeName = 'server' then
     
    102116end;
    103117
    104 function TWebServer.PagesList(URL: string; Page, TotalCount, CountPerPage: Integer): string;
    105 const
    106   Around: Integer = 10;
    107 var
    108   Count: Integer;
    109   PagesMax: Integer;
    110   PagesMin: Integer;
    111   I: Integer;
    112 begin
    113   Count := Round(TotalCount / CountPerPage);
    114   Result := '';
    115   if Count > 1 then begin
    116     if Page > 0 then begin
    117       Result := Result + '<a href="' + URL + '0">&lt;&lt;</a> ';
    118       Result := Result + '<a href="' + URL + IntToStr(Page - 1) + '">&lt;</a> ';
    119     end;
    120     PagesMax := Count - 1;
    121     PagesMin := 0;
    122     if PagesMax > (Page + Around) then PagesMax := Page + Around;
    123     if PagesMin < (Page - Around) then begin
    124       Result := Result + ' .. ';
    125       PagesMin := Page - Around;
    126     end;
    127     for I := PagesMin to PagesMax do begin
    128       if I = Page then Result := Result + '<strong>';
    129       Result := Result + '<a href="' + URL + IntToStr(I) + '">' + IntToStr(I + 1) + '</a> ';
    130       if I = Page then Result := Result + '</strong>';
    131     end;
    132     if PagesMax < (Count - 1) then Result := Result + ' .. ';
    133     if Page < (Count - 1) then begin
    134       Result := Result + '<a href="' + URL + IntToStr(Page + 1) + '">&gt;</a> ';
    135       Result := Result + '<a href="' + URL + IntToStr(Count - 1) + '">&gt;&gt;</a>';
    136     end;
    137   end;
    138 end;
    139 
    140 procedure TWebServer.ViewList(Request: THTTPRequest; Response: THTTPResponse);
     118procedure TWebServer.ViewList(HandlerData: THTTPHandlerData);
    141119var
    142120  SqlDatabase: TSqlDatabase;
     
    147125  Title: string;
    148126  LinkQuery: TQueryParameterList;
    149 begin
    150   SqlDatabase := TSqlDatabase.Create;
    151   with Response, Stream, SqlDatabase do
     127  PageList: TPageList;
     128begin
     129  SqlDatabase := DatabasePool.Acquire;
     130  with HandlerData, Response, Stream, SqlDatabase do
    152131  begin
    153132    WriteHeader(Stream);
    154     HostName := Self.HostName;
    155     UserName := Self.UserName;
    156     Password := Self.Password;
    157     Database := Self.Schema;
    158     Connect;
    159     WriteString(Request.Query.Values['Table']);
     133
     134    WriteString('<div align="center">');
     135
     136    // Prepare table paging
     137    DbRows := Query('SELECT COUNT(*) FROM ' + Request.Query.Values['Table']);
     138    PageList := TPageList.Create;
     139    PageList.HandlerData := HandlerData;
     140    with PageList do begin
     141      TotalCount := StrToInt(DbRows[0].ValuesAtIndex[0]);
     142      ItemPerPage := 20;
     143      NavigatorVisibleItems := 5;
     144      Process;
     145    end;
     146    DbRows.Destroy;
     147
     148    //WriteString(Request.Query.Values['Table']);
    160149    OrderColumn    := Request.Query.Values['OrderCol'];
    161150    OrderDirection := Request.Query.Values['OrderDir'];
     
    165154      OrderDirection := 'DESC';
    166155    DbRows := Query('SELECT * FROM ' + Request.Query.Values['Table'] +
    167       ' ORDER BY ' + OrderColumn + ' ' + OrderDirection);
     156      ' ORDER BY ' + OrderColumn + ' ' + OrderDirection + PageList.SQLLimit);
    168157
    169158    LinkQuery := TQueryParameterList.Create;
    170159    LinkQuery.Assign(Request.Query);
    171160
    172     WriteString('<strong>Seznam typů karet</strong>');
     161    WriteString('<strong>Seznam typů karet</strong><br/>');
     162    WriteString(PageList.Output);
    173163    WriteString('<table><tr>');
    174164    if DbRows.Count > 0 then
     
    197187    end;
    198188    WriteString('</table>');
     189    WriteString(PageList.Output);
     190    WriteString('</div>');
     191
    199192    DbRows.Destroy;
    200193    Destroy;
    201194    WriteFooter(Stream);
    202195  end;
    203 end;
    204 
    205 procedure TWebServer.ViewItem(Request: THTTPRequest; Response: THTTPResponse);
     196  PageList.Destroy;
     197end;
     198
     199procedure TWebServer.ViewItem(HandlerData: THTTPHandlerData);
    206200var
    207201  SqlDatabase: TSqlDatabase;
     
    214208begin
    215209  SqlDatabase := TSqlDatabase.Create;
    216   with Response, Stream, SqlDatabase do
     210  with HandlerData, Response, Stream, SqlDatabase do
    217211  begin
    218212    WriteHeader(Stream);
    219     HostName := Self.HostName;
    220     UserName := Self.UserName;
    221     Password := Self.Password;
    222     Database := Self.Schema;
    223     Connect;
    224213    DbRows := Query('SELECT * FROM ' + Request.Query.Values['Table'] +
    225214      ' WHERE Id=' + Request.Query.Values['Id']);
     
    239228end;
    240229
    241 procedure TWebServer.ServerInfo(Request: THTTPRequest; Response: THTTPResponse);
     230procedure TWebServer.ServerInfo(HandlerData: THTTPHandlerData);
    242231var
    243232  I: Integer;
    244233begin
    245   with Response.Stream do begin
    246     Response.Cookies.Values['Test'] := 'Halo';
     234  with HandlerData, Response.Stream do begin
     235    //Response.Cookies.Values['Test'] := 'Halo';
    247236    //Response.Cookies.Values['Test2'] := 'Halo2';
    248237
    249     HTTPServer.SessionHandler.Variables.Values['Session1'] := 'Value1';
     238    //HTTPServer.SessionHandler.Variables.Values['Session1'] := 'Value1';
    250239    //HTTPServer.SessionHandler.Variables.Values['Session2'] := 'Value2';
    251240
     
    263252
    264253    WriteString('<h5>Session variables</h5>');
    265     for I := 0 to HTTPServer.SessionHandler.Variables.Count - 1 do begin;
    266       WriteString(HTTPServer.SessionHandler.Variables.Strings[I] + '<br/>');
     254    for I := 0 to Session.Count - 1 do begin;
     255      WriteString(Session.Strings[I] + '<br/>');
    267256    end;
    268257
     
    275264end;
    276265
    277 procedure TWebServer.SendIndex(Request: THTTPRequest; Response: THTTPResponse);
    278 begin
    279   with Response, Stream do
     266procedure TWebServer.SendIndex(HandlerData: THTTPHandlerData);
     267begin
     268  with HandlerData, Response, Stream do
    280269  begin
    281270    WriteHeader(Stream);
    282     WriteString('<img src="logo.png"/><br/>');
    283     WriteString('<strong>Congratulations</strong>');
    284     WriteString('<hr/>');
    285     WriteString('Your PWU LightWebServer based application is running.<br/>');
    286     WriteString('<hr/>');
    287     WriteString('Generated ' + RFC822DateTime(Now) + ' by PWU LightWebServer.');
     271
     272
    288273    WriteFooter(Stream);
    289274  end;
     
    324309begin
    325310  inherited Create;
    326   HTTPSessionFile := THTTPSessionFile.Create;
    327   with HTTPSessionFile do begin
    328   end;
     311  DatabasePool := TDatabasePool.Create;
     312  DatabasePool.Capacity := 20;
     313  DatabasePool.Allocate;
     314
     315  SessionStorage := TFileHTTPSessionStorage.Create;
    329316  HTTPServer := THTTPServer.Create;
    330317  with HTTPServer, Socket do begin
    331     SessionHandler := HTTPSessionFile;
     318    SessionStorage := Self.SessionStorage;
    332319    DocumentRoot := 'Data';
    333320    with RequestHandlerList do begin
     
    346333destructor TWebServer.Destroy;
    347334begin
     335  DatabasePool.Destroy;
    348336  HTTPServer.Destroy;
    349   HTTPSessionFile.Destroy;
     337  SessionStorage.Destroy;
    350338  inherited Destroy;
    351339end;
    352340
     341{ TDatabasePool }
     342
     343procedure TDatabasePool.Allocate;
     344var
     345  I: Integer;
     346begin
     347  for I := 0 to PoolSize - 1 do
     348    with TSqlDatabase(Items[Add(TSqlDatabase.Create)]) do begin
     349      HostName := Self.HostName;
     350      UserName := Self.UserName;
     351      Password := Self.Password;
     352      Database := Self.Schema;
     353      Connect;
     354    end;
     355end;
     356
     357function TDatabasePool.Acquire: TSqlDatabase;
     358begin
     359
     360end;
     361
     362procedure TDatabasePool.Release(Database: TSqlDatabase);
     363begin
     364  try
     365    Lock.Acquire;
     366
     367  finally
     368    Lock.Release;
     369  end;
     370end;
     371
     372constructor TDatabasePool.Create;
     373begin
     374  Lock := TCriticalSection.Create;
     375end;
     376
     377destructor TDatabasePool.Destroy;
     378begin
     379  Lock.Destroy;
     380  inherited Destroy;
     381end;
     382
    353383end.
    354384
  • branches/DirectWeb/WoWHostingWebServer.lpi

    r87 r88  
    3737      </Item1>
    3838    </RequiredPackages>
    39     <Units Count="27">
     39    <Units Count="37">
    4040      <Unit0>
    4141        <Filename Value="WoWHostingWebServer.lpr"/>
    4242        <IsPartOfProject Value="True"/>
    4343        <UnitName Value="WoWHostingWebServer"/>
    44         <CursorPos X="26" Y="20"/>
     44        <CursorPos X="32" Y="12"/>
    4545        <TopLine Value="1"/>
    4646        <EditorIndex Value="0"/>
     
    5252        <CursorPos X="1" Y="1"/>
    5353        <TopLine Value="1"/>
    54         <UsageCount Value="196"/>
     54        <UsageCount Value="191"/>
    5555        <SyntaxHighlighter Value="None"/>
    5656      </Unit1>
     
    5858        <Filename Value="mimetable.pp"/>
    5959        <UnitName Value="mimetable"/>
    60         <UsageCount Value="196"/>
     60        <UsageCount Value="191"/>
    6161      </Unit2>
    6262      <Unit3>
    6363        <Filename Value="BreakTokens.pp"/>
    6464        <UnitName Value="BreakTokens"/>
    65         <UsageCount Value="196"/>
     65        <UsageCount Value="191"/>
    6666      </Unit3>
    6767      <Unit4>
     
    7070        <CursorPos X="3" Y="208"/>
    7171        <TopLine Value="202"/>
    72         <UsageCount Value="200"/>
     72        <UsageCount Value="195"/>
    7373      </Unit4>
    7474      <Unit5>
     
    7676        <IsPartOfProject Value="True"/>
    7777        <UnitName Value="UHTTPServer"/>
    78         <CursorPos X="9" Y="169"/>
    79         <TopLine Value="146"/>
    80         <EditorIndex Value="3"/>
     78        <CursorPos X="80" Y="119"/>
     79        <TopLine Value="102"/>
     80        <EditorIndex Value="11"/>
    8181        <UsageCount Value="200"/>
    8282        <Loaded Value="True"/>
     
    8484      <Unit6>
    8585        <Filename Value="..\..\..\..\..\Programy\Lazarus_0.9.29\fpc\2.3.1\source\rtl\objpas\classes\classesh.inc"/>
    86         <CursorPos X="14" Y="556"/>
    87         <TopLine Value="539"/>
    88         <UsageCount Value="77"/>
     86        <CursorPos X="14" Y="1436"/>
     87        <TopLine Value="1419"/>
     88        <EditorIndex Value="8"/>
     89        <UsageCount Value="96"/>
     90        <Loaded Value="True"/>
    8991      </Unit6>
    9092      <Unit7>
     
    9395        <CursorPos X="15" Y="397"/>
    9496        <TopLine Value="380"/>
    95         <UsageCount Value="100"/>
     97        <UsageCount Value="95"/>
    9698      </Unit7>
    9799      <Unit8>
     
    99101        <IsPartOfProject Value="True"/>
    100102        <UnitName Value="UTCPServer"/>
    101         <CursorPos X="1" Y="1"/>
    102         <TopLine Value="1"/>
    103         <EditorIndex Value="2"/>
     103        <CursorPos X="5" Y="23"/>
     104        <TopLine Value="6"/>
     105        <EditorIndex Value="3"/>
    104106        <UsageCount Value="200"/>
    105107        <Loaded Value="True"/>
     
    111113        <CursorPos X="23" Y="116"/>
    112114        <TopLine Value="92"/>
    113         <EditorIndex Value="5"/>
    114115        <UsageCount Value="200"/>
    115         <Loaded Value="True"/>
    116116      </Unit9>
    117117      <Unit10>
     
    120120        <CursorPos X="54" Y="330"/>
    121121        <TopLine Value="327"/>
    122         <UsageCount Value="12"/>
     122        <UsageCount Value="7"/>
    123123      </Unit10>
    124124      <Unit11>
     
    128128        <CursorPos X="24" Y="61"/>
    129129        <TopLine Value="1"/>
    130         <UsageCount Value="78"/>
     130        <UsageCount Value="130"/>
    131131      </Unit11>
    132132      <Unit12>
     
    134134        <CursorPos X="41" Y="704"/>
    135135        <TopLine Value="690"/>
    136         <UsageCount Value="11"/>
     136        <UsageCount Value="6"/>
    137137      </Unit12>
    138138      <Unit13>
     
    140140        <CursorPos X="9" Y="356"/>
    141141        <TopLine Value="348"/>
    142         <UsageCount Value="11"/>
     142        <UsageCount Value="6"/>
    143143      </Unit13>
    144144      <Unit14>
     
    148148        <CursorPos X="3" Y="130"/>
    149149        <TopLine Value="121"/>
    150         <EditorIndex Value="7"/>
    151         <UsageCount Value="77"/>
    152         <Loaded Value="True"/>
     150        <UsageCount Value="129"/>
    153151      </Unit14>
    154152      <Unit15>
     
    158156        <CursorPos X="26" Y="28"/>
    159157        <TopLine Value="25"/>
    160         <EditorIndex Value="6"/>
    161         <UsageCount Value="77"/>
    162         <Loaded Value="True"/>
     158        <UsageCount Value="129"/>
    163159      </Unit15>
    164160      <Unit16>
    165161        <Filename Value="USqlDatabase.pas"/>
     162        <IsPartOfProject Value="True"/>
    166163        <UnitName Value="USqlDatabase"/>
    167         <CursorPos X="24" Y="345"/>
    168         <TopLine Value="330"/>
    169         <UsageCount Value="36"/>
     164        <CursorPos X="3" Y="316"/>
     165        <TopLine Value="314"/>
     166        <UsageCount Value="76"/>
    170167      </Unit16>
    171168      <Unit17>
     
    173170        <CursorPos X="52" Y="6"/>
    174171        <TopLine Value="1392"/>
    175         <UsageCount Value="10"/>
     172        <UsageCount Value="5"/>
    176173      </Unit17>
    177174      <Unit18>
     
    179176        <CursorPos X="29" Y="275"/>
    180177        <TopLine Value="260"/>
    181         <UsageCount Value="10"/>
     178        <UsageCount Value="5"/>
    182179      </Unit18>
    183180      <Unit19>
    184181        <Filename Value="..\..\..\..\..\Programy\Lazarus_0.9.29\fpc\2.3.1\source\rtl\win\tthread.inc"/>
    185         <CursorPos X="17" Y="37"/>
    186         <TopLine Value="30"/>
    187         <UsageCount Value="9"/>
     182        <CursorPos X="3" Y="113"/>
     183        <TopLine Value="97"/>
     184        <EditorIndex Value="9"/>
     185        <UsageCount Value="30"/>
     186        <Loaded Value="True"/>
    188187      </Unit19>
    189188      <Unit20>
     
    192191        <CursorPos X="27" Y="2"/>
    193192        <TopLine Value="1"/>
    194         <UsageCount Value="6"/>
     193        <UsageCount Value="1"/>
    195194      </Unit20>
    196195      <Unit21>
     
    198197        <IsPartOfProject Value="True"/>
    199198        <UnitName Value="UWebServer"/>
    200         <CursorPos X="7" Y="247"/>
    201         <TopLine Value="237"/>
     199        <CursorPos X="12" Y="10"/>
     200        <TopLine Value="12"/>
    202201        <EditorIndex Value="1"/>
    203         <UsageCount Value="67"/>
     202        <UsageCount Value="119"/>
    204203        <Loaded Value="True"/>
    205204      </Unit21>
     
    209208        <CursorPos X="25" Y="58"/>
    210209        <TopLine Value="31"/>
    211         <UsageCount Value="10"/>
     210        <UsageCount Value="5"/>
    212211      </Unit22>
    213212      <Unit23>
     
    216215        <CursorPos X="32" Y="11"/>
    217216        <TopLine Value="1"/>
    218         <EditorIndex Value="8"/>
    219         <UsageCount Value="25"/>
    220         <Loaded Value="True"/>
     217        <UsageCount Value="77"/>
    221218        <SyntaxHighlighter Value="XML"/>
    222219      </Unit23>
     
    226223        <CursorPos X="77" Y="4"/>
    227224        <TopLine Value="1"/>
    228         <UsageCount Value="25"/>
     225        <UsageCount Value="77"/>
    229226        <SyntaxHighlighter Value="None"/>
    230227      </Unit24>
     
    234231        <CursorPos X="1" Y="19"/>
    235232        <TopLine Value="1"/>
    236         <UsageCount Value="20"/>
     233        <UsageCount Value="15"/>
    237234      </Unit25>
    238235      <Unit26>
     
    240237        <IsPartOfProject Value="True"/>
    241238        <UnitName Value="UHTTPSessionFile"/>
    242         <CursorPos X="33" Y="31"/>
    243         <TopLine Value="19"/>
     239        <CursorPos X="35" Y="8"/>
     240        <TopLine Value="1"/>
     241        <EditorIndex Value="12"/>
     242        <UsageCount Value="74"/>
     243        <Loaded Value="True"/>
     244      </Unit26>
     245      <Unit27>
     246        <Filename Value="UHTMLControls.pas"/>
     247        <IsPartOfProject Value="True"/>
     248        <UnitName Value="UHTMLControls"/>
     249        <CursorPos X="40" Y="60"/>
     250        <TopLine Value="33"/>
     251        <EditorIndex Value="2"/>
     252        <UsageCount Value="72"/>
     253        <Loaded Value="True"/>
     254      </Unit27>
     255      <Unit28>
     256        <Filename Value="..\..\..\..\..\Programy\Lazarus_0.9.29\fpc\2.3.1\source\rtl\inc\threadh.inc"/>
     257        <CursorPos X="11" Y="154"/>
     258        <TopLine Value="130"/>
     259        <EditorIndex Value="5"/>
     260        <UsageCount Value="12"/>
     261        <Loaded Value="True"/>
     262      </Unit28>
     263      <Unit29>
     264        <Filename Value="..\..\..\..\..\Programy\Lazarus_0.9.29\fpc\2.3.1\source\rtl\win\sysosh.inc"/>
     265        <CursorPos X="3" Y="33"/>
     266        <TopLine Value="1"/>
     267        <UsageCount Value="5"/>
     268      </Unit29>
     269      <Unit30>
     270        <Filename Value="..\..\..\..\..\Programy\Lazarus_0.9.29\fpc\2.3.1\source\packages\fcl-base\src\syncobjs.pp"/>
     271        <UnitName Value="syncobjs"/>
     272        <CursorPos X="4" Y="60"/>
     273        <TopLine Value="43"/>
    244274        <EditorIndex Value="4"/>
    245         <UsageCount Value="22"/>
    246         <Loaded Value="True"/>
    247       </Unit26>
     275        <UsageCount Value="30"/>
     276        <Loaded Value="True"/>
     277      </Unit30>
     278      <Unit31>
     279        <Filename Value="..\..\..\..\..\Programy\Lazarus_0.9.29\fpc\2.3.1\source\rtl\inc\objpash.inc"/>
     280        <CursorPos X="8" Y="170"/>
     281        <TopLine Value="153"/>
     282        <UsageCount Value="10"/>
     283      </Unit31>
     284      <Unit32>
     285        <Filename Value="..\..\..\..\..\Programy\Lazarus_0.9.29\fpc\2.3.1\source\rtl\win\wininc\func.inc"/>
     286        <CursorPos X="10" Y="142"/>
     287        <TopLine Value="125"/>
     288        <UsageCount Value="6"/>
     289      </Unit32>
     290      <Unit33>
     291        <Filename Value="..\..\..\..\..\Programy\Lazarus_0.9.29\fpc\2.3.1\source\rtl\objpas\classes\lists.inc"/>
     292        <CursorPos X="12" Y="102"/>
     293        <TopLine Value="100"/>
     294        <UsageCount Value="6"/>
     295      </Unit33>
     296      <Unit34>
     297        <Filename Value="..\..\..\..\..\Programy\Lazarus_0.9.29\fpc\2.3.1\source\packages\fcl-base\src\contnrs.pp"/>
     298        <UnitName Value="contnrs"/>
     299        <CursorPos X="26" Y="72"/>
     300        <TopLine Value="64"/>
     301        <EditorIndex Value="7"/>
     302        <UsageCount Value="30"/>
     303        <Loaded Value="True"/>
     304      </Unit34>
     305      <Unit35>
     306        <Filename Value="UPool.pas"/>
     307        <IsPartOfProject Value="True"/>
     308        <UnitName Value="UPool"/>
     309        <CursorPos X="3" Y="86"/>
     310        <TopLine Value="82"/>
     311        <EditorIndex Value="6"/>
     312        <UsageCount Value="60"/>
     313        <Loaded Value="True"/>
     314      </Unit35>
     315      <Unit36>
     316        <Filename Value="UResetableThread.pas"/>
     317        <IsPartOfProject Value="True"/>
     318        <UnitName Value="UResetableThread"/>
     319        <CursorPos X="3" Y="22"/>
     320        <TopLine Value="5"/>
     321        <EditorIndex Value="10"/>
     322        <UsageCount Value="59"/>
     323        <Loaded Value="True"/>
     324      </Unit36>
    248325    </Units>
    249326    <JumpHistory Count="30" HistoryIndex="29">
    250327      <Position1>
    251         <Filename Value="UHTTPServer.pas"/>
    252         <Caret Line="312" Column="1" TopLine="295"/>
     328        <Filename Value="UTCPServer.pas"/>
     329        <Caret Line="57" Column="24" TopLine="34"/>
    253330      </Position1>
    254331      <Position2>
    255         <Filename Value="UHTTPServer.pas"/>
    256         <Caret Line="313" Column="1" TopLine="296"/>
     332        <Filename Value="UTCPServer.pas"/>
     333        <Caret Line="32" Column="38" TopLine="15"/>
    257334      </Position2>
    258335      <Position3>
    259         <Filename Value="UHTTPServer.pas"/>
    260         <Caret Line="314" Column="1" TopLine="297"/>
     336        <Filename Value="UPool.pas"/>
     337        <Caret Line="33" Column="24" TopLine="6"/>
    261338      </Position3>
    262339      <Position4>
    263         <Filename Value="UHTTPServer.pas"/>
    264         <Caret Line="315" Column="1" TopLine="298"/>
     340        <Filename Value="UTCPServer.pas"/>
     341        <Caret Line="32" Column="39" TopLine="15"/>
    265342      </Position4>
    266343      <Position5>
    267         <Filename Value="UHTTPServer.pas"/>
    268         <Caret Line="316" Column="1" TopLine="299"/>
     344        <Filename Value="UTCPServer.pas"/>
     345        <Caret Line="58" Column="24" TopLine="39"/>
    269346      </Position5>
    270347      <Position6>
    271         <Filename Value="UHTTPServer.pas"/>
    272         <Caret Line="317" Column="1" TopLine="300"/>
     348        <Filename Value="UTCPServer.pas"/>
     349        <Caret Line="57" Column="30" TopLine="34"/>
    273350      </Position6>
    274351      <Position7>
    275         <Filename Value="UHTTPServer.pas"/>
    276         <Caret Line="315" Column="1" TopLine="298"/>
     352        <Filename Value="UTCPServer.pas"/>
     353        <Caret Line="218" Column="24" TopLine="195"/>
    277354      </Position7>
    278355      <Position8>
    279         <Filename Value="UHTTPServer.pas"/>
    280         <Caret Line="316" Column="1" TopLine="299"/>
     356        <Filename Value="UTCPServer.pas"/>
     357        <Caret Line="133" Column="65" TopLine="116"/>
    281358      </Position8>
    282359      <Position9>
    283         <Filename Value="UHTTPServer.pas"/>
    284         <Caret Line="317" Column="1" TopLine="300"/>
     360        <Filename Value="UTCPServer.pas"/>
     361        <Caret Line="135" Column="22" TopLine="118"/>
    285362      </Position9>
    286363      <Position10>
    287         <Filename Value="UHTTPServer.pas"/>
    288         <Caret Line="315" Column="1" TopLine="298"/>
     364        <Filename Value="UTCPServer.pas"/>
     365        <Caret Line="193" Column="8" TopLine="190"/>
    289366      </Position10>
    290367      <Position11>
    291         <Filename Value="UHTTPServer.pas"/>
    292         <Caret Line="316" Column="1" TopLine="299"/>
     368        <Filename Value="UTCPServer.pas"/>
     369        <Caret Line="134" Column="25" TopLine="117"/>
    293370      </Position11>
    294371      <Position12>
    295         <Filename Value="UHTTPServer.pas"/>
    296         <Caret Line="317" Column="1" TopLine="300"/>
     372        <Filename Value="UTCPServer.pas"/>
     373        <Caret Line="25" Column="17" TopLine="8"/>
    297374      </Position12>
    298375      <Position13>
    299         <Filename Value="UHTTPServer.pas"/>
    300         <Caret Line="319" Column="1" TopLine="302"/>
     376        <Filename Value="UTCPServer.pas"/>
     377        <Caret Line="134" Column="32" TopLine="117"/>
    301378      </Position13>
    302379      <Position14>
    303         <Filename Value="WoWHostingWebServer.lpr"/>
    304         <Caret Line="1" Column="1" TopLine="1"/>
     380        <Filename Value="UTCPServer.pas"/>
     381        <Caret Line="143" Column="1" TopLine="126"/>
    305382      </Position14>
    306383      <Position15>
    307         <Filename Value="WoWHostingWebServer.lpr"/>
    308         <Caret Line="19" Column="3" TopLine="1"/>
     384        <Filename Value="UTCPServer.pas"/>
     385        <Caret Line="141" Column="1" TopLine="126"/>
    309386      </Position15>
    310387      <Position16>
    311         <Filename Value="UWebServer.pas"/>
    312         <Caret Line="250" Column="57" TopLine="237"/>
     388        <Filename Value="UTCPServer.pas"/>
     389        <Caret Line="135" Column="36" TopLine="119"/>
    313390      </Position16>
    314391      <Position17>
    315         <Filename Value="UHTTPServer.pas"/>
    316         <Caret Line="137" Column="1" TopLine="120"/>
     392        <Filename Value="UTCPServer.pas"/>
     393        <Caret Line="23" Column="13" TopLine="8"/>
    317394      </Position17>
    318395      <Position18>
    319         <Filename Value="WoWHostingWebServer.lpr"/>
    320         <Caret Line="19" Column="1" TopLine="1"/>
     396        <Filename Value="UTCPServer.pas"/>
     397        <Caret Line="148" Column="5" TopLine="130"/>
    321398      </Position18>
    322399      <Position19>
    323         <Filename Value="UHTTPSessionFile.pas"/>
    324         <Caret Line="51" Column="1" TopLine="21"/>
     400        <Filename Value="UTCPServer.pas"/>
     401        <Caret Line="154" Column="12" TopLine="137"/>
    325402      </Position19>
    326403      <Position20>
    327         <Filename Value="UHTTPSessionFile.pas"/>
    328         <Caret Line="29" Column="1" TopLine="12"/>
     404        <Filename Value="UTCPServer.pas"/>
     405        <Caret Line="22" Column="31" TopLine="9"/>
    329406      </Position20>
    330407      <Position21>
    331         <Filename Value="UHTTPSessionFile.pas"/>
    332         <Caret Line="30" Column="1" TopLine="13"/>
     408        <Filename Value="UTCPServer.pas"/>
     409        <Caret Line="26" Column="24" TopLine="9"/>
    333410      </Position21>
    334411      <Position22>
    335         <Filename Value="WoWHostingWebServer.lpr"/>
    336         <Caret Line="16" Column="59" TopLine="1"/>
     412        <Filename Value="UTCPServer.pas"/>
     413        <Caret Line="153" Column="36" TopLine="133"/>
    337414      </Position22>
    338415      <Position23>
    339         <Filename Value="WoWHostingWebServer.lpr"/>
    340         <Caret Line="14" Column="17" TopLine="1"/>
     416        <Filename Value="UTCPServer.pas"/>
     417        <Caret Line="171" Column="25" TopLine="148"/>
    341418      </Position23>
    342419      <Position24>
    343         <Filename Value="UHTTPSessionFile.pas"/>
    344         <Caret Line="29" Column="1" TopLine="12"/>
     420        <Filename Value="UHTTPServer.pas"/>
     421        <Caret Line="35" Column="28" TopLine="35"/>
    345422      </Position24>
    346423      <Position25>
    347         <Filename Value="UHTTPSessionFile.pas"/>
    348         <Caret Line="30" Column="1" TopLine="13"/>
     424        <Filename Value="UHTTPServer.pas"/>
     425        <Caret Line="180" Column="23" TopLine="162"/>
    349426      </Position25>
    350427      <Position26>
    351         <Filename Value="UHTTPSessionFile.pas"/>
    352         <Caret Line="33" Column="1" TopLine="16"/>
     428        <Filename Value="UHTTPServer.pas"/>
     429        <Caret Line="119" Column="37" TopLine="102"/>
    353430      </Position26>
    354431      <Position27>
    355         <Filename Value="UHTTPSessionFile.pas"/>
    356         <Caret Line="37" Column="1" TopLine="20"/>
     432        <Filename Value="WoWHostingWebServer.lpr"/>
     433        <Caret Line="15" Column="26" TopLine="1"/>
    357434      </Position27>
    358435      <Position28>
    359         <Filename Value="UWebServer.pas"/>
    360         <Caret Line="247" Column="7" TopLine="237"/>
     436        <Filename Value="WoWHostingWebServer.lpr"/>
     437        <Caret Line="25" Column="1" TopLine="1"/>
    361438      </Position28>
    362439      <Position29>
    363440        <Filename Value="WoWHostingWebServer.lpr"/>
    364         <Caret Line="14" Column="17" TopLine="1"/>
     441        <Caret Line="18" Column="24" TopLine="1"/>
    365442      </Position29>
    366443      <Position30>
    367444        <Filename Value="WoWHostingWebServer.lpr"/>
    368         <Caret Line="22" Column="14" TopLine="1"/>
     445        <Caret Line="21" Column="18" TopLine="1"/>
    369446      </Position30>
    370447    </JumpHistory>
  • branches/DirectWeb/WoWHostingWebServer.lpr

    r87 r88  
    1010  {$ENDIF}
    1111{$ENDIF}
    12   Classes,
    13   SysUtils, UWebServer, UHTTPSessionFile;
     12  Classes, SysUtils, UWebServer;
    1413
    1514{$IFDEF WINDOWS}{$R WoWHostingWebServer.rc}{$ENDIF}
Note: See TracChangeset for help on using the changeset viewer.