diff options
author | Eric Wong <e@80x24.org> | 2021-01-01 19:13:39 -1400 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-01-02 22:38:49 +0000 |
commit | 6dd3c17ed185c0ed4569541dae52e0570be4deca (patch) | |
tree | e5b694ec690130e288361b1131959de3363195b0 /lib/PublicInbox/MboxReader.pm | |
parent | 0bd668ac6f15f791b626f5c644d23952c377b200 (diff) | |
download | public-inbox-6dd3c17ed185c0ed4569541dae52e0570be4deca.tar.gz |
To get rid of the ugly $PublicInbox::DS::in_loop localization in MboxReader, we'll distinguish between ->CLOSE and ->DESTROY with ProcessPipe. If we end up closing via ->DESTROY, we'll assume the caller will want to deal with $? asynchronously via the event loop (or not even care about $?). If we hit ->CLOSE directly, we'll assume the caller called close() and wants to check $? synchronously. Note: wantarray doesn't seem to propagate into tied methods, otherwise I'd be relying on that.
Diffstat (limited to 'lib/PublicInbox/MboxReader.pm')
-rw-r--r-- | lib/PublicInbox/MboxReader.pm | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/PublicInbox/MboxReader.pm b/lib/PublicInbox/MboxReader.pm index 1894756d..59ce4fb6 100644 --- a/lib/PublicInbox/MboxReader.pm +++ b/lib/PublicInbox/MboxReader.pm @@ -5,7 +5,6 @@ package PublicInbox::MboxReader; use strict; use v5.10.1; -use PublicInbox::DS (); # localize $in_loop for error detection :< use Data::Dumper; $Data::Dumper::Useqq = 1; # should've been the default, for bad data @@ -14,7 +13,6 @@ my $from_strict = sub _mbox_from { my ($mbfh, $from_re, $eml_cb, @arg) = @_; - local $PublicInbox::DS::in_loop; # disable dwaitpid my $buf = ''; my @raw; while (defined(my $r = read($mbfh, $buf, 65536, length($buf)))) { @@ -75,7 +73,6 @@ sub _extract_hdr { sub _mbox_cl ($$$;@) { my ($mbfh, $uxs_from, $eml_cb, @arg) = @_; - local $PublicInbox::DS::in_loop; # disable dwaitpid my $buf = ''; while (defined(my $r = read($mbfh, $buf, 65536, length($buf)))) { if ($r == 0) { # detect "curl --fail" |