when a large file Download was stoped the Server exited with SIGPIPE - fixed

This commit is contained in:
René Linder 2022-02-17 13:19:46 +01:00
parent 2ce4902b39
commit 7c9a610f47

View file

@ -13,6 +13,17 @@ CompilerIf #PB_Compiler_OS <> #PB_OS_Linux
CompilerError "Only for Linux" CompilerError "Only for Linux"
CompilerEndIf CompilerEndIf
;***********************
;* The SIGPIPE Signal must be Handled Inside / Ignored
#SIGPIPE = 13
Procedure SignalIgnore()
Debug("Signal Ignore")
EndProcedure
;***********************
signal_(#SIGPIPE, @SignalIgnore());
DeclareModule lsocket DeclareModule lsocket
Structure sockaddr Structure sockaddr
sa_family.w sa_family.w
@ -57,7 +68,7 @@ EndDeclareModule
Module lsocket Module lsocket
Global NewMap lsockets_server.sockaddr_in() Global NewMap lsockets_server.sockaddr_in()
Global NewMap lsockets_client.sockaddr_in() Global NewMap lsockets_client.sockaddr_in()
Procedure CreateSocket(Port.i, Queuelengt.i = 64, Type.i = #SOCK_STREAM, Protocol.i = #AF_INET, BindedIP.s = "127.0.0.1") ; Return Server Socket < 0 Error Procedure CreateSocket(Port.i, Queuelengt.i = 64, Type.i = #SOCK_STREAM, Protocol.i = #AF_INET, BindedIP.s = "127.0.0.1") ; Return Server Socket < 0 Error
Protected SocketID.i Protected SocketID.i
SocketID = socket_(Protocol, Type, 0) SocketID = socket_(Protocol, Type, 0)