From owner-freebsd-hackers Tue Dec 10 11:13:22 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8131A37B401; Tue, 10 Dec 2002 11:13:20 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id F336743EB2; Tue, 10 Dec 2002 11:13:19 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.6) id gBAJDCdI033631; Tue, 10 Dec 2002 13:13:13 -0600 (CST) (envelope-from dan) Date: Tue, 10 Dec 2002 13:13:12 -0600 From: Dan Nelson To: George Georgalis Cc: nbari@unixmexico.com, freebsd-isp@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: tail -f on webpage Message-ID: <20021210191312.GG48182@dan.emsphone.com> References: <26647.148.243.211.1.1039409754.squirrel@mail.unixmexico.com> <20021209054521.GB20704@dan.emsphone.com> <20021210185212.GC23550@trot.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021210185212.GC23550@trot.local> X-OS: FreeBSD 5.0-RC X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Dec 10), George Georgalis said: > On Sun, Dec 08, 2002 at 11:45:22PM -0600, Dan Nelson wrote: > > #! /bin/sh > > printf "Content-type: text/plain\r\n\r\n" > > tail -f /var/log/messages > > > > Unfortunatly if you try that your webserver will quickly fail because > the connection never closes. If your customers can create cgi scripts > they can bring down your server too. > > How fast depends on httpd.conf MaxSpareServers, and how quickly you > hit reload. The connection does close, but it looks like tail does not correctly exit: kevent(0x4,0x0,0x0,0xbfbff410,0x1,0x0) = 1 (0x1) read(0x3,0x804d000,0x2000) = 90 (0x5a) read(0x3,0x804d000,0x2000) = 0 (0x0) write(1,0x804f000,90) ERR#32 'Broken pipe' kevent(0x4,0x0,0x0,0xbfbff410,0x1,0x0) = 1 (0x1) read(0x3,0x804d000,0x2000) = 85 (0x55) read(0x3,0x804d000,0x2000) = 0 (0x0) write(1,0x804f000,85) ERR#32 'Broken pipe' kevent(0x4,0x0,0x0,0xbfbff410,0x1,0x0) = 1 (0x1) read(0x3,0x804d000,0x2000) = 34 (0x22) read(0x3,0x804d000,0x2000) = 0 (0x0) write(1,0x804f000,34) ERR#32 'Broken pipe' Not sure why though. The error-checking code in tail looks fine. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message