Date | Commit message (Collapse) |
|
We can save callers the trouble of {-hold} and {-dev_null}
refs as well as the trouble of calling fileno().
|
|
This was causing -xcpdb and other admin modules to fail
outside of tests (or when testing with the slow TEST_RUN_MODE=0).
|
|
* no-closure: (30 commits)
search: retry_reopen passes user arg to callback
solvergit: allow passing arg to user-supplied callback
viewvcs: avoid anonymous sub for HTML response
wwwattach: avoid anonymous sub for msg_iter
view: msg_iter calls add_body_text directly
searchview: remove anonymous sub when sorting threads by relevance
view: thread_html: pass named sub to WwwStream
searchview: pass named subs to Www*Stream
wwwtext: avoid anonymous sub in response
contentid: no anonymous sub
view: msg_html: stop using an anonymous sub
view: avoid anon sub in stream_thread
config: each_inbox: pass user arg to callback
feed: avoid anonymous subs
mboxgz: pass $ctx to callback to avoid anon subs
www: lazy load Plack::Util
githttpbackend: split out wwwstatic
qspawn: psgi_return: allow non-anon parse_hdr callback
qspawn: drop "qspawn.filter" support, for now
qspawn: psgi_qx: eliminate anonymous subs
...
|
|
HTTP::getline_pull and NNTP::long_step will both populate {wbuf}
manually to avoid recursion, so we need to account for an
empty-but-present {wbuf} while dispatching msg_more().
|
|
This allows callers to pass named (not anonymous) subs.
Update all retry_reopen callers to use this feature, and
fix some places where we failed to use retry_reopen :x
|
|
This allows us to get rid of the requirement to capture
on-stack variables with an anonymous sub, as illustrated
with the update to viewvcs to take advantage of this.
v2: fix error handling for missing OIDs
|
|
No need to create a new sub for every HTML page we render
with our VCS viewer.
|
|
We can pass arguments to msg_iter for msg_iter to pass
to our user-supplied callback, now.
|
|
No need to waste several kilobytes creating an anonymous sub for
every invocation of msg_iter.
|
|
We don't need to return a closure or have a separate hash
for sorting threads by relevance. Instead, we can stuff
the relevance {pct} into the SearchMsg object itself and
use that.
Note: upon reviewing this code, the sort-by-relevance seems
bogus as it only considers the relevance of the topmost message.
Instead, it would make more sense to the user to sort by the
highest relevance of all messages in that particular thread.
|
|
We can pass everything we need into the WWW $ctx to avoid
allocating kilobytes of memory for an anonymous sub for every
$MESSAGE_ID/t/ request.
|
|
Both WwwStream and WwwAtomStream ->response pass the WWW $ctx
to the callback nowadays, so we can pass named subs to them.
|
|
We can pass arbitrary local variables via WWW $ctx, so
just pass that into the one-off _do_linkify sub which
already exists.
|
|
msg_iter now passes a user specified arg into the supplied
callback, so we can use that to pass the Digest object into
the \&content_dig_i callback.
|
|
Stash 5 local variables into the WWW $ctx hash table instead of
allocating several kilobytes for an anonymous sub.
|
|
WwwStream already passes the WWW $ctx to the callback sub, so we
don't need to create a new sub every call to capture local variables
for the callback.
|
|
Another place where we can replace anonymous subs with named
subs by passing a user-supplied arg.
|
|
WwwStream already passes the WWW $ctx to the user-supplied
callback, and it's a trivial change for WwwAtomStream to do
the same. Callers in Feed.pm can now take advantage of that
to save a few kilobytes of memory on every response.
|
|
Another place where we can rid ourselves of most anonymous subs
by passing the $ctx arg to the callback.
|
|
cgit users won't need Plack::Util, here.
|
|
Make it easier to share code between our GitHTTPBackend and Cgit
packages, for now, and possibly other packages in the future.
We can avoid inline_object and anonymous subs at the same
time, reducing per-request memory overhead.
|
|
Callers can supply an arg to parse_hdr, now, eliminating the
need for closures to capture local variables.
|
|
This feature was added in preparation for future changes
that have yet to materialize after nearly 3 years. We
can re-add it if needed in the future.
|
|
We can follow what we did in psgi_return to make psgi_qx
allocate less memory on each call.
|
|
Instead of just passing the rpipe to the start_cb, pass the
entire qspawn ref to start_cb. Update existing callers to
avoid circular refs.
|
|
We can take advantage of HTTPD::Async being able to pass
user-supplied args to callbacks to get rid of one (of many)
anonymous subs in the code path.
|
|
Cheaper to use up two hash table slots than creating a new sub.
|
|
rd_hdr() now becomes a named subroutine instead of a per-call
local variable, so kilobytes of memory will not have to be
allocated for it on every ->psgi_return call.
|
|
And remove the last anonymous sub in SolverGit itself.
|
|
This will tie into the DS event loop if that's used, but
event_step an be called directly without relying on the
event loop from Apache or other HTTP servers (or PSGI tests).
|
|
Make things easier-to-follow and paves the way for future work
to reduce dependencies on anonymous subs capturing local variables.
|
|
By passing a user-supplied arg to $qx_cb, we can eliminate the
callers' need to capture on-stack variables with a closure.
This saves several kilobytes of memory allocation at the expense
of some extra hash table lookups in user-supplied callbacks. It
also reduces the risk of memory leaks by eliminating a common
source of circular references.
|
|
Another step towards removing anonymous subs to eliminate
a possible source of memory leaks and high memory use.
|
|
This allows callers to avoid allocating several KB for for every
call to ->async_cat.
|
|
ProcessPipe::CLOSE won't reliably set $? inside the event loop
if waitpid(..., WNOHANG) isn't successful. So use a blocking
waitpid() call, here, and hope "git show-ref" exits promptly
since we've already drained its stdout.
|
|
Solver uses the internal -httpd async API if available for
fairness when applying large patchsets. We must test those
code paths in addition to the generic PSGI code paths.
|
|
We now have coverage for PublicInbox::WwwListing::list_all.
|
|
We need to init all.git for the v2 repo test to ensure
`git --git-dir=v2/all.git rev-parse --git-path objects/info/alternates`
doesn't warn or fail and clutter stderr. This is noticeable
when setting TAIL="tail -F" in env before running this test.
|
|
The "x=A" search results endpoint finally gets test coverage.
|
|
OpenBSD (tested 6.5 on amd64) seems to follow the same semantics
as FreeBSD for S_ISGID, even if config.mak.uname in git.git
doesn't say so.
|
|
Xapian upstream is slowly phasing out the XS-based Search::Xapian
in favor of the SWIG-generated "Xapian" package. While Debian and
both FreeBSD have Search::Xapian, OpenBSD only includes the "Xapian"
binding.
More information about the status of the "Xapian" Perl module here:
https://trac.xapian.org/ticket/523
|
|
The "++" is not yet available in the SWIG-based "Xapian.pm" Perl
bindings, so use "++" where it's supported in both the XS
(Search::Xapian) and SWIG-based Xapian binding.
|
|
This cuts down on lines of code in individual test cases and
fixes some misnamed error messages by using "$0" consistently.
This will also provide us with a method of swapping out
dependencies which provide equivalent functionality (e.g
"Xapian" SWIG can replace "Search::Xapian" XS bindings).
|
|
We can use "use" to get the namespace into the "BEGIN" phase of
the interpreter. While we're at it, use \&coderef syntax
explicitly instead of globbing everything.
|
|
Introduce xover_i, which does the same thing as the anonymous
sub it replaces.
|
|
Introduce hdr_msgid_range_i, which does the same thing as the
anonymous sub it replaces.
|
|
Introduce newnews_i, which does the same thing as the anonymous
sub it replaces.
|
|
Introduce listgroup_range_i and listgroup_all_i subs which
do the same things as the anonymous subs they replace.
|
|
Introduce xrover_i which does the same thing as the anonymous
sub it replaces.
|
|
Introduce searchmsg_range_i, which does the same thing as
the anonymous sub it replaces.
|