Changeset 84
- Timestamp:
- Dec 16, 2009, 12:46:51 PM (15 years ago)
- Location:
- branches/DirectWeb
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DirectWeb/ConfigSample.xml
r82 r84 7 7 <password>password</password> 8 8 </database> 9 <server> 10 <address>0.0.0.0</address> 11 <port>80</port> 12 </server> 9 13 </configuration> -
branches/DirectWeb/ReadMe.txt
r83 r84 2 2 ====================== 3 3 4 1) Instalace požadovaných balíčků: 5 6 yum install mysql-devel 4 7 5 8 6 -
branches/DirectWeb/UTCPServer.pas
r83 r84 79 79 CreateSocket; 80 80 SetLinger(True, 10); 81 WriteLn(Address + ':' + IntToStr(Port)); 81 82 Bind(Address, IntToStr(Port)); 82 If LastError <> 0 then raise Exception.Create('Socket bind error'); 83 WriteLn(LastError); 84 if LastError <> 0 then raise Exception.Create('Socket bind error'); 83 85 Listen; 84 If LastError <> 0 then raise Exception.Create('Socket listen error');86 if LastError <> 0 then raise Exception.Create('Socket listen error'); 85 87 AcceptThread := TAcceptThread.Create(True); 86 88 AcceptThread.Parent := Self; -
branches/DirectWeb/UWebServer.pas
r83 r84 12 12 UMIMEType, Synautil, 13 13 USqlDatabase, DOM, XMLRead; 14 15 const 16 ConfigFileName = 'Config.xml'; 14 17 15 18 type … … 41 44 42 45 procedure TWebServer.LoadConfiguration; 43 const44 ConfigFileName = 'Config.xml';45 46 var 46 47 Config: TXMLDocument; 47 I: Integer; 48 II: Integer; 48 I1: Integer; 49 I2: Integer; 50 I3: Integer; 49 51 begin 50 52 if FileExists(ConfigFileName) then begin 51 53 ReadXMLFile(Config, ConfigFileName); 52 for I := 0 to Config.ChildNodes.Count - 1 do begin 53 if Config.ChildNodes[I].NodeName = 'database' then 54 for II := 0 to Config.ChildNodes[I].ChildNodes.Count - 1 do begin; 55 if Config.ChildNodes[I].ChildNodes[II].NodeName = 'hostname' then 56 HostName := Config.ChildNodes[I].ChildNodes[II].TextContent; 57 if Config.ChildNodes[I].ChildNodes[II].NodeName = 'schema' then 58 Schema := Config.ChildNodes[I].ChildNodes[II].TextContent; 59 if Config.ChildNodes[I].ChildNodes[II].NodeName = 'username' then 60 UserName := Config.ChildNodes[I].ChildNodes[II].TextContent; 61 if Config.ChildNodes[I].ChildNodes[II].NodeName = 'password' then 62 Password := Config.ChildNodes[I].ChildNodes[II].TextContent; 54 for I1 := 0 to Config.ChildNodes.Count - 1 do 55 with Config.ChildNodes[I1] do begin 56 if NodeName = 'configuration' then 57 for I2 := 0 to ChildNodes.Count - 1 do 58 with ChildNodes[I2] do begin 59 if NodeName = 'database' then 60 for I3 := 0 to ChildNodes.Count - 1 do 61 with ChildNodes[I3] do begin 62 if NodeName = 'hostname' then 63 HostName := TextContent; 64 if NodeName = 'schema' then 65 Schema := TextContent; 66 if NodeName = 'username' then 67 UserName := TextContent; 68 if NodeName = 'password' then 69 Password := TextContent; 70 end; 71 if NodeName = 'server' then 72 for I3 := 0 to ChildNodes.Count - 1 do 73 with ChildNodes[I3] do begin 74 if NodeName = 'address' then 75 HTTPServer.Socket.Address := TextContent; 76 if NodeName = 'port' then 77 HTTPServer.Socket.Port := StrToInt(TextContent); 78 end; 63 79 end; 64 80 end; … … 272 288 HTTPServer := THTTPServer.Create; 273 289 with HTTPServer, Socket do begin 274 Address := '0.0.0.0';275 Port := 81;276 290 DocumentRoot := './'; 277 291 with RequestHandlerList do begin -
branches/DirectWeb/WoWHostingWebServer.lpr
r82 r84 3 3 {$mode Delphi}{$H+} 4 4 5 uses {$IFDEF UNIX} {$IFDEF UseCThreads} 6 cthreads, {$ENDIF} {$ENDIF} 5 uses 6 {$IFDEF UNIX} 7 {$DEFINE UseCthreads} 8 {$IFDEF UseCThreads} 9 cthreads, 10 {$ENDIF} 11 {$ENDIF} 7 12 Classes, 8 13 SysUtils, UWebServer;
Note:
See TracChangeset
for help on using the changeset viewer.