From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 02/64] git: ensure ->destroy clobbers check_async read buffer
Date: Fri, 16 Oct 2020 06:59:32 +0000 [thread overview]
Message-ID: <20201016070034.22204-2-e@80x24.org> (raw)
In-Reply-To: <20201016070034.22204-1-e@80x24.org>
It's currently not a problem as ->destroy doesn't
happen for no reason, we'll need to ensure future uses of
->destroy correctly discard the check_async buffer.
---
lib/PublicInbox/Git.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index 2323cecc..449223ec 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -239,7 +239,7 @@ sub check_async_step ($$) {
my ($self, $inflight_c) = @_;
die 'BUG: inflight empty or odd' if scalar(@$inflight_c) < 3;
my ($req, $cb, $arg) = splice(@$inflight_c, 0, 3);
- my $rbuf = delete($self->{rbuf_c}) // \(my $new = '');
+ my $rbuf = delete($self->{chk_rbuf}) // \(my $new = '');
chomp(my $line = my_readline($self->{in_c}, $rbuf));
my ($hex, $type, $size) = split(/ /, $line);
@@ -253,7 +253,7 @@ sub check_async_step ($$) {
}
eval { $cb->($hex, $type, $size, $arg, $self) };
warn "E: check($req) $@\n" if $@;
- $self->{rbuf_c} = $rbuf if $$rbuf ne '';
+ $self->{chk_rbuf} = $rbuf if $$rbuf ne '';
}
sub check_async_wait ($) {
next prev parent reply other threads:[~2020-10-16 7:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-16 6:59 [PATCH 01/64] inbox: add uidvalidity method Eric Wong
2020-10-16 6:59 ` Eric Wong [this message]
2020-10-16 6:59 ` [PATCH 03/64] git: *_async: support nested callback invocations Eric Wong
2020-10-16 6:59 ` [PATCH 04/64] git: async: loop inflight checks for nested callbacks Eric Wong
2020-10-16 7:02 ` oops, :x was supposed to be 1/3 for git: stuff Eric Wong
2020-10-16 7:03 ` [PATCH 01/64] inbox: add uidvalidity method Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201016070034.22204-2-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).