Update of /cvsroot/swebs/swebswebserver/winui/ccHTTP
In directory sc8-pr-cvs1:/tmp/cvs-serv12370/swebswebserver/winui/ccHTTP
Added Files:
basMain.bas cHTTP.cls cHTTPCGI.cls cHTTPCGICol.cls
cHTTPConfig.cls cHTTPIndex.cls cHTTPIndexCol.cls
cHTTPStats.cls cHTTPVirtHost.cls cHTTPVirtHostCol.cls
ccHTTP.csi ccHTTP.dll ccHTTP.exp ccHTTP.lib ccHTTP.lvw
ccHTTP.vbp ccHTTP.vbw
Log Message:
Ok, now this is a big update, I went ahead with the core/ui split I talked about a while back, this isn't done yet so dont try to use it, just commiting 'just in case'
--- NEW FILE: basMain.bas ---
Attribute VB_Name = "basMain"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Public Util As cUtil
Public Translator As cTranslate
Public Sub Main()
Set Util = New cUtil
Set Translator = New cTranslate
End Sub
--- NEW FILE: cHTTP.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cHTTP"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Public Stats As cHTTPStats
Public Config As cHTTPConfig
Private Declare Function WebStart Lib "sHTTP.dll" Alias "SWEBSStart" () As Long
Private Declare Function WebStop Lib "sHTTP.dll" Alias "SWEBSStop" () As Long
Private blnRunning As Boolean
'swebs.dll error codes
Private Const SWEBS_RETURN_UNKNOWN = &H0 '// Unknown error occured
Private Const SWEBS_RETURN_SUCCESS = &H1 '// Server ran fine
Private Const SWEBS_RETURN_COULDNOTBIND = &H2 '// Could not bind() to port
Private Const SWEBS_RETURN_CONFIGNOTLOADED = &H3 '// Could not load config file
Private Const SWEBS_RETURN_COULDNOTLISTEN = &H4 '// Could not listen()
Private Const SWEBS_RETURN_COULDNOTACCEPT = &H5 '// Could not accept()
Public Function StopServer() As Boolean
Dim lngRetVal As Long
lngRetVal = WebStop
blnRunning = False
End Function
Public Function StartServer() As Boolean
Dim lngRetVal As Long
lngRetVal = WebStart
If lngRetVal = SWEBS_RETURN_SUCCESS Then
blnRunning = True
Else
MsgBox "Server Failed to start. Error code is: 0x" & lngRetVal
End If
End Function
Public Property Get Status() As String
If blnRunning = True Then
Status = "Running"
Else
Status = "Stopped"
End If
End Property
'CSEH: WinUI - Custom(No Stack)
Private Sub Class_Initialize()
Set Stats = New cHTTPStats
Set Config = New cHTTPConfig
End Sub
Private Sub Class_Terminate()
Set Stats = Nothing
Set Config = Nothing
End Sub
--- NEW FILE: cHTTPCGI.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cHTTPISAPI"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable(s) to hold property value(s)
Private mvarInterpreter As String 'local copy
Private mvarExtension As String 'local copy
Public Property Let Extension(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Extention = 5
mvarExtension = vData
End Property
Public Property Get Extension() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Extention
Extension = mvarExtension
End Property
Public Property Let Interpreter(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Interpreter = 5
mvarInterpreter = vData
End Property
Public Property Get Interpreter() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Interpreter
Interpreter = mvarInterpreter
End Property
--- NEW FILE: cHTTPCGICol.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cHTTPISAPICol"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Collection" ,"cCGI"
Attribute VB_Ext_KEY = "Member0" ,"cCGI"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable to hold collection
Private mCol As Collection
Public Function Add(Interpreter As String, Extension As String, Optional sKey As String) As cHTTPISAPI
'create a new object
Dim objNewMember As cHTTPISAPI
Set objNewMember = New cHTTPISAPI
'set the properties passed into the method
objNewMember.Interpreter = Interpreter
objNewMember.Extension = Extension
If Len(sKey) = 0 Then
mCol.Add objNewMember
Else
mCol.Add objNewMember, sKey
End If
'return the object created
Set Add = objNewMember
Set objNewMember = Nothing
End Function
Public Property Get Item(vntIndexKey As Variant) As cHTTPISAPI
Attribute Item.VB_UserMemId = 0
'used when referencing an element in the collection
'vntIndexKey contains either the Index or Key to the collection,
'this is why it is declared as a Variant
'Syntax: Set foo = x.Item(xyz) or Set foo = x.Item(5)
Set Item = mCol(vntIndexKey)
End Property
Public Property Get Count() As Long
'used when retrieving the number of elements in the
'collection. Syntax: Debug.Print x.Count
Count = mCol.Count
End Property
Public Sub Remove(vntIndexKey As Variant)
'used when removing an element from the collection
'vntIndexKey contains either the Index or Key, which is why
'it is declared as a Variant
'Syntax: x.Remove(xyz)
mCol.Remove vntIndexKey
End Sub
Public Property Get NewEnum() As IUnknown
Attribute NewEnum.VB_UserMemId = -4
Attribute NewEnum.VB_MemberFlags = "40"
'this property allows you to enumerate
'this collection with the For...Each syntax
Set NewEnum = mCol.[_NewEnum]
End Property
'CSEH: WinUI - Custom(No Stack)
Private Sub Class_Initialize()
'creates the collection when this class is created
Set mCol = New Collection
End Sub
Private Sub Class_Terminate()
'destroys collection when this class is terminated
Set mCol = Nothing
End Sub
Public Function Clear()
'destroys collection
Set mCol = Nothing
'creates the collection
Set mCol = New Collection
End Function
--- NEW FILE: cHTTPConfig.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cHTTPConfig"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Attribute VB_Ext_KEY = "Member0" ,"colvHost"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Public VirtHost As cHTTPVirtHostCol
Public ISAPI As cHTTPISAPICol
Public Index As cHTTPIndexCol
'local variable(s) to hold property value(s)
Private mvarServerName As String
Private mvarPort As Integer
Private mvarWebRoot As String
Private mvarMaxConnections As Long
Private mvarLogFile As String
Private mvarAllowIndex As String
Private mvarErrorPages As String
Private mvarListeningAddress As String
Private mvarErrorLog As String
Private mvarFile As String
'CSEH: WinUI - Custom(No Stack)
Private Sub Class_Initialize()
Set VirtHost = New cHTTPVirtHostCol
Set ISAPI = New cHTTPISAPICol
Set Index = New cHTTPIndexCol
End Sub
Private Sub Class_Terminate()
Set VirtHost = Nothing
Set ISAPI = Nothing
Set Index = Nothing
End Sub
Public Sub Setup()
mvarFile = Util.GetRegistryString(&H80000002, "SOFTWARE\SWS", "ConfigFile")
End Sub
Public Function LoadData() As Boolean
Dim XML As CHILKATXMLLib.XmlFactory
Dim ConfigXML As CHILKATXMLLib.IChilkatXml
Dim Node As CHILKATXMLLib.IChilkatXml
Dim strTemp As String
Set XML = New XmlFactory
Set ConfigXML = XML.NewXml
ConfigXML.LoadXmlFile mvarFile
'<ServerName>
Set Node = ConfigXML.SearchForTag(Nothing, "ServerName")
If Node Is Nothing Then
mvarServerName = "SWEBS Server"
Else
mvarServerName = Trim$(Node.Content)
End If
'<Port>
Set Node = ConfigXML.SearchForTag(Nothing, "Port")
If Node Is Nothing Then
mvarPort = 80
Else
mvarPort = IIf(Int(Val(Node.Content)) <= 0, 80, Int(Val(Node.Content)))
End If
'<Webroot>
Set Node = ConfigXML.SearchForTag(Nothing, "Webroot")
If Node Is Nothing Then
strTemp = "C:\SWS\Webroot" 'TODO: Fix Me!
Else
strTemp = Trim$(Node.Content)
End If
mvarWebRoot = IIf(Right$(strTemp, 1) = "\", Left$(strTemp, (Len(strTemp) - 1)), strTemp)
'<MaxConnections>
Set Node = ConfigXML.SearchForTag(Nothing, "MaxConnections")
If Node Is Nothing Then
mvarMaxConnections = 20
Else
mvarMaxConnections = IIf(Int(Val(Node.Content)) <= 0, 20, Int(Val(Node.Content)))
End If
'<LogFile>
Set Node = ConfigXML.SearchForTag(Nothing, "LogFile")
If Node Is Nothing Then
mvarLogFile = "C:\SWS\SWS.log" 'TODO: Fix Me!
Else
mvarLogFile = Trim$(Node.Content)
End If
'<AllowIndex>
Set Node = ConfigXML.SearchForTag(Nothing, "AllowIndex")
If Node Is Nothing Then
mvarAllowIndex = "false"
Else
mvarAllowIndex = IIf(LCase$(Node.Content) = "true", "true", "false")
End If
'<ErrorPages>
Set Node = ConfigXML.SearchForTag(Nothing, "ErrorPages")
If Node Is Nothing Then
strTemp = "C:\SWS\Errors" 'TODO: Fix Me!
Else
strTemp = Trim$(Node.Content)
End If
mvarErrorPages = IIf(Right$(strTemp, 1) = "\", Left$(strTemp, (Len(strTemp) - 1)), strTemp)
'<ErrorLog>
Set Node = ConfigXML.SearchForTag(Nothing, "ErrorLog")
If Node Is Nothing Then
mvarErrorLog = "C:\SWS\ErrorLog.log" 'TODO: Fix Me!
Else
mvarErrorLog = Trim$(Node.Content)
End If
'<IndexFile>
Set Node = ConfigXML.SearchForTag(Nothing, "IndexFile")
If Node Is Nothing Then
Index.Add "index.html"
Else
Do While Not (Node Is Nothing)
If Trim$(Node.Content) <> "" Then
Index.Add Trim$(Node.Content)
End If
Set Node = ConfigXML.SearchForTag(Node, "IndexFile")
Loop
End If
'<VirtualHost>
Set Node = ConfigXML.FindChild("VirtualHost")
If Not (Node Is Nothing) Then
Do While Not (Node Is Nothing)
If Node.GetChildContent("vhName") <> "" Then
VirtHost.Add Trim$(Node.GetChildContent("vhName")), Trim$(Node.GetChildContent("vhHostName")), Trim$(Node.GetChildContent("vhRoot")), Trim$(Node.GetChildContent("vhLogFile")), Trim$(Node.GetChildContent("vhName"))
End If
Set Node = ConfigXML.SearchForTag(Node, "VirtualHost")
Loop
End If
'<CGI>
Set Node = ConfigXML.FindChild("ISAPI")
If Not (Node Is Nothing) Then
Do While Not (Node Is Nothing)
If Node.GetChildContent("Interpreter") <> "" Then
ISAPI.Add Trim$(Node.GetChildContent("Interpreter")), Trim$(Node.GetChildContent("Extension")), Trim$(Node.GetChildContent("Extension"))
End If
Set Node = ConfigXML.SearchForTag(Node, "ISAPI")
Loop
End If
'<ListeningAddress>
Set Node = ConfigXML.SearchForTag(Nothing, "ListeningAddress")
If Node Is Nothing Then
mvarListeningAddress = ""
Else
mvarListeningAddress = Node.Content
End If
'clean up
Set XML = Nothing
Set ConfigXML = Nothing
Set Node = Nothing
LoadData = True
End Function
Public Property Get File() As String
File = mvarFile
End Property
Public Property Let ErrorLog(ByVal vData As String)
mvarErrorLog = vData
End Property
Public Property Get ErrorLog() As String
ErrorLog = mvarErrorLog
End Property
Public Property Let ListeningAddress(ByVal vData As String)
mvarListeningAddress = vData
End Property
Public Property Get ListeningAddress() As String
ListeningAddress = mvarListeningAddress
End Property
Public Property Let ErrorPages(ByVal vData As String)
mvarErrorPages = vData
End Property
Public Property Get ErrorPages() As String
ErrorPages = mvarErrorPages
End Property
Public Property Let AllowIndex(ByVal vData As String)
mvarAllowIndex = vData
End Property
Public Property Get AllowIndex() As String
AllowIndex = mvarAllowIndex
End Property
Public Property Let LogFile(ByVal vData As String)
mvarLogFile = vData
End Property
Public Property Get LogFile() As String
LogFile = mvarLogFile
End Property
Public Property Let MaxConnections(ByVal vData As Long)
mvarMaxConnections = vData
End Property
Public Property Get MaxConnections() As Long
MaxConnections = mvarMaxConnections
End Property
Public Property Let WebRoot(ByVal vData As String)
mvarWebRoot = vData
End Property
Public Property Get WebRoot() As String
WebRoot = mvarWebRoot
End Property
Public Property Let Port(ByVal vData As Integer)
mvarPort = vData
End Property
Public Property Get Port() As Integer
Port = mvarPort
End Property
Public Property Let ServerName(ByVal vData As String)
mvarServerName = vData
End Property
Public Property Get ServerName() As String
ServerName = mvarServerName
End Property
Public Function Report() As String
Dim strReport As String
Dim strTemp As String
Dim vItem As Variant
strReport = "SWEBS Configuration Report"
strReport = strReport & vbCrLf & Translator.GetText("Date") & ": " & Now
strReport = strReport & vbCrLf & vbCrLf & String$(30, "-") & vbCrLf & vbCrLf
strReport = strReport & Translator.GetText("Server Name") & ": " & mvarServerName & vbCrLf
strReport = strReport & Translator.GetText("Port") & ": & mvarPort & vbCrLf"
strReport = strReport & Translator.GetText("Web Root") & ": " & mvarWebRoot & vbCrLf
strReport = strReport & Translator.GetText("Error Pages") & ": " & mvarErrorPages & vbCrLf
strReport = strReport & Translator.GetText("Max Connections") & ": " & mvarMaxConnections & vbCrLf
strReport = strReport & Translator.GetText("Primary Log File") & ": " & mvarLogFile & vbCrLf
strReport = strReport & Translator.GetText("Allow Index") & ": " & mvarAllowIndex & vbCrLf
strReport = strReport & "Listening Address" & ": " & mvarListeningAddress & vbCrLf
strReport = strReport & "Error Log" & ": " & mvarErrorLog & vbCrLf
For Each vItem In Index
strTemp = strTemp & vItem.FileName & " "
Next
strReport = strReport & "Index Files: " & Trim$(strTemp) & vbCrLf
strReport = strReport & vbCrLf & String$(30, "-") & vbCrLf
For Each vItem In ISAPI
strReport = strReport & Translator.GetText("ISAPI: Extension") & ": " & vItem.Extension & " " & Translator.GetText("Interpreter") & ": " & vItem.Interpreter & vbCrLf
Next
strReport = strReport & vbCrLf & String$(30, "-") & vbCrLf
For Each vItem In VirtHost
strReport = strReport & Translator.GetText("vHost: Name") & ": " & vItem.HostName & " " & Translator.GetText("Host Name") & ": " & vItem.Domain & " " & Translator.GetText("Root Directory") & ": " & vItem.Root & " " & Translator.GetText("Log File") & ": " & vItem.Log & vbCrLf
Next
Report = strReport
End Function
Public Function Save(strCurConfigFile As String) As Boolean
'<CSCM>
'--------------------------------------------------------------------------------
'Project: WinUI
'Procedure: SaveConfigData
' Description: this is where we save the changes to the config data.
'
' returns true on sucess
' Created By: Adam
' Date-Time : 8/25/2003-1:12:28 AM
' Parameters : strCurConfigFile (String)
'--------------------------------------------------------------------------------
'</CSCM>
Dim XML As CHILKATXMLLib.XmlFactory
Dim ConfigXML As CHILKATXMLLib.IChilkatXml
Dim ConfigXML2 As CHILKATXMLLib.IChilkatXml
Dim vItem As Variant
Set XML = New XmlFactory
Set ConfigXML = XML.NewXml
Set ConfigXML2 = XML.NewXml
Set ConfigXML = ConfigXML.NewChild("sws", "")
ConfigXML.NewChild2 "ServerName", mvarServerName
ConfigXML.NewChild2 "Port", mvarPort
ConfigXML.NewChild2 "Webroot", IIf(Right$(mvarWebRoot, 1) = "\", Left$(mvarWebRoot, (Len(mvarWebRoot) - 1)), mvarWebRoot)
ConfigXML.NewChild2 "ErrorPages", IIf(Right$(mvarErrorPages, 1) = "\", Left$(mvarErrorPages, (Len(mvarErrorPages) - 1)), mvarErrorPages)
ConfigXML.NewChild2 "MaxConnections", mvarMaxConnections
ConfigXML.NewChild2 "LogFile", mvarLogFile
ConfigXML.NewChild2 "ErrorLog", mvarErrorLog
If mvarListeningAddress <> "" Then
ConfigXML.NewChild2 "ListeningAddress", mvarListeningAddress
End If
ConfigXML.NewChild2 "AllowIndex", mvarAllowIndex
For Each vItem In Index
ConfigXML.NewChild2 "IndexFile", vItem.FileName
Next
For Each vItem In ISAPI
Set ConfigXML2 = ConfigXML2.NewChild("ISAPI", "")
ConfigXML2.NewChild2 "Interpreter", vItem.Interpreter
ConfigXML2.NewChild2 "Extension", vItem.Extension
ConfigXML.AddChildTree ConfigXML2
Next
For Each vItem In VirtHost
Set ConfigXML2 = ConfigXML2.NewChild("VirtualHost", "")
ConfigXML2.NewChild2 "vhName", vItem.HostName
ConfigXML2.NewChild2 "vhHostName", vItem.Domain
ConfigXML2.NewChild2 "vhRoot", vItem.Root
ConfigXML2.NewChild2 "vhLogFile", vItem.Log
ConfigXML.AddChildTree ConfigXML2
Next
ConfigXML.SaveXml strCurConfigFile
Save = True
End Function
--- NEW FILE: cHTTPIndex.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cHTTPIndex"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable(s) to hold property value(s)
Private mvarFileName As String 'local copy
Public Property Let FileName(ByVal vData As String)
mvarFileName = vData
End Property
Public Property Get FileName() As String
FileName = mvarFileName
End Property
--- NEW FILE: cHTTPIndexCol.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cHTTPIndexCol"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Collection" ,"cIndex"
Attribute VB_Ext_KEY = "Member0" ,"cIndex"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable to hold collection
Private mCol As Collection
Public Function Add(FileName As String, Optional sKey As String) As cHTTPIndex
'create a new object
Dim objNewMember As cHTTPIndex
Set objNewMember = New cHTTPIndex
'set the properties passed into the method
objNewMember.FileName = FileName
If Len(sKey) = 0 Then
mCol.Add objNewMember
Else
mCol.Add objNewMember, sKey
End If
'return the object created
Set Add = objNewMember
Set objNewMember = Nothing
End Function
Public Property Get Item(vntIndexKey As Variant) As cHTTPIndex
Attribute Item.VB_UserMemId = 0
'used when referencing an element in the collection
'vntIndexKey contains either the Index or Key to the collection,
'this is why it is declared as a Variant
'Syntax: Set foo = x.Item(xyz) or Set foo = x.Item(5)
Set Item = mCol(vntIndexKey)
End Property
Public Property Get Count() As Long
'used when retrieving the number of elements in the
'collection. Syntax: Debug.Print x.Count
Count = mCol.Count
End Property
Public Sub Remove(vntIndexKey As Variant)
'used when removing an element from the collection
'vntIndexKey contains either the Index or Key, which is why
'it is declared as a Variant
'Syntax: x.Remove(xyz)
mCol.Remove vntIndexKey
End Sub
Public Property Get NewEnum() As IUnknown
Attribute NewEnum.VB_UserMemId = -4
Attribute NewEnum.VB_MemberFlags = "40"
'this property allows you to enumerate
'this collection with the For...Each syntax
Set NewEnum = mCol.[_NewEnum]
End Property
'CSEH: WinUI - Custom(No Stack)
Private Sub Class_Initialize()
'creates the collection when this class is created
Set mCol = New Collection
End Sub
Private Sub Class_Terminate()
'destroys collection when this class is terminated
Set mCol = Nothing
End Sub
Public Function Clear()
'destroys collection
Set mCol = Nothing
'creates the collection
Set mCol = New Collection
End Function
--- NEW FILE: cHTTPStats.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cHTTPStats"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable(s) to hold property value(s)
Private mvarLastRestart As Date
Private mvarRequestCount As Long
Private mvarTotalBytesSent As Double
Private mvarFile As String
Public Sub Setup()
mvarFile = Util.GetRegistryString(&H80000002, "SOFTWARE\SWS", "StatsFile")
End Sub
Public Property Get File() As String
File = mvarFile
End Property
Public Sub Reload()
Dim XML As CHILKATXMLLib.XmlFactory
Dim StatsXML As CHILKATXMLLib.IChilkatXml
Dim Node As CHILKATXMLLib.IChilkatXml
Set XML = New XmlFactory
Set StatsXML = XML.NewXml
If Dir$(mvarFile) <> "" Then
StatsXML.LoadXmlFile mvarFile
Else
Exit Sub
End If
'<TotalBytesSent>
Set Node = StatsXML.SearchForTag(Nothing, "TotalBytesSent")
If Node Is Nothing Then
mvarTotalBytesSent = 0
Else
mvarTotalBytesSent = Node.Content
End If
'<LastRestart>
Set Node = StatsXML.SearchForTag(Nothing, "LastRestart")
If Node Is Nothing Then
mvarLastRestart = CDate(Now)
Else
mvarLastRestart = CDate(Node.Content)
End If
'<RequestCount>
Set Node = StatsXML.SearchForTag(Nothing, "RequestCount")
If Node Is Nothing Then
mvarRequestCount = 0
Else
mvarRequestCount = Val(Node.Content)
End If
'clean up
Set XML = Nothing
Set StatsXML = Nothing
Set Node = Nothing
End Sub
Public Property Get TotalBytesSent() As Double
TotalBytesSent = mvarTotalBytesSent
End Property
Public Property Get RequestCount() As Long
RequestCount = mvarRequestCount
End Property
Public Property Get LastRestart() As Date
LastRestart = mvarLastRestart
End Property
--- NEW FILE: cHTTPVirtHost.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cHTTPVirtHost"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable(s) to hold property value(s)
Private mvarHostName As String 'local copy
Private mvarDomain As String 'local copy
Private mvarRoot As String 'local copy
Private mvarLog As String 'local copy
Public Property Let Log(ByVal vData As String)
mvarLog = vData
End Property
Public Property Get Log() As String
Log = mvarLog
End Property
Public Property Let Root(ByVal vData As String)
mvarRoot = vData
End Property
Public Property Get Root() As String
Root = mvarRoot
End Property
Public Property Let Domain(ByVal vData As String)
mvarDomain = vData
End Property
Public Property Get Domain() As String
Domain = mvarDomain
End Property
Public Property Let HostName(ByVal vData As String)
mvarHostName = vData
End Property
Public Property Get HostName() As String
HostName = mvarHostName
End Property
--- NEW FILE: cHTTPVirtHostCol.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cHTTPVirtHostCol"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Collection" ,"cvHost"
Attribute VB_Ext_KEY = "Member0" ,"cvHost"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable to hold collection
Private mCol As Collection
Public Function Add(HostName As String, Domain As String, Root As String, Log As String, Optional sKey As String) As cHTTPVirtHost
'create a new object
Dim objNewMember As cHTTPVirtHost
Set objNewMember = New cHTTPVirtHost
'set the properties passed into the method
objNewMember.HostName = HostName
objNewMember.Domain = Domain
objNewMember.Root = Root
objNewMember.Log = Log
If Len(sKey) = 0 Then
mCol.Add objNewMember
Else
mCol.Add objNewMember, sKey
End If
'return the object created
Set Add = objNewMember
Set objNewMember = Nothing
End Function
Public Property Get Item(vntIndexKey As Variant) As cHTTPVirtHost
Attribute Item.VB_UserMemId = 0
'used when referencing an element in the collection
'vntIndexKey contains either the Index or Key to the collection,
'this is why it is declared as a Variant
'Syntax: Set foo = x.Item(xyz) or Set foo = x.Item(5)
Set Item = mCol(vntIndexKey)
End Property
Public Property Get Count() As Long
'used when retrieving the number of elements in the
'collection. Syntax: Debug.Print x.Count
Count = mCol.Count
End Property
Public Sub Remove(vntIndexKey As Variant)
'used when removing an element from the collection
'vntIndexKey contains either the Index or Key, which is why
'it is declared as a Variant
'Syntax: x.Remove(xyz)
mCol.Remove vntIndexKey
End Sub
Public Property Get NewEnum() As IUnknown
Attribute NewEnum.VB_UserMemId = -4
Attribute NewEnum.VB_MemberFlags = "40"
'this property allows you to enumerate
'this collection with the For...Each syntax
Set NewEnum = mCol.[_NewEnum]
End Property
'CSEH: WinUI - Custom(No Stack)
Private Sub Class_Initialize()
'creates the collection when this class is created
Set mCol = New Collection
End Sub
Private Sub Class_Terminate()
'destroys collection when this class is terminated
Set mCol = Nothing
End Sub
Public Function Clear()
'destroys collection
Set mCol = Nothing
'creates the collection
Set mCol = New Collection
End Function
--- NEW FILE: ccHTTP.csi ---
[History]
B0=ccHTTP/cHTTPConfig/LoadData
B1=ccHTTP/cHTTPConfig
--- NEW FILE: ccHTTP.dll ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ccHTTP.exp ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ccHTTP.lib ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ccHTTP.lvw ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ccHTTP.vbp ---
Type=OleDll
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\System32\stdole2.tlb#OLE Automation
Reference=*\G{101F9C56-A0F3-455C-ABBB-191168ABCF94}#1.0#0#C:\SWS\ChilkatXml.dll#Chilkat Xml 4.0.2
Reference=*\G{0C5C47CC-E5CB-4896-A020-0350E9EF2D64}#5.0#0#..\..\..\swebswebserver\winui\ccUtil\ccUtil.dll#
Reference=*\G{44004330-CB01-44A6-9375-50C0E8281B75}#1.0#0#..\..\..\swebswebserver\winui\ccTranslator\ccTranslator.dll#
Class=cHTTP; cHTTP.cls
Class=cHTTPISAPI; cHTTPCGI.cls
Class=cHTTPISAPICol; cHTTPCGICol.cls
Class=cHTTPConfig; cHTTPConfig.cls
Class=cHTTPIndex; cHTTPIndex.cls
Class=cHTTPIndexCol; cHTTPIndexCol.cls
Class=cHTTPStats; cHTTPStats.cls
Class=cHTTPVirtHost; cHTTPVirtHost.cls
Class=cHTTPVirtHostCol; cHTTPVirtHostCol.cls
Module=basMain; basMain.bas
Startup="Sub Main"
HelpFile=""
Title="ccHTTP"
ExeName32="ccHTTP.dll"
Path32="..\..\..\swebswebserver\winui\ccHTTP"
Command32=""
Name="ccHTTP"
HelpContextID="0"
CompatibleMode="1"
CompatibleEXE32="ccHTTP.dll"
MajorVer=1
MinorVer=0
RevisionVer=5
AutoIncrementVer=1
ServerSupportFiles=0
VersionCompanyName="Imspire.com"
CompilationType=-1
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=1
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
DebugStartupOption=0
[MS Transaction Server]
AutoRefresh=1
--- NEW FILE: ccHTTP.vbw ---
cHTTP = 0, 0, 0, 0, C
cHTTPISAPI = 0, 0, 0, 0, C
cHTTPISAPICol = 0, 0, 0, 0, C
cHTTPConfig = 0, 0, 0, 0, C
cHTTPIndex = 0, 0, 0, 0, C
cHTTPIndexCol = 0, 0, 0, 0, C
cHTTPStats = 0, 0, 0, 0, C
cHTTPVirtHost = 0, 0, 0, 0, C
cHTTPVirtHostCol = 0, 0, 0, 0, C
basMain = 0, 0, 0, 0, C
|