From f87d3c32bace1552ab7f3a0437e5d6628d0ab5c5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 2 Jan 2021 12:12:06 -1400 Subject: gcf2client: split out request API from regular git While Gcf2Client is designed to mimic what git-cat-file writes to stdout, its request format is different to support requests with a git repository path included. We'll highlight the distinction and make the GitAsyncCat support code easier-to-follow as a result. Since Gcf2Client relies on DS, we can rely on DS-specific code here, too, and use a single Unix socket instead of separate input and output pipes, reducing memory overhead in both users and kernel space. Due to the interactive nature of requests and responses, the buffer size limitations of Unix sockets on Linux seems inconsequential here (just like it is for existing "git cat-file --batch" use). --- lib/PublicInbox/Gcf2.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Gcf2.pm') diff --git a/lib/PublicInbox/Gcf2.pm b/lib/PublicInbox/Gcf2.pm index 0d5c8c57..01b83c96 100644 --- a/lib/PublicInbox/Gcf2.pm +++ b/lib/PublicInbox/Gcf2.pm @@ -75,9 +75,9 @@ sub add_alt ($$) { $gcf2->add_alternate($objdir); } -# Usage: $^X -MPublicInbox::Gcf2 -e 'PublicInbox::Gcf2::loop()' +# Usage: $^X -MPublicInbox::Gcf2 -e PublicInbox::Gcf2::loop # (see lib/PublicInbox/Gcf2Client.pm) -sub loop { +sub loop () { my $gcf2 = new(); my %seen; STDERR->autoflush(1); -- cgit v1.2.3-24-ge0c7