From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3859 invoked by alias); 30 Mar 2004 07:32:50 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 3829 invoked from network); 30 Mar 2004 07:32:49 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sources.redhat.com with SMTP; 30 Mar 2004 07:32:49 -0000 Received: from hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 887D33A6549; Tue, 30 Mar 2004 09:32:48 +0200 (CEST) Date: Tue, 30 Mar 2004 21:30:00 -0000 From: Thorsten Kukuk To: Jakub Jelinek Cc: Glibc hackers Subject: Re: [PATCH] Avoid downloading whole NIS services.by{,service}name for getservby{name,port}{,_r} (, NULL) Message-ID: <20040330073247.GA12333@suse.de> References: <20040329210123.GC28220@sunsite.ms.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040329210123.GC28220@sunsite.ms.mff.cuni.cz> User-Agent: Mutt/1.4i Organization: SuSE Linux AG, Nuernberg, Germany X-SW-Source: 2004-03/txt/msg00144.txt.bz2 On Mon, Mar 29, Jakub Jelinek wrote: > Hi! > > Only lightly tested so far. > It is not neccessary to download, allocate and copy whole services > map and then search through it. > Instead, we can search already in the foreach callback and if we find > something tell the caller we don't need further input. > > BTW: __xdr_ypresp_all uses the foreach callback return value as > 0 -> need further data, != 0 break the loop. > But saveit callbacks I see return 0 when further data should be > examined and YP_FALSE (== 0) on error (e.g. memory failures). > This certainly doesn't sound right. There are two wrong checks: if (instatus != YP_TRUE) return instatus; and if (newp == NULL) return YP_FALSE; /* We have no error code for out of memory */ are both wrong. I will look later at it and try to fix it. Seems I mixed the instatus and with the return value of the foreach function. Thanks, Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Maxfeldstr. 5 D-90409 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B