πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #79245

Re: Cleanfeed Binary Checks

#79245
From: Russ Allbery
Date: Fri, 01 Aug 2008 20:55
29 lines
2455 bytes
Julien Γ‰LIE <iulius@nom-de-mon-site.com.invalid> writes:

> Maybe this one?  (Is the "string table" including the body?)
>
> newSVpvn_share
>
> Creates a new SV with its SvPVX_const pointing to a shared string in the
> string table.  If the string does not already exist in the table, it is
> created first.  Turns on READONLY and FAKE.  If the hash parameter is
> non-zero, that value is used; otherwise the hash is computed.  The
> string's hash can be later be retrieved from the SV with the
> SvSHARED_HASH() macro.  The idea here is that as the string table is
> used for shared hash keys these strings will have SvPVX_const == HeKEY
> and hash lookup will avoid string compare.
>
>    SV* newSVpvn_share(const char* s, I32 len, U32 hash)
>
> New in Perl 5.7.1.

Yup, that looks like exactly what you want.  You probably want to pass in
some nonsense for the hash rather than having it compute a hash of the
body of the message, since we won't use the hash for innd's use case (I
think).

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <877ib0mp47.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!news.stanford.edu!not-for-mail
References: <g61rme$nqb$1@news.mixmin.net> <g62e1h$ejc$1@news.trigofacile.com> <g6qtgm$sq3$1@bongo.bofh.it> <slrng94sta.c76.mnalis-news@eagle102.home.lan> <8763ql5sli.fsf@windlord.stanford.edu> <g6ua3g$4pe$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <877ib0mp47.fsf@windlord.stanford.edu>
Subject: Re: Cleanfeed Binary Checks
Date: Fri, 01 Aug 2008 13:55:52 -0700
From: Russ Allbery <rra@stanford.edu>
References: <g61rme$nqb$1@news.mixmin.net> <g62e1h$ejc$1@news.trigofacile.com> <g6qtgm$sq3$1@bongo.bofh.it> <slrng94sta.c76.mnalis-news@eagle102.home.lan> <8763ql5sli.fsf@windlord.stanford.edu> <g6ua3g$4pe$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!news.stanford.edu!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Lines: 29
NNTP-Posting-Host: windlord.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.stanford.edu 1217624152 17151 171.64.19.147 (1 Aug 2008 20:55:52
 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)
Cancel-Lock: sha1:Va9AetubcpXNcfzomFMYPTYDmZY=