🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: demon.ip.developers
Article #839

Re: DNS caching; is it *truly* possible to flush locally?

#839
From: Peter Disdale
Date: Sun, 28 Jul 1996 00:00
47 lines
2343 bytes
In article <Snews.960727.045510.chris.317@keris.demon.co.uk>
           chris@keris.demon.co.uk "Chris Croughton" writes:

> In article <838411052snz@dsl.co.uk>
>            bhk@dsl.co.uk "Brian {Hamilton Kelly}" wrote:
 
 <snip on snip of good stuff>

> >    I've counted 429 lines in the sources which mention int32, and
> >that's without looking at the OS/2 specific files!
> 
> ...
> Since the code works at the moment, how about replacing all 'int32'
> declarations with 'uint32', and then setting that one to the proper
> 'int32'?  There might still be other bugs caused by this, but doing that
> shouldn't make anything worse than it is at present.

That was my initial thought, and one which will involve a fair
bit on editing (not to mention checking and testing!).

My second thought (and I must say I didn't scan the source too
closely) was that it might be simpler to redefine the ttl
member of struct rr as a simple 'long'.  With any luck (and a
slight tailwind:) the effects should be limited to domain.c and
domhdr.c.  At the very least I'd guess that there are fewer than
429 accesses to 'rr.ttl' vars.

Of course, the simplest(!) fix would be to recode all instances 
of the type that Brian originally cited where ttl expressions
are checked for < 0, ie.

  if (test_rrp->ttl > 0L
  && (test_rrp->ttl -= elapsed) <= 0L)
          test_rrp->ttl = 0L;
to eg.

  if (test_rrp->ttl != 0L)
      test_rrp->ttl = (test_rrp->ttl > elapsed) ? 
                       test_rrp->ttl - elapsed  : 0L;

though I'm sure someone could improve on the efficiency.

In saying all this, I've never come across a -ve TTL in my
domain.txt here.  Yet.
-- 
Pete
Technical Details
Message-ID: <838583297snz@pdlmail.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <838060435snz@dsl.co.uk> <838306928snz.4895@grempc.demon.co.uk> <Snews.960727.045510.chris.317@keris.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bb05,467f920bc280412f
X-Google-Attributes: gid10bb05,public
From: Peter Disdale <Pete@pdlmail.demon.co.uk>
Subject: Re: DNS caching; is it *truly* possible to flush locally?
Date: 1996/07/28
Message-ID: <838583297snz@pdlmail.demon.co.uk>
X-Deja-AN: 170702028
x-nntp-posting-host: pdlmail.demon.co.uk
references: <838060435snz@dsl.co.uk> <838306928snz.4895@grempc.demon.co.uk> <Snews.960727.045510.chris.317@keris.demon.co.uk>
x-mail2news-path: pdlmail.demon.co.uk
organization: Papa Delta Limited
reply-to: pete@pdlmail.demon.co.uk
newsgroups: demon.ip.developers