+ if (my $http_out = delete $self->{http_out}) {
+ $http_out->write(zflush($self));
+ $http_out->close;
+ }
+}
+
+# this is public-inbox-httpd-specific
+sub async_blob_cb { # git->cat_async callback
+ my ($bref, $oid, $type, $size, $self) = @_;
+ my $http = $self->{env}->{'psgix.io'} or return; # client abort
+ my $smsg = $self->{smsg} or die 'BUG: no smsg';
+ if (!defined($oid)) {
+ # it's possible to have TOCTOU if an admin runs
+ # public-inbox-(edit|purge), just move onto the next message
+ return $http->next_step($self->{async_next});
+ }
+ $smsg->{blob} eq $oid or die "BUG: $smsg->{blob} != $oid";
+ $self->{async_eml}->($self, PublicInbox::Eml->new($bref));
+ $http->next_step($self->{async_next});
+}
+
+sub smsg_blob {
+ my ($self, $smsg) = @_;
+ git_async_cat($self->{-inbox}->git, $smsg->{blob},
+ \&async_blob_cb, $self);