From owner-freebsd-hackers Tue Nov 21 18:29: 2 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from distortion.dk (distortion.dk [195.249.147.156]) by hub.freebsd.org (Postfix) with ESMTP id 5C28037B4C5 for ; Tue, 21 Nov 2000 18:28:59 -0800 (PST) Received: from petri2000 ([194.192.131.97]) by distortion.dk (8.9.3/8.9.1) with SMTP id DAA39119 for ; Wed, 22 Nov 2000 03:35:20 +0100 (CET) (envelope-from nicolai@petri.cc) Message-ID: <01ad01c0542c$5d4d38d0$6732a8c0@atomic.dk> From: "Nicolai Petri" To: Subject: SIGPIPE in multithread http server. Date: Wed, 22 Nov 2000 03:31:48 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I hope someone can help me with this issue.. When the application recieves a SIGPIPE the thread hangs hard.. What is the correct thing to do when a socket is closed by the remote end ?? The fault happens each time I'll hit reload in my browser while there's still a connection open (while downloading a large page).. It blocks my http server hard... No new connections is accepted.. But other non-socket threads runs nicely in the backgrund.. My current signal-handler looks like this : --------- void ignoreSignal(int signalId _UNUSED_) { closeNwSocket(&newSock); (void)setsignal(SIGPIPE, ignoreSignal); } --------- I'll bet this is very wrong... But what is the correct code for cleaning the session up ?? Best regards, Nicolai Petri To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message