diff --git a/lsocket.pbi b/lsocket.pbi index 79e68b9..76663fd 100644 --- a/lsocket.pbi +++ b/lsocket.pbi @@ -1,9 +1,18 @@ -;lsocket.pbi -; -; Socket Module -; Definition who are not available on linux... -; Simple PureBasic Spech commands. -; +;************************ +;* Library : lsocket.pbi +;* +;* Socket based Networkcommuncation Module. +;* +;* Created and develobed by Linder Hard- und Software +;* +;* Current only usable for Linux. +;* +;* + +CompilerIf #PB_Compiler_OS <> #PB_OS_Linux + CompilerError "Only for Linux" +CompilerEndIf + DeclareModule lsocket Structure sockaddr sa_family.w @@ -22,16 +31,16 @@ DeclareModule lsocket EndStructure ; Socket types: - #SOCK_STREAM = 1 ; stream (connection) socket + #SOCK_STREAM = 1 ; stream (connection) socket #SOCK_DGRAM = 2 ; datagram (conn.less) socket #SOCK_RAW = 3 ; raw socket #SOCK_RDM = 4 ; reliably-delivered message - #SOCK_SEQPACKET = 5 ; sequential packet socket - #SOCK_PACKET = 10 ; linux specific way of - ; getting packets at the dev - ; level. For writing rarp And - ; other similar things on the - ; user level. + #SOCK_SEQPACKET = 5 ; sequential packet socket + #SOCK_PACKET = 10 ; linux specific way of + ; getting packets at the dev + ; level. For writing rarp And + ; other similar things on the + ; user level. ; socket.h #PF_INET = 2 @@ -95,11 +104,9 @@ Module lsocket EndProcedure Procedure CloseSocket(Socket.i) - close_(Socket) + Protected Feedback.i + Feedback = close_(Socket) + ProcedureReturn Feedback EndProcedure - - - - EndModule diff --git a/ltls.pbi b/ltls.pbi index 434e105..b0f5211 100644 --- a/ltls.pbi +++ b/ltls.pbi @@ -1,4 +1,17 @@ -;ltls.pbi +;************************ +;* Library : ltls.pbi +;* +;* Server side TLS Implementation to communicate encrypted. +;* +;* Created and develobed by Linder Hard- und Software +;* +;* Current only usable for Linux. +;* +;* + +CompilerIf #PB_Compiler_OS <> #PB_OS_Linux + CompilerError "Only for Linux" +CompilerEndIf XIncludeFile "lsocket.pbi" diff --git a/lweb.pbi b/lweb.pbi index 7b08983..6e61f97 100644 --- a/lweb.pbi +++ b/lweb.pbi @@ -459,21 +459,23 @@ Module lhs_web If thread_alive = #True Select m_clients(Str(thread_cli_id))\client_do_cli Case #CLI_DO_DataWorking - ;Empfang abgeschlossen - ;Buffer Bearbeiten - ;Thread in Bearbeitungsmodus Setzen. - ;TODO: Was ist mit zusammenhängenden Datenbuffern grosse Post/Put z.B. + ;Receive done. + ;Do Buffer work + ;Change Thread to Work mode. ;{ - Debug "Daten vollständig empfangen. Abarbeiten." + Debug "Date received, working..." m_clients(Str(thread_cli_id))\client_do_cli = #CLI_DO_DataWorking - ;Abarbeiten der Anforderung... + ;Work on Answer. ResetList(m_clients(Str(thread_cli_id))\datenbuffer()) + ;TODO: Only first Buffer have a Header. + While NextElement(m_clients(Str(thread_cli_id))\datenbuffer()) thread_work = PeekS(m_clients(Str(thread_cli_id))\datenbuffer()\Buffer, m_clients(Str(thread_cli_id))\datenbuffer()\Size, #PB_Ascii) - ;Header to Map - ;Debug "Datenbuffer:"+ Mid(thread_work,1,256) + + ;Move Header to Map + JSONStringToMap = Work_Header_to_JSONMap(thread_work) If JSONStringToMap <> #error_string MyThreadJSON = ParseJSON(#PB_Any, JSONStringToMap) @@ -482,8 +484,8 @@ Module lhs_web ExtractJSONMap(JSONValue(MyThreadJSON), Header()) FreeJSON(MyThreadJSON) Else - ;WTF ??? - Break 2 ; Thread abschiessen + ;Should not be a case. + Break 2 ; Kill Thread. EndIf Else error_message = #True diff --git a/lweb.pbp b/lweb.pbp index 211b310..f9b985c 100644 --- a/lweb.pbp +++ b/lweb.pbp @@ -8,7 +8,7 @@
- +
@@ -20,7 +20,7 @@ - + @@ -28,19 +28,19 @@ - + - + - + - + @@ -49,23 +49,23 @@ - + - + - + - + - +
diff --git a/server_example.pb b/server_example.pb index c324dfc..5824084 100644 --- a/server_example.pb +++ b/server_example.pb @@ -2,7 +2,7 @@ ;* ;* Lihaso Web Server ;* -;* (c)2015 by Linder Hard- und Software +;* (c)2015 - 2021 by Linder Hard- und Software ;* ;* V0.1 ;* - Initial Web Server