Bugfixes
This commit is contained in:
parent
edccdf62cd
commit
7b315bcc25
8 changed files with 134 additions and 158 deletions
|
@ -4,6 +4,7 @@
|
||||||
;*
|
;*
|
||||||
|
|
||||||
Procedure.s mimetype(file.s)
|
Procedure.s mimetype(file.s)
|
||||||
|
; TODO:Mimetype dynamic configurable via XML
|
||||||
Select LCase(file)
|
Select LCase(file)
|
||||||
Case "pdf"
|
Case "pdf"
|
||||||
ProcedureReturn "application/pdf"
|
ProcedureReturn "application/pdf"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
;* lweb_helper_header.pbi
|
;* lweb_helper_header.pbi
|
||||||
;*
|
;*
|
||||||
|
|
||||||
|
; TODO:Mimetype dynamic configurable via XML
|
||||||
|
|
||||||
Declare.s mimetype(file.s)
|
Declare.s mimetype(file.s)
|
||||||
Declare.s MapToJSONString(Map ConvertMap.s())
|
Declare.s MapToJSONString(Map ConvertMap.s())
|
|
@ -209,58 +209,6 @@
|
||||||
EndIf
|
EndIf
|
||||||
Case #conf_runfile
|
Case #conf_runfile
|
||||||
|
|
||||||
; Case #conf_HTTP_port
|
|
||||||
; configuration\http\port = Val(setting)
|
|
||||||
; Case #conf_HTTPS_Port
|
|
||||||
; configuration\https\port = Val(setting)
|
|
||||||
; Case #conf_HTTP_binding
|
|
||||||
; If IsIPStringValid(setting)
|
|
||||||
; configuration\http\binding = setting
|
|
||||||
; Else
|
|
||||||
; configuration\http\binding = "127.0.0.1"
|
|
||||||
; ProcedureReturn #False
|
|
||||||
; EndIf
|
|
||||||
; Case #conf_HTTPS_Binding
|
|
||||||
; If IsIPStringValid(setting)
|
|
||||||
; configuration\https\binding = setting
|
|
||||||
; Else
|
|
||||||
; configuration\https\binding = "127.0.0.1"
|
|
||||||
; ProcedureReturn #False
|
|
||||||
; EndIf
|
|
||||||
; Case #conf_HTTPS_CA
|
|
||||||
; configuration\https\CA = setting
|
|
||||||
; Case #conf_HTTPS_Cert
|
|
||||||
; configuration\https\Certs = setting
|
|
||||||
; Case #conf_HTTPS_Key
|
|
||||||
; configuration\https\Key = setting
|
|
||||||
; Case #conf_HTTPS_Key_Pass
|
|
||||||
; configuration\https\key_pass = setting
|
|
||||||
; Case #conf_HTTPS_Enable
|
|
||||||
; configuration\https\enabled = Val(setting)
|
|
||||||
; Case #conf_defaultfile
|
|
||||||
; configuration\defaultfile = setting
|
|
||||||
; Case #conf_basedir
|
|
||||||
; configuration\basedir = setting
|
|
||||||
; Case #conf_error400
|
|
||||||
; configuration\error400 = setting ; Kann "integrated" sein wass die integrierte Standard Fehlermeldung hervorruft.
|
|
||||||
; Case #conf_max_HTTP_clients
|
|
||||||
; If MemoryStatus(#PB_System_FreePhysical) > (Val(setting)*(1024*384))
|
|
||||||
; configuration\http\max_clients = Val(setting)
|
|
||||||
; Else
|
|
||||||
; configuration\http\max_clients = 10
|
|
||||||
; ProcedureReturn #False
|
|
||||||
; EndIf
|
|
||||||
; Case #conf_max_HTTPS_clients
|
|
||||||
; If MemoryStatus(#PB_System_FreePhysical) > (Val(setting)*(1024*384))
|
|
||||||
; configuration\https\max_clients = Val(setting)
|
|
||||||
; Else
|
|
||||||
; configuration\https\max_clients = 10
|
|
||||||
; ProcedureReturn #False
|
|
||||||
; EndIf
|
|
||||||
; Case #conf_server_type
|
|
||||||
; configuration\type = Val(setting)
|
|
||||||
; Case #conf_cache_enable
|
|
||||||
; configuration\cache\enable = Val(Setting)
|
|
||||||
Default
|
Default
|
||||||
ProcedureReturn #False
|
ProcedureReturn #False
|
||||||
EndSelect
|
EndSelect
|
||||||
|
@ -285,20 +233,6 @@
|
||||||
Else
|
Else
|
||||||
ProcedureReturn "false"
|
ProcedureReturn "false"
|
||||||
EndIf
|
EndIf
|
||||||
; Case #conf_defaultfile
|
|
||||||
; ProcedureReturn configuration\defaultfile
|
|
||||||
; Case #conf_basedir
|
|
||||||
; ProcedureReturn configuration\basedir
|
|
||||||
; Case #conf_error400
|
|
||||||
; ProcedureReturn configuration\error400
|
|
||||||
; Case #conf_max_HTTP_clients
|
|
||||||
; ProcedureReturn Str(configuration\http\max_clients)
|
|
||||||
; Case #conf_server_type
|
|
||||||
; ProcedureReturn Str(configuration\type)
|
|
||||||
; Case #conf_HTTP_port
|
|
||||||
; ProcedureReturn Str(configuration\http\port)
|
|
||||||
; Case #conf_HTTPS_Port
|
|
||||||
; ProcedureReturn Str(configuration\https\port)
|
|
||||||
Default
|
Default
|
||||||
ProcedureReturn ""
|
ProcedureReturn ""
|
||||||
EndSelect
|
EndSelect
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
;*
|
;*
|
||||||
;* Lihaso Web Server (lhttpd)
|
;* Lihaso Web Server (lhttpd)
|
||||||
;*
|
;*
|
||||||
;* (c)2020 by Linder Hard- und Software
|
;* (c)2024 by Linder Hard- und Software
|
||||||
;*
|
;*
|
||||||
;* V0.5
|
;* V0.5
|
||||||
;* - Simple webserver for HTTP & HTTPS
|
;* - Simple webserver for HTTP & HTTPS
|
||||||
|
|
17
lweb.pbi
17
lweb.pbi
|
@ -266,6 +266,7 @@ Module lhs_web
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure main_server(id.i)
|
Procedure main_server(id.i)
|
||||||
|
ldl::Logging("main Server Loading")
|
||||||
status_defaults()
|
status_defaults()
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
|
@ -1057,14 +1058,14 @@ Module lhs_web
|
||||||
ElseIf response_status <> ""
|
ElseIf response_status <> ""
|
||||||
Header(#http_head_status) = response_status
|
Header(#http_head_status) = response_status
|
||||||
Else
|
Else
|
||||||
Header(#http_head_status) = status_get_message("200")
|
Header(#http_head_status) = status_get_header("200")
|
||||||
EndIf
|
EndIf
|
||||||
If Response(#http_head_set_cookie) <> ""
|
If Response(#http_head_set_cookie) <> ""
|
||||||
Header(#http_head_set_cookie) = Response(#http_head_set_cookie)
|
Header(#http_head_set_cookie) = Response(#http_head_set_cookie)
|
||||||
EndIf
|
EndIf
|
||||||
If thread_redirect = #True
|
If thread_redirect = #True
|
||||||
Header(#http_head_redirect) = file_check(thread_requested, m_clients(Str(thread_cli_id))\host_id)
|
Header(#http_head_redirect) = file_check(thread_requested, m_clients(Str(thread_cli_id))\host_id)
|
||||||
Header(#http_head_status) = status_get_message("303")
|
Header(#http_head_status) = status_get_header("303")
|
||||||
Else
|
Else
|
||||||
Header(#http_head_content_length) = Str(thread_data_size)
|
Header(#http_head_content_length) = Str(thread_data_size)
|
||||||
Header(#http_head_content_type) = thread_type
|
Header(#http_head_content_type) = thread_type
|
||||||
|
@ -1072,7 +1073,9 @@ Module lhs_web
|
||||||
|
|
||||||
Header(#http_head_connection) = "Keep-Alive"
|
Header(#http_head_connection) = "Keep-Alive"
|
||||||
Header(#http_head_keep_alive) = "timeout=15, max=1000"
|
Header(#http_head_keep_alive) = "timeout=15, max=1000"
|
||||||
|
|
||||||
thread_header = http_header_generate(Header())
|
thread_header = http_header_generate(Header())
|
||||||
|
ldl::Logging("Header:"+thread_header)
|
||||||
;large File Handling
|
;large File Handling
|
||||||
If thread_redirect = #True
|
If thread_redirect = #True
|
||||||
thread_buffer = AllocateMemory(StringByteLength(thread_header)+12)
|
thread_buffer = AllocateMemory(StringByteLength(thread_header)+12)
|
||||||
|
@ -1094,7 +1097,7 @@ Module lhs_web
|
||||||
thread_temp_cache_memory = 0
|
thread_temp_cache_memory = 0
|
||||||
ElseIf thread_temp_cache_memory <> 0 And thread_buffer_offset <> 0 And thread_data_size <> 0 And thread_temp_file_readed <> 0 And thread_oversized_file = #True And thread_redirect = #False
|
ElseIf thread_temp_cache_memory <> 0 And thread_buffer_offset <> 0 And thread_data_size <> 0 And thread_temp_file_readed <> 0 And thread_oversized_file = #True And thread_redirect = #False
|
||||||
CopyMemory(thread_temp_cache_memory, thread_buffer_offset, thread_temp_file_readed)
|
CopyMemory(thread_temp_cache_memory, thread_buffer_offset, thread_temp_file_readed)
|
||||||
ldl::Logging("Cache Address Memory:"+Str(thread_temp_cache_memory))
|
ldl::Logging("Oversized Cache Address Memory:"+Str(thread_temp_cache_memory))
|
||||||
FreeMemory(thread_temp_cache_memory)
|
FreeMemory(thread_temp_cache_memory)
|
||||||
thread_temp_cache_memory = 0
|
thread_temp_cache_memory = 0
|
||||||
ElseIf thread_redirect = #True
|
ElseIf thread_redirect = #True
|
||||||
|
@ -1125,7 +1128,7 @@ Module lhs_web
|
||||||
Else
|
Else
|
||||||
sent_total = thread_temp_file_readed+(thread_buffer_offset-thread_buffer)
|
sent_total = thread_temp_file_readed+(thread_buffer_offset-thread_buffer)
|
||||||
EndIf
|
EndIf
|
||||||
|
ldl::Logging("Memory send_total:"+Str(sent_total))
|
||||||
;TODO: Stoped download kill server...
|
;TODO: Stoped download kill server...
|
||||||
If m_clients(Str(thread_cli_id))\client_type = #client_HTTPS
|
If m_clients(Str(thread_cli_id))\client_type = #client_HTTPS
|
||||||
sent_length = sent_total
|
sent_length = sent_total
|
||||||
|
@ -1134,7 +1137,7 @@ Module lhs_web
|
||||||
Repeat
|
Repeat
|
||||||
sent = tls::WriteTLSSocket(thread_cli_id, sent_buffer_address , sent_length)
|
sent = tls::WriteTLSSocket(thread_cli_id, sent_buffer_address , sent_length)
|
||||||
If sent <> -1
|
If sent <> -1
|
||||||
;ldl::Logging("ClientID:" + Str(thread_cli_id) + " HTTPS Sent:"+Str(sent)+" bytes")
|
ldl::Logging("ClientID:" + Str(thread_cli_id) + " HTTPS Sent:"+Str(sent)+" bytes")
|
||||||
sent_length - sent
|
sent_length - sent
|
||||||
If thread_oversized_file = #False
|
If thread_oversized_file = #False
|
||||||
sent_buffer_address + sent
|
sent_buffer_address + sent
|
||||||
|
@ -1142,14 +1145,14 @@ Module lhs_web
|
||||||
;Read next Block to Memory
|
;Read next Block to Memory
|
||||||
If sent_length <= 0 And IsFile(thread_file_handle)
|
If sent_length <= 0 And IsFile(thread_file_handle)
|
||||||
sent_readed = ReadData(thread_file_handle, thread_buffer, thread_temp_file_readed)
|
sent_readed = ReadData(thread_file_handle, thread_buffer, thread_temp_file_readed)
|
||||||
;ldl::Logging("ClientID:" + Str(thread_cli_id) + " HTTPS Large File -> Read Next:"+Str(sent_readed)+" bytes")
|
ldl::Logging("ClientID:" + Str(thread_cli_id) + " HTTPS Large File -> Read Next:"+Str(sent_readed)+" bytes")
|
||||||
If sent_readed < thread_temp_file_readed
|
If sent_readed < thread_temp_file_readed
|
||||||
CloseFile(thread_file_handle)
|
CloseFile(thread_file_handle)
|
||||||
EndIf
|
EndIf
|
||||||
sent_buffer_address = thread_buffer
|
sent_buffer_address = thread_buffer
|
||||||
sent_length = sent_readed
|
sent_length = sent_readed
|
||||||
Else
|
Else
|
||||||
;ldl::Logging("ClientID:" + Str(thread_cli_id) + " HTTPS Large File -> to Send:"+Str(sent_length)+" bytes")
|
ldl::Logging("ClientID:" + Str(thread_cli_id) + " HTTPS Large File -> to Send:"+Str(sent_length)+" bytes")
|
||||||
sent_buffer_address + sent
|
sent_buffer_address + sent
|
||||||
EndIf
|
EndIf
|
||||||
EndIf
|
EndIf
|
||||||
|
|
156
lweb.pbp
156
lweb.pbp
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<project xmlns="http://www.purebasic.com/namespace" version="1.0" creator="PureBasic 6.03 beta 3 LTS (Linux - x64)">
|
<project xmlns="http://www.purebasic.com/namespace" version="1.0" creator="PureBasic 6.04 LTS (Linux - x64)">
|
||||||
<section name="config">
|
<section name="config">
|
||||||
<options closefiles="1" openmode="0" name="LiHaSo Webserver Modul"/>
|
<options closefiles="1" openmode="0" name="LiHaSo Webserver Modul"/>
|
||||||
<comment>Projekt ist inklusive Beispiel Code</comment>
|
<comment>Projekt ist inklusive Beispiel Code</comment>
|
||||||
|
@ -8,121 +8,121 @@
|
||||||
<section name="data">
|
<section name="data">
|
||||||
<explorer view="../../../bin/purebasic/examples/" pattern="0"/>
|
<explorer view="../../../bin/purebasic/examples/" pattern="0"/>
|
||||||
<log show="1"/>
|
<log show="1"/>
|
||||||
<lastopen date="2023-07-18 08:57" user="renlin" host="localhost.localdomain"/>
|
<lastopen date="2024-03-13 07:44" user="renlin" host="renlin-office"/>
|
||||||
</section>
|
</section>
|
||||||
<section name="files">
|
<section name="files">
|
||||||
<file name="installation.pb">
|
<file name="build_tools/src/default_host_xml_export.pb">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="1" panelstate="+"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="1" panelstate="+--"/>
|
||||||
<fingerprint md5="7a7390738d301d57e4eb8b28373d22e7"/>
|
<fingerprint md5="e3e8de2f4e852905bf6410aad61d5565"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="server_example.pb">
|
<file name="build_tools/src/status_xml_export.pb">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="2" panelstate="+"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="2" panelstate="+--"/>
|
||||||
<fingerprint md5="60fb2a5c112ead2c297cce2afa908ea4"/>
|
<fingerprint md5="b8282147d13a268e39f6164f684c3169"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="lhttpd.pb">
|
<file name="inc/lcmf_main.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="3" panelstate="+"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="3" panelstate="+-"/>
|
||||||
<fingerprint md5="ac30ebe9e15805d02ec78fe3dd5a9441"/>
|
<fingerprint md5="07b859104cbf3ef2df0b8a9cf3eeab32"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="lweb_header.pbi">
|
<file name="inc/lweb_file_cache.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="4" panelstate="+"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="4" panelstate="+-"/>
|
||||||
<fingerprint md5="53bf42c3a6e95d381fa49bc2d076946b"/>
|
<fingerprint md5="a3c3072e4eb0a8d09d9e02b2d57b707d"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_header_privat.pbi">
|
<file name="inc/lweb_header_privat.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="5" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="5" panelstate="+-"/>
|
||||||
<fingerprint md5="c4a9ada9f85b43584cc6e154d6465fdf"/>
|
<fingerprint md5="c4a9ada9f85b43584cc6e154d6465fdf"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_server_cfg.pbi">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="6" panelstate="+-"/>
|
|
||||||
<fingerprint md5="fae18222c1c6f8e241bfc06f9bb00659"/>
|
|
||||||
</file>
|
|
||||||
<file name="inc/lweb_server_cfg_header.pbi">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="7" panelstate="+-"/>
|
|
||||||
<fingerprint md5="57787e1e3db6c77d81fc5576e124beae"/>
|
|
||||||
</file>
|
|
||||||
<file name="build_tools/src/default_host_xml_export.pb">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="8" panelstate="+--"/>
|
|
||||||
<fingerprint md5="e3e8de2f4e852905bf6410aad61d5565"/>
|
|
||||||
</file>
|
|
||||||
<file name="build_tools/src/status_xml_export.pb">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="9" panelstate="+--"/>
|
|
||||||
<fingerprint md5="b8282147d13a268e39f6164f684c3169"/>
|
|
||||||
</file>
|
|
||||||
<file name="inc/lcmf_main.pbi">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="10" panelstate="+-"/>
|
|
||||||
<fingerprint md5="07b859104cbf3ef2df0b8a9cf3eeab32"/>
|
|
||||||
</file>
|
|
||||||
<file name="inc/lweb_file_cache.pbi">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="11" panelstate="+-"/>
|
|
||||||
<fingerprint md5="a3c3072e4eb0a8d09d9e02b2d57b707d"/>
|
|
||||||
</file>
|
|
||||||
<file name="inc/lweb_helper.pbi">
|
<file name="inc/lweb_helper.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="12" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="6" panelstate="+-"/>
|
||||||
<fingerprint md5="944c758e53a2b9d4bcf28ef931179d31"/>
|
<fingerprint md5="e6b5d486bd08b6de7f34a94316df2543"/>
|
||||||
|
</file>
|
||||||
|
<file name="inc/lweb_helper_header.pbi">
|
||||||
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="7" panelstate="+-"/>
|
||||||
|
<fingerprint md5="6ea3e5baa62f8e66063e3b45e17d7e91"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_http.pbi">
|
<file name="inc/lweb_http.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="13" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="8" panelstate="+-"/>
|
||||||
<fingerprint md5="a42cddb6a1102779589facc17ba96cd8"/>
|
<fingerprint md5="a42cddb6a1102779589facc17ba96cd8"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_http_header.pbi">
|
<file name="inc/lweb_http_header.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="14" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="9" panelstate="+-"/>
|
||||||
<fingerprint md5="d7df8e152291b0f91e8316ad8e00191c"/>
|
<fingerprint md5="d7df8e152291b0f91e8316ad8e00191c"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_http_status.pbi">
|
<file name="inc/lweb_http_status.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="15" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="10" panelstate="+-"/>
|
||||||
<fingerprint md5="cabf767d4a63c045f9ac4e7ca9e8f303"/>
|
<fingerprint md5="84fe14cca9af928faee3869b6c3d079f"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_http_status_header.pbi">
|
<file name="inc/lweb_http_status_header.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="16" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="11" panelstate="+-"/>
|
||||||
<fingerprint md5="ad8d9313172646d803164eaa5431d2f4"/>
|
<fingerprint md5="ad8d9313172646d803164eaa5431d2f4"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_http_status_header_private.pbi">
|
<file name="inc/lweb_http_status_header_private.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="17" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="12" panelstate="+-"/>
|
||||||
<fingerprint md5="c7736a7cdc87c1ed676b17d9757ba135"/>
|
<fingerprint md5="c7736a7cdc87c1ed676b17d9757ba135"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_IP.pbi">
|
<file name="inc/lweb_IP.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="18" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="13" panelstate="+-"/>
|
||||||
<fingerprint md5="502f26844f0a4b7d7f25924f76b17473"/>
|
<fingerprint md5="502f26844f0a4b7d7f25924f76b17473"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_IP_header.pbi">
|
<file name="inc/lweb_IP_header.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="19" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="14" panelstate="+-"/>
|
||||||
<fingerprint md5="636558037ff2cab03552fb129e2a4f52"/>
|
<fingerprint md5="636558037ff2cab03552fb129e2a4f52"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="lhs_lib/SYS/lhs_log_ext.pbi">
|
<file name="inc/lweb_server_cfg.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="20" panelstate="+--"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="15" panelstate="+-"/>
|
||||||
<fingerprint md5="f37e027dbab8be85535563b3287f7fff"/>
|
<fingerprint md5="16d83dbd505bc2f267b630b9e2d173d1"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="lhs_lib/SYS/lhs_sys_debug_wrapper.pbi">
|
<file name="inc/lweb_server_cfg_header.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="21" panelstate="+--"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="16" panelstate="+-"/>
|
||||||
<fingerprint md5="8c3a929cf403d443ec968d21593294a5"/>
|
<fingerprint md5="57787e1e3db6c77d81fc5576e124beae"/>
|
||||||
|
</file>
|
||||||
|
<file name="installation.pb">
|
||||||
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="17" panelstate="+"/>
|
||||||
|
<fingerprint md5="b5ba175b6bddf19d7c039396199911fd"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="lhs_lib/NET/lhs_net_socket.pbi">
|
<file name="lhs_lib/NET/lhs_net_socket.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="22" panelstate="+--"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="18" panelstate="+--"/>
|
||||||
<fingerprint md5="09f5575be4e23abbb593d2f735a795ae"/>
|
<fingerprint md5="09f5575be4e23abbb593d2f735a795ae"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="lhs_lib/NET/lhs_net_tls.pbi">
|
<file name="lhs_lib/NET/lhs_net_tls.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="23" panelstate="+--"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="19" panelstate="+--"/>
|
||||||
<fingerprint md5="c586d25a1493f437c7461374a891a715"/>
|
<fingerprint md5="c586d25a1493f437c7461374a891a715"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="server_example_function.pbi">
|
<file name="lhs_lib/NET/lhs_web_helper.pbi">
|
||||||
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="20" panelstate="+--"/>
|
||||||
|
<fingerprint md5="52ed1675b88a463b7ada8cf2003430e1"/>
|
||||||
|
</file>
|
||||||
|
<file name="lhs_lib/SYS/lhs_log_ext.pbi">
|
||||||
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="21" panelstate="+--"/>
|
||||||
|
<fingerprint md5="f37e027dbab8be85535563b3287f7fff"/>
|
||||||
|
</file>
|
||||||
|
<file name="lhs_lib/SYS/lhs_sys_debug_wrapper.pbi">
|
||||||
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="22" panelstate="+--"/>
|
||||||
|
<fingerprint md5="8c3a929cf403d443ec968d21593294a5"/>
|
||||||
|
</file>
|
||||||
|
<file name="lhttpd.pb">
|
||||||
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="23" panelstate="+"/>
|
||||||
|
<fingerprint md5="f24daf76ff093910b9f4fb635d2a439c"/>
|
||||||
|
</file>
|
||||||
|
<file name="lweb.pbi">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="24" panelstate="+"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="24" panelstate="+"/>
|
||||||
|
<fingerprint md5="719ce9141b0a0c8a3729465a411a4c90"/>
|
||||||
|
</file>
|
||||||
|
<file name="lweb_header.pbi">
|
||||||
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="25" panelstate="+"/>
|
||||||
|
<fingerprint md5="53bf42c3a6e95d381fa49bc2d076946b"/>
|
||||||
|
</file>
|
||||||
|
<file name="server_example.pb">
|
||||||
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="26" panelstate="+"/>
|
||||||
|
<fingerprint md5="bb89312c572cb9d1d3c81349252f0f4f"/>
|
||||||
|
</file>
|
||||||
|
<file name="server_example_function.pbi">
|
||||||
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="27" panelstate="+"/>
|
||||||
<fingerprint md5="5265cbd658ef5ff271bd2c6ea30b5713"/>
|
<fingerprint md5="5265cbd658ef5ff271bd2c6ea30b5713"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="server_example_function_library.pb">
|
<file name="server_example_function_library.pb">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="25" panelstate="+"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="28" panelstate="+"/>
|
||||||
<fingerprint md5="89b911359d8203d81c3aabbbd6f0dcf1"/>
|
<fingerprint md5="89b911359d8203d81c3aabbbd6f0dcf1"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="lweb.pbi">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="26" panelstate="+"/>
|
|
||||||
<fingerprint md5="e3243900ab7a7478fce202e60875e752"/>
|
|
||||||
</file>
|
|
||||||
<file name="inc/lweb_helper_header.pbi">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="27" panelstate="+-"/>
|
|
||||||
<fingerprint md5="c250ce791b691f679782e5016a3346be"/>
|
|
||||||
</file>
|
|
||||||
<file name="lhs_lib/NET/lhs_web_helper.pbi">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="28" panelstate="+--"/>
|
|
||||||
<fingerprint md5="52ed1675b88a463b7ada8cf2003430e1"/>
|
|
||||||
</file>
|
|
||||||
<file name="build_tools/src/default_config_xml_export.pb">
|
<file name="build_tools/src/default_config_xml_export.pb">
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="+--"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="+--"/>
|
||||||
<fingerprint md5="03c865cac19c1ef8148ac229388df3b0"/>
|
<fingerprint md5="03c865cac19c1ef8148ac229388df3b0"/>
|
||||||
|
@ -131,22 +131,18 @@
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="+-"/>
|
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="+-"/>
|
||||||
<fingerprint md5="3228c16f329808e2e6e3c6866861ae59"/>
|
<fingerprint md5="3228c16f329808e2e6e3c6866861ae59"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="inc/lweb_http_post_decoder.pbi">
|
|
||||||
<config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="29" panelstate="+-"/>
|
|
||||||
<fingerprint md5="f05103675e4b6921ea9f745a1344d6cd"/>
|
|
||||||
</file>
|
|
||||||
</section>
|
</section>
|
||||||
<section name="targets">
|
<section name="targets">
|
||||||
<target name="Standard-Ziel" enabled="1" default="0">
|
<target name="Standard-Ziel" enabled="1" default="1">
|
||||||
<inputfile value="server_example.pb"/>
|
<inputfile value="server_example.pb"/>
|
||||||
<outputfile value="server_example"/>
|
<outputfile value="server_example"/>
|
||||||
<compiler version="PureBasic 6.01 LTS - C Backend (Linux - x64)"/>
|
<compiler version="PureBasic 6.01 LTS - C Backend (Linux - x64)"/>
|
||||||
<executable value="server_example"/>
|
<executable value="server_example"/>
|
||||||
<options thread="1" xpskin="1" debug="1" optimizer="1"/>
|
<options thread="1" xpskin="1" debug="1" optimizer="0"/>
|
||||||
<format exe="console" cpu="0"/>
|
<format exe="console" cpu="0"/>
|
||||||
<debugger custom="1" type="ide"/>
|
<debugger custom="1" type="ide"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="lhttpd" enabled="1" default="1">
|
<target name="lhttpd" enabled="1" default="0">
|
||||||
<inputfile value="lhttpd.pb"/>
|
<inputfile value="lhttpd.pb"/>
|
||||||
<outputfile value="lhttpd"/>
|
<outputfile value="lhttpd"/>
|
||||||
<compiler version="PureBasic 6.01 LTS - C Backend (Linux - x64)"/>
|
<compiler version="PureBasic 6.01 LTS - C Backend (Linux - x64)"/>
|
||||||
|
@ -160,7 +156,7 @@
|
||||||
<outputfile value="build_tools/status_xml_export"/>
|
<outputfile value="build_tools/status_xml_export"/>
|
||||||
<compiler version="PureBasic 6.00 Beta 4 - C Backend (Linux - x64)"/>
|
<compiler version="PureBasic 6.00 Beta 4 - C Backend (Linux - x64)"/>
|
||||||
<executable value="build_tools/status_xml_export"/>
|
<executable value="build_tools/status_xml_export"/>
|
||||||
<options optimizer="1"/>
|
<options optimizer="0"/>
|
||||||
<format exe="console" cpu="0"/>
|
<format exe="console" cpu="0"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="build_tools/default_config_xml_export" enabled="1" default="0">
|
<target name="build_tools/default_config_xml_export" enabled="1" default="0">
|
||||||
|
@ -168,7 +164,7 @@
|
||||||
<outputfile value="build_tools/default_config_xml_export"/>
|
<outputfile value="build_tools/default_config_xml_export"/>
|
||||||
<compiler version="PureBasic 6.00 Beta 4 - C Backend (Linux - x64)"/>
|
<compiler version="PureBasic 6.00 Beta 4 - C Backend (Linux - x64)"/>
|
||||||
<executable value="build_tools/default_config_xml_export"/>
|
<executable value="build_tools/default_config_xml_export"/>
|
||||||
<options optimizer="1"/>
|
<options optimizer="0"/>
|
||||||
<format exe="console" cpu="0"/>
|
<format exe="console" cpu="0"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="build_tools/default_host_xml_export" enabled="1" default="0">
|
<target name="build_tools/default_host_xml_export" enabled="1" default="0">
|
||||||
|
@ -176,7 +172,7 @@
|
||||||
<outputfile value="build_tools/default_host_xml_export"/>
|
<outputfile value="build_tools/default_host_xml_export"/>
|
||||||
<compiler version="PureBasic 6.00 Beta 4 - C Backend (Linux - x64)"/>
|
<compiler version="PureBasic 6.00 Beta 4 - C Backend (Linux - x64)"/>
|
||||||
<executable value="build_tools/default_host_xml_export"/>
|
<executable value="build_tools/default_host_xml_export"/>
|
||||||
<options optimizer="1"/>
|
<options optimizer="0"/>
|
||||||
<format exe="console" cpu="0"/>
|
<format exe="console" cpu="0"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="server_example_library_test" enabled="1" default="0">
|
<target name="server_example_library_test" enabled="1" default="0">
|
||||||
|
|
39
lweb_auth.pb
39
lweb_auth.pb
|
@ -1,11 +1,12 @@
|
||||||
;************************
|
;************************
|
||||||
;* lweb_auth.pb
|
;* lweb_auth.pb
|
||||||
;*
|
;*
|
||||||
;* Authentication Library.
|
;* Simple Authentication Library.
|
||||||
;*
|
;*
|
||||||
;* Created and develobed by Linder Hard- und Software
|
;* Created and develobed by Linder Hard- und Software
|
||||||
;*
|
;*
|
||||||
;*
|
;* First Release Only "demo" Database
|
||||||
|
|
||||||
|
|
||||||
XIncludeFile "lhs_lib/NET/lhs_web_helper.pbi"
|
XIncludeFile "lhs_lib/NET/lhs_web_helper.pbi"
|
||||||
|
|
||||||
|
@ -43,6 +44,12 @@ ProcedureCDLL Database_User(DB_Cfg.s)
|
||||||
;mar:host=localhost port=3306 dbname=test user=|USERNAME| password=|PASSWORD|
|
;mar:host=localhost port=3306 dbname=test user=|USERNAME| password=|PASSWORD|
|
||||||
Case "psq"
|
Case "psq"
|
||||||
;psq:host=localhost port=5432 dbname=test user=|USERNAME| password=|PASSWORD|
|
;psq:host=localhost port=5432 dbname=test user=|USERNAME| password=|PASSWORD|
|
||||||
|
Case "demo"
|
||||||
|
;Demo Accounts
|
||||||
|
; Grp. Usr. Pw. ID Mod
|
||||||
|
;|demo|admin|admin1234|0 |777|
|
||||||
|
;|demo|user |user1234 |1 |744|
|
||||||
|
;|demo|guest|guest1234|2 |004|
|
||||||
Default
|
Default
|
||||||
State = "Failed"
|
State = "Failed"
|
||||||
ProcedureReturn @State
|
ProcedureReturn @State
|
||||||
|
@ -83,6 +90,34 @@ Procedure.s GetPassworfFromDBCFG(DB_Cfg.s)
|
||||||
ProcedureReturn User_Password
|
ProcedureReturn User_Password
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure.s CreateSession(ID.s)
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure.s IsSession(SessionID.s)
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure.s User_Verify(User.s)
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure.s User_Login(User.s, Password.s)
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure.s Get_MOD(SessionID.s)
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure.s Get_Group(SessionID.s)
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure.s Get_UseID(SessionID.s)
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
ProcedureCDLL post_test(handler_Map_JSON.s, ContentData.s)
|
ProcedureCDLL post_test(handler_Map_JSON.s, ContentData.s)
|
||||||
Define *Text
|
Define *Text
|
||||||
Define.s Encoded, TBD, Text, JSONStringToMap
|
Define.s Encoded, TBD, Text, JSONStringToMap
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
;*
|
;*
|
||||||
;* HTTP/HTTPS example extended Server
|
;* HTTP/HTTPS example extended Server
|
||||||
;*
|
;*
|
||||||
;* (c)2015 - 2023 by Linder Hard- und Software
|
;* (c)2015 - 2024 by Linder Hard- und Software
|
||||||
;*
|
;*
|
||||||
;*
|
;*
|
||||||
|
|
||||||
|
@ -36,7 +36,9 @@ lhs_log_ext::Init(DebugLog)
|
||||||
ldl::Register(lhs_log_ext::@Out(), DebugLog, 1, DebugLog, ldl::#AdvancedLog)
|
ldl::Register(lhs_log_ext::@Out(), DebugLog, 1, DebugLog, ldl::#AdvancedLog)
|
||||||
ldl::SetDefault(DebugLog)
|
ldl::SetDefault(DebugLog)
|
||||||
ldl::Logging("Start Debug Log registered with ldl at UUID:"+DebugLog)
|
ldl::Logging("Start Debug Log registered with ldl at UUID:"+DebugLog)
|
||||||
|
ldl::Logging("-------------------------------------------------------------------------------------------------------------------------------")
|
||||||
|
ldl::Logging("Server initializing.")
|
||||||
|
ldl::Logging("-------------------------------------------------------------------------------------------------------------------------------")
|
||||||
Debuggings = lhs_web::get_config(lhs_web::#conf_Debug_logUUID)
|
Debuggings = lhs_web::get_config(lhs_web::#conf_Debug_logUUID)
|
||||||
Debug Debuggings
|
Debug Debuggings
|
||||||
;*
|
;*
|
||||||
|
@ -64,6 +66,7 @@ PrintN("Configuration read done.")
|
||||||
;*
|
;*
|
||||||
|
|
||||||
PrintN("Start the Server")
|
PrintN("Start the Server")
|
||||||
|
lhs_web::main_server(0)
|
||||||
If lhs_web::server_start()
|
If lhs_web::server_start()
|
||||||
ldl::Logging("Server started")
|
ldl::Logging("Server started")
|
||||||
Else
|
Else
|
||||||
|
@ -75,6 +78,9 @@ counter = 0
|
||||||
PrintN("Server_Sample started.")
|
PrintN("Server_Sample started.")
|
||||||
PrintN("Press Enter to Exit")
|
PrintN("Press Enter to Exit")
|
||||||
Input()
|
Input()
|
||||||
|
ldl::Logging("-------------------------------------------------------------------------------------------------------------------------------")
|
||||||
|
ldl::Logging("Server Stopped.")
|
||||||
|
ldl::Logging("-------------------------------------------------------------------------------------------------------------------------------")
|
||||||
lhs_log_ext::StopAllLogger()
|
lhs_log_ext::StopAllLogger()
|
||||||
lhs_web::server_stop()
|
lhs_web::server_stop()
|
||||||
PrintN("Finished")
|
PrintN("Finished")
|
||||||
|
|
Loading…
Reference in a new issue