public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Thorsten Kukuk <kukuk@suse.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: Re: [PATCH] Avoid downloading whole NIS services.by{,service}name for getservby{name,port}{,_r} (, NULL)
Date: Tue, 30 Mar 2004 21:30:00 -0000	[thread overview]
Message-ID: <20040330073247.GA12333@suse.de> (raw)
In-Reply-To: <20040329210123.GC28220@sunsite.ms.mff.cuni.cz>

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

  parent reply	other threads:[~2004-03-30  7:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-30  7:32 Jakub Jelinek
2004-03-30 15:40 ` Ulrich Drepper
2004-03-30 21:30 ` Thorsten Kukuk [this message]
2004-04-02  9:23   ` Thorsten Kukuk
2004-04-02 15:10     ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040330073247.GA12333@suse.de \
    --to=kukuk@suse.de \
    --cc=jakub@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).