]> Sergey Matveev's repositories - public-inbox.git/commit
nntp: remove cyclic refs from long_response
authorEric Wong <e@80x24.org>
Sat, 21 Dec 2019 08:00:01 +0000 (08:00 +0000)
committerEric Wong <e@80x24.org>
Sun, 22 Dec 2019 03:56:07 +0000 (03:56 +0000)
commit207b89615a1a0c06dd9afc94ca2200b889dc35e1
tree0b12ad361548373214b228543cd16faa41c5588a
parent145190edbb9b031127d64671d5d8548086ce9fea
nntp: remove cyclic refs from long_response

Leftover cyclic references are a source of memory leaks.  While
our code is AFAIK unaffected by such leaks at the moment,
eliminating a potential source of bugs will make maintenance
easier.

We make the long_response API cycle-free by stashing the
callback into the NNTP object.  However, callers will need
to be updated to get rid of the circular reference to $self.
We do that be replacing anonymous subs with name subroutine
references, such as xref_range_i replacing the formerly
anonymous sub inside hdr_xref.
lib/PublicInbox/NNTP.pm