Konstant #OLF durch Standard #CRLF$ ersetzt.

Sowie bereinigung unbenötigter Variabeln. (Leichen aus altem Code)
This commit is contained in:
René Linder 2020-11-08 23:26:35 +01:00
parent 798e1260af
commit 6b793369d3

View file

@ -14,15 +14,11 @@ Module lhs_web
;* WebServer Variabeln / Parameter ;* WebServer Variabeln / Parameter
;* ;*
;{ ;{
;*
;* Grund Variabeln
;*
Define temp_clientid, temp_receivelength
Define counter_test, counter_test_extra
;* ;*
;* Identifikation des Servers. ;* Identifikation des Servers.
;* ;*
#OLF = Chr(13)+Chr(10)
Global.s conf_version = "V0.9" Global.s conf_version = "V0.9"
Global.s conf_titel = "LiHaSo Webserver " + conf_version Global.s conf_titel = "LiHaSo Webserver " + conf_version
@ -227,8 +223,6 @@ Module lhs_web
;* ;*
Protected.i network_event , client_id, thread_alive, file_cache_thread Protected.i network_event , client_id, thread_alive, file_cache_thread
Protected.i count_client Protected.i count_client
Protected.i t_live , counter_test
Protected client, datathread, temp_receivelength, counter_mem_buffers
If conf_cache_enable = 1 : file_cache_thread = CreateThread(@FileCache(), 1) : EndIf If conf_cache_enable = 1 : file_cache_thread = CreateThread(@FileCache(), 1) : EndIf
@ -338,9 +332,9 @@ Module lhs_web
Procedure client(network_client_id.i) Procedure client(network_client_id.i)
Protected thread_cli_id = network_client_id Protected thread_cli_id = network_client_id
Protected cli_stop, MyThreadJSON, ToCall, ToCallType Protected MyThreadJSON, ToCall, ToCallType
Protected thread_temp_string.s, thread_temp_cache.s, thread_temp_cache_memory, temp_receivelength, thread_temp_decode_memory Protected thread_temp_cache.s, thread_temp_cache_memory, temp_receivelength, thread_temp_decode_memory
Protected thread_command_length, thread_max_pos, thread_pos, thread_reasign Protected thread_reasign
Protected thread_data_size, thread_file_handle Protected thread_data_size, thread_file_handle
Protected.s thread_requested, thread_type, thread_date, thread_header, thread_work, JSONStringToMap, Handler_Response, response_status, PostMapString Protected.s thread_requested, thread_type, thread_date, thread_header, thread_work, JSONStringToMap, Handler_Response, response_status, PostMapString
Protected thread_buffer, thread_buffer_offset, thread_buffer_length, buffer_sent Protected thread_buffer, thread_buffer_offset, thread_buffer_length, buffer_sent
@ -883,21 +877,21 @@ Module lhs_web
If Not FindMapElement(Header(), #http_head_content_length) : Header(#http_head_content_length) = "0" : EndIf If Not FindMapElement(Header(), #http_head_content_length) : Header(#http_head_content_length) = "0" : EndIf
If Not FindMapElement(Header(), #http_head_content_type) : Header(#http_head_content_type) = "text/txt" : EndIf If Not FindMapElement(Header(), #http_head_content_type) : Header(#http_head_content_type) = "text/txt" : EndIf
v_http_header = "HTTP/1.1 " + Header(#http_head_status) + #OLF + v_http_header = "HTTP/1.1 " + Header(#http_head_status) + #CRLF$ +
#http_head_date + " " + Header(#http_head_date) + #OLF + #http_head_date + " " + Header(#http_head_date) + #CRLF$ +
#http_head_server + " " + Header(#http_head_server) + #OLF + #http_head_server + " " + Header(#http_head_server) + #CRLF$ +
#http_head_content_length + " " + Header(#http_head_content_length) + #OLF + #http_head_content_length + " " + Header(#http_head_content_length) + #CRLF$ +
#http_head_content_type + " " + Header(#http_head_content_type) + #OLF #http_head_content_type + " " + Header(#http_head_content_type) + #CRLF$
If MapSize(Header()) > 5 If MapSize(Header()) > 5
ResetMap(Header()) ResetMap(Header())
While NextMapElement(Header()) While NextMapElement(Header())
v_current = MapKey(Header()) v_current = MapKey(Header())
If Bool(v_current <> #http_head_status And v_current <> #http_head_date And v_current <> #http_head_server And v_current <> #http_head_content_length And v_current <> #http_head_content_type) If Bool(v_current <> #http_head_status And v_current <> #http_head_date And v_current <> #http_head_server And v_current <> #http_head_content_length And v_current <> #http_head_content_type)
v_http_header + v_current + " " + Header(v_current) + #OLF v_http_header + v_current + " " + Header(v_current) + #CRLF$
EndIf EndIf
Wend Wend
EndIf EndIf
v_http_header + #OLF v_http_header + #CRLF$
ProcedureReturn v_http_header ProcedureReturn v_http_header
EndProcedure EndProcedure
@ -906,8 +900,8 @@ Module lhs_web
Protected NewMap Header.s() Protected NewMap Header.s()
Define.s JSONString, Working, Working_Line Define.s JSONString, Working, Working_Line
Define CountLines, Lines, JSON Define CountLines, Lines, JSON
If CountString(String,#OLF+#OLF) If CountString(String,#CRLF$+#CRLF$)
Working = StringField(String,1,#OLF+#OLF) Working = StringField(String,1,#CRLF$+#CRLF$)
Else Else
ProcedureReturn #error_string ProcedureReturn #error_string
EndIf EndIf