From owner-new-httpd@hyperreal.com Sat Dec 2 08:51:46 1995 Received: by taz.hyperreal.com (8.6.12/8.6.5) id IAA23475; Sat, 2 Dec 1995 08:51:46 -0800 Received: from arachnet.algroup.co.uk by taz.hyperreal.com (8.6.12/8.6.5) with SMTP id IAA23464; Sat, 2 Dec 1995 08:51:41 -0800 Received: from heap.ben.algroup.co.uk by arachnet.algroup.co.uk id aa29382; 2 Dec 95 16:51 GMT Received: from gonzo.ben.algroup.co.uk by heap.ben.algroup.co.uk id aa02705; 2 Dec 95 16:35 GMT Subject: Re: 1.0 release sources and the Binary release To: new-httpd@hyperreal.com Date: Sat, 2 Dec 1995 16:35:53 +0000 (GMT) From: Ben Laurie In-Reply-To: <199512021628.KAA04676@sierra.zyzzyva.com> from "Randy Terbush" at Dec 2, 95 10:28:05 am X-Mailer: ELM [version 2.4 PL24 PGP2] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1647 Message-ID: <9512021635.aa14342@gonzo.ben.algroup.co.uk> Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@apache.org > > > It has bugs (however, I back the principle): > > > > > > *************** > > > *** 156,161 **** > > > --- 156,163 ---- > > > > > > for (r = orig; r->next; r = r->next) > > > continue; > > > + if (cls->fname == "") /* Don't log agent */ > > ^^^^^ Oooops! > > > + return DECLINED; > > Not sure I understand why this is wrong. It is a comparision > and not an assignment. The cls->fname is initialized to "". > Splain me please. OK, mortar board on: "" means "the address of a chunk of memory with a null string in". This is not necessarily equal to the address of another chunk of memory with a null string in. In fact, it really shouldn't be equal (but some optimizers will make them the same). The correct test is *cls->fname == '\0', or !*cls->fname. Cheers, Ben. > > > > > if (cls->log_fd > 0) return; > > > ! if(*cls->fname != NULL) { > > > > This construction is, strictly, wrong (though it usually works). It irritates > > me to see it, the correct thing to say is: > > > > if(*cls->fname != '\0') { > > > > I know this appears all over the place. Its one of the things I intend to fix > > post-1.0.0. > > > > > ! if((cls->log_fd = popenf(p, fname, cookie_flags, cookie_mode)) < 0) > > Agreed. I should know better since I have fixed this problem many times > on other projects and other compilers. > > > -- Ben Laurie Phone: +44 (181) 994 6435 Freelance Consultant Fax: +44 (181) 994 6472 and Technical Director Email: ben@algroup.co.uk A.L. Digital Ltd, URL: http://www.algroup.co.uk London, England.