From bfd39d75584275a43072593531cb2fc25c42f9b6 Mon Sep 17 00:00:00 2001 From: Ground0 Date: Fri, 20 Sep 2024 11:07:37 +0200 Subject: [PATCH] Fixed that a stopped Download Kill the server. --- lweb.pbi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lweb.pbi b/lweb.pbi index d24577d..6b23b1f 100644 --- a/lweb.pbi +++ b/lweb.pbi @@ -1134,7 +1134,7 @@ Module lhs_web sent_total = thread_temp_file_readed+(thread_buffer_offset-thread_buffer) EndIf ldl::Logging("Memory send_total:"+Str(sent_total)) - ;TODO: Stoped download kill server... + ;Erledigt: Stoped download kill server... If m_clients(Str(thread_cli_id))\client_type = #client_HTTPS sent_length = sent_total sent_buffer_address = thread_buffer @@ -1181,7 +1181,13 @@ Module lhs_web sent_buffer_address = thread_buffer sent_total = 0 Repeat - sent = lsocket::WriteSocket(thread_cli_id, thread_buffer , sent_length) + If lsocket::IsClientSocket(thread_cli_id) + sent = lsocket::WriteSocket(thread_cli_id, thread_buffer , sent_length) + Else + thread_alive=#False + Break 2 + EndIf + If sent <> -1 ldl::Logging("HTTP Sent:"+Str(sent)+" bytes") sent_length - sent