diff options
author | spz <spz@pkgsrc.org> | 2008-01-14 12:39:54 +0000 |
---|---|---|
committer | spz <spz@pkgsrc.org> | 2008-01-14 12:39:54 +0000 |
commit | a1929dd2d8f38e8a1a272cd59c867f11cbe4c0ff (patch) | |
tree | 3f3a26995db15eaee52f394378831f2ee2754dbe /net/irrtoolset-nox11 | |
parent | 32be028443b1d595b197bad4ce074110d8cd8c64 (diff) | |
download | pkgsrc-a1929dd2d8f38e8a1a272cd59c867f11cbe4c0ff.tar.gz |
reduced Hagen Boehms cache patch to the bare minimum nececssary and also adding
a pair of extra {}. It's a marvel what these can do for you. :)
Thanks to Daryl Collins <daryl@internode.com.au> for bringing the problem
to my attention.
Diffstat (limited to 'net/irrtoolset-nox11')
-rw-r--r-- | net/irrtoolset-nox11/Makefile | 4 | ||||
-rw-r--r-- | net/irrtoolset-nox11/distinfo | 5 | ||||
-rw-r--r-- | net/irrtoolset-nox11/patches/patch-dj | 72 | ||||
-rw-r--r-- | net/irrtoolset-nox11/patches/patch-dn | 12 |
4 files changed, 35 insertions, 58 deletions
diff --git a/net/irrtoolset-nox11/Makefile b/net/irrtoolset-nox11/Makefile index 6f580e38a5d..4d689c8fecf 100644 --- a/net/irrtoolset-nox11/Makefile +++ b/net/irrtoolset-nox11/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.16 2008/01/07 15:33:02 spz Exp $ +# $NetBSD: Makefile,v 1.17 2008/01/14 12:39:54 spz Exp $ # DISTNAME= IRRToolSet-4.8.5 -PKGREVISION= 6 +PKGREVISION= 7 CATEGORIES= net MASTER_SITES= ftp://ftp.isc.org/isc/IRRToolSet/IRRToolSet-4.8.5/ diff --git a/net/irrtoolset-nox11/distinfo b/net/irrtoolset-nox11/distinfo index 4c7e65fb608..e9b36660dac 100644 --- a/net/irrtoolset-nox11/distinfo +++ b/net/irrtoolset-nox11/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.15 2008/01/07 15:33:02 spz Exp $ +$NetBSD: distinfo,v 1.16 2008/01/14 12:39:54 spz Exp $ SHA1 (IRRToolSet-4.8.5.tar.gz) = 0a22daef3c5c04b5bce929e420233885c44662ec RMD160 (IRRToolSet-4.8.5.tar.gz) = 3f6a291a1c33c2725325ebc51ab8306e7a1e743b @@ -48,8 +48,7 @@ SHA1 (patch-df) = 176d2186b72c40334190d5635677104241c06e74 SHA1 (patch-dg) = 5f3fe95a69cdf1d3eb13b4e2a3a3fce1f4c53168 SHA1 (patch-dh) = ce1218fe7d82e3bb5c470cd74b334400aebd1928 SHA1 (patch-di) = ab0fa75329575141844ff55698a21060c2b62e43 -SHA1 (patch-dj) = a93a4c30a26379e51307faf55158a132bf9ff575 +SHA1 (patch-dj) = 25258cbb8e544f0eda9ed6ac4f9f61825266bfdd SHA1 (patch-dk) = a1632fa3030ee483c99af5ef039e494295af0b7f SHA1 (patch-dl) = 85ab29170a0ce1f82f3058bd58b00c779684fbca SHA1 (patch-dm) = 7d65970aea11d00dd1867aa07c3ee970d26b3b73 -SHA1 (patch-dn) = ef4b17979cc7ffddadcbcf64847339020ac53f34 diff --git a/net/irrtoolset-nox11/patches/patch-dj b/net/irrtoolset-nox11/patches/patch-dj index ca7b48a815e..21f23f98a04 100644 --- a/net/irrtoolset-nox11/patches/patch-dj +++ b/net/irrtoolset-nox11/patches/patch-dj @@ -1,21 +1,8 @@ -$NetBSD: patch-dj,v 1.2 2008/01/05 14:35:22 spz Exp $ +$NetBSD: patch-dj,v 1.3 2008/01/14 12:39:55 spz Exp $ --- src/irr/rawhoisc.cc.orig 2007-02-13 01:25:01.000000000 +0100 +++ src/irr/rawhoisc.cc -@@ -516,6 +516,12 @@ bool RAWhoisClient::getAutNum(char *as, - return len; - } - -+// get asset or rsset -+bool RAWhoisClient::getASSet(SymID sname, char *&text, int &len) { -+ len = QueryResponse(text, "!i%s,1", sname); -+ return len; -+} -+ - bool RAWhoisClient::getSet(SymID sname, char *clss, char *&text, int &len) { - len = QueryResponse(text, "!m%s,%s", clss, sname); - return len; -@@ -557,26 +563,58 @@ bool RAWhoisClient::expandAS(char *as, +@@ -557,26 +557,61 @@ bool RAWhoisClient::expandAS(char *as, } bool RAWhoisClient::expandASSet(SymID asset, SetOfUInt *result) { @@ -28,31 +15,34 @@ $NetBSD: patch-dj,v 1.2 2008/01/05 14:35:22 spz Exp $ - if (response) - delete [] response; + Set *set = NULL; -+ + if (queryCache(asset, set)) { + AttrGenericIterator<Item> itr(set, "members"); -+ for (Item *pt = itr.first(); pt; pt = itr.next()) ++ for (Item *pt = itr.first(); pt; pt = itr.next()) { + if (typeid(*pt) == typeid(ItemASNAME)) { // ASNAME (aka as-set) + const SetOfUInt *tmp = IRR::expandASSet(((ItemASNAME *)pt)->name); + if (tmp) + *result |= *(SetOfUInt *) tmp; -+ } else if (typeid(*pt) == typeid(ItemASNO)) { -+ result->add(((ItemASNO *)pt)->asno); + } else { -+ cerr << "WARNING: irrd/rawhoisd cannot resolve as-set " << asset << "!"; -+ cerr << "Unknown element found in as-set definition!\n"; ++ if (typeid(*pt) == typeid(ItemASNO)) { ++ result->add(((ItemASNO *)pt)->asno); ++ } else { ++ cerr << "WARNING: irrd/rawhoisd cannot resolve as-set " << asset << "!"; ++ cerr << "Unknown element found in as-set definition!\n"; ++ } + } -+ if (set != NULL) free (set); -+ } else { -+ char *text; -+ int len; -+ if (getASSet(asset, text, len)) { -+ for (char *word = strtok(text, " \t\n"); word; word = strtok(NULL, "\t\n")) -+ result->add(atoi(word+2)); ++ if (set) ++ delete [] set; + } -+ if (text != NULL) free(text); ++ } else { ++ char *response; ++ if (!QueryResponse(response, "!i%s,1", asset)) return false; ++ for (char *word = strtok(response, " \t\n"); ++ word; ++ word = strtok(NULL, " \t\n")) ++ result->add(atoi(word+2)); ++ if (response) ++ delete [] response; + } -+ return true; } @@ -66,8 +56,7 @@ $NetBSD: patch-dj,v 1.2 2008/01/05 14:35:22 spz Exp $ - if (response) - delete [] response; + Set *set = NULL; -+ -+ if (queryCache(rsset, set)) { ++ if (queryCache(rsset, set)) { + AttrGenericIterator<Item> itr(set, "members"); + for (Item *pt = itr.first(); pt; pt = itr.next()) { + expandItem(pt, result); @@ -76,17 +65,18 @@ $NetBSD: patch-dj,v 1.2 2008/01/05 14:35:22 spz Exp $ + for (Item *pt = itr1.first(); pt; pt = itr1.next()) { + expandItem(pt, result); + } -+ if (set != NULL) free (set); ++ if (set) ++ delete [] set; + } else { -+ char *text; -+ int len; -+ if (getASSet(rsset, text, len)) { -+ for (char *word = strtok(text, " \t\n"); word; word = strtok(NULL, "\t\n")) -+ result->push_back(MPPrefix(word)); -+ } -+ if (text != NULL) free(text); ++ char *response; ++ if (!QueryResponse(response, "!i%s,1", rsset)) return false; ++ for (char *word = strtok(response, " \t\n"); ++ word; ++ word = strtok(NULL, " \t\n")) ++ result->push_back(MPPrefix(word)); ++ if (response) ++ delete [] response; + } -+ return true; } diff --git a/net/irrtoolset-nox11/patches/patch-dn b/net/irrtoolset-nox11/patches/patch-dn deleted file mode 100644 index 36d6fcd5080..00000000000 --- a/net/irrtoolset-nox11/patches/patch-dn +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-dn,v 1.1 2008/01/05 14:35:22 spz Exp $ - ---- src/irr/rawhoisc.hh.orig 2006-10-01 13:23:32.000000000 +0200 -+++ src/irr/rawhoisc.hh -@@ -146,6 +146,7 @@ public: - int PendingData(); - - virtual bool getAutNum(char *as, char *&text, int &len); -+ virtual bool getASSet(SymID sname, char *&text, int &len); - virtual bool getSet(SymID sname, char *clss, char *&text, int &len); - virtual bool getRoute(char *rt, char *as, char *&text, int &len); - virtual bool getInetRtr(SymID inetrtr, char *&text, int &len); |