From owner-freebsd-hackers Tue Nov 21 18:32:47 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail1.netsol.net (mail.netsol.net [216.179.148.10]) by hub.freebsd.org (Postfix) with ESMTP id 131FB37B4C5 for ; Tue, 21 Nov 2000 18:32:45 -0800 (PST) Received: from fire ([63.194.3.101]) by mail1.netsol.net (Post.Office MTA v3.5.3 release 223 ID# 0-12345L500S10000V35) with SMTP id net; Tue, 21 Nov 2000 18:37:07 -0800 Message-ID: <008801c0542c$82e1bc60$6503c23f@XGforce.com> Reply-To: "jl" From: "jl" To: "Nicolai Petri" , References: <01ad01c0542c$5d4d38d0$6732a8c0@atomic.dk> Subject: Re: SIGPIPE in multithread http server. Date: Tue, 21 Nov 2000 18:32:51 -0800 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG You should have the thread call signal() to ignor the sigpipe signal so the thread won't hang. ====================================== WWW.XGFORCE.COM The Next Generation Load Balance and Fail Safe Server Clustering Software for the Internet. ====================================== ----- Original Message ----- From: Nicolai Petri To: Sent: Tuesday, November 21, 2000 6:31 PM Subject: SIGPIPE in multithread http server. > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message