142 lines
3.7 KiB
Plaintext
142 lines
3.7 KiB
Plaintext
OpenConsole("Write Default HTTP Config XML Server")
|
|
PrintN("Create default_http_config.xml...")
|
|
|
|
Structure server_http
|
|
enabled.i
|
|
port.i
|
|
binding.s
|
|
max_clients.i
|
|
reuse.b
|
|
thread_id.i
|
|
EndStructure
|
|
|
|
Structure server_https
|
|
enabled.i
|
|
port.i
|
|
binding.s
|
|
max_clients.i
|
|
reuse.b
|
|
CA.s
|
|
Certs.s
|
|
key.s
|
|
key_pass.s
|
|
thread_id.i
|
|
EndStructure
|
|
|
|
Structure server_cache
|
|
time.i
|
|
maxsize.i
|
|
current.i
|
|
enable.i
|
|
EndStructure
|
|
|
|
Structure memory
|
|
MaxFileSize.i
|
|
DefaultBlockSize.i
|
|
EndStructure
|
|
|
|
Structure log_config
|
|
DebuglogUUID.s
|
|
Debugdisable.i
|
|
Accesslog.s
|
|
AccesslogUUID.s
|
|
Errorlog.s
|
|
ErrorlogUUID.s
|
|
Cachelog.s
|
|
CachelogUUID.s
|
|
EndStructure
|
|
|
|
Enumeration http_header_fieldtype
|
|
#http_header_field_Static ;Fieldcontent could be directly used
|
|
#http_header_field_Dynamic_auto ;Must be handled by the Fieldcontent_proc
|
|
EndEnumeration
|
|
|
|
Enumeration http_headerfield_param
|
|
#http_headerfield_param_string
|
|
#http_headerfield_param_map
|
|
#http_headerfield_param_integer
|
|
EndEnumeration
|
|
|
|
Structure http_headerfield_params
|
|
Type.i ;Types of Field #Content or #Map
|
|
Content_string.s ;String Field
|
|
Map Content_Maps.s() ;Map Field
|
|
Content_integer.i ;Integer Field
|
|
EndStructure
|
|
|
|
Structure http_headerfield
|
|
Fieldname.s ; Name bevore : for ex. "keep-alive:"
|
|
Fieldcontent.s ; Content after : for ex. "Keep-Alive"
|
|
Fieldcontent_type.i ; #http_header_field_Static or #http_header_field_Dynamic_auto
|
|
Fieldcontent_proc.i ; A Procedure Prototype to call
|
|
Map Field_proc_parameters.http_headerfield_params() ;Parameters to give to call
|
|
EndStructure
|
|
|
|
XIncludeFile "../../inc/lweb_http_status_header_private.pbi"
|
|
|
|
|
|
Structure host
|
|
description.s
|
|
http.server_http
|
|
https.server_https
|
|
cache.server_cache
|
|
log.log_config
|
|
mem.memory
|
|
defaultfile.s
|
|
basedir.s
|
|
Map status.http_status_codes() ;Individual Error Messages and Headers
|
|
EndStructure
|
|
|
|
Structure config_loader
|
|
name.s
|
|
type.s
|
|
EndStructure
|
|
|
|
Structure server
|
|
Map hosts.host()
|
|
Map status.http_status_codes() ;Default Error Messages and Headers
|
|
Map config_file.config_loader() ;Map Key is Type and string is file
|
|
log.log_config
|
|
mem.memory
|
|
global_max_cli_threads.i ;The maximum Thread Count = 0 unlimited
|
|
global_max_cli_memory.i ;The maximum Used Memory per Client Thread = 0 unlimited
|
|
version.s
|
|
identifikation.s
|
|
type.i
|
|
EndStructure
|
|
|
|
;}
|
|
;*
|
|
|
|
;*
|
|
;* Identifikation des Servers.
|
|
;*
|
|
|
|
Global configuration.server
|
|
configuration\version = "V0.9"
|
|
configuration\identifikation = "LiHaSo Webserver " + configuration\version
|
|
configuration\config_file("status_xml")\name = "cfg/default_http_status_codes.xml"
|
|
configuration\config_file("status_xml")\type = "file"
|
|
configuration\config_file("hosts_dir")\name = "cfg/server/"
|
|
configuration\config_file("hosts_dir")\type = "dir"
|
|
|
|
;*
|
|
;* Diese Parameter müssen entsprechend angepasst sein.
|
|
;* Später ausgelagert in ein nicht synchronisiertes lweb-cfg.pbi
|
|
;* Folgende Parameter müssen im Hauptprogramm definiert sein.
|
|
|
|
configuration\type = 0
|
|
configuration\global_max_cli_memory = 0 ; Unlimited
|
|
configuration\global_max_cli_threads = 0 ; Unlimited
|
|
|
|
|
|
If CreateXML(0)
|
|
InsertXMLStructure(RootXMLNode(0), @configuration, server)
|
|
FormatXML(0, #PB_XML_ReFormat)
|
|
ToSave.s = ComposeXML(0)
|
|
EndIf
|
|
|
|
CreateFile(0, "../cfg/default_http_config.xml")
|
|
WriteString(0, ToSave)
|
|
PrintN("Default config xml created: default_http_config.xml")
|
|
End |