From 0821af5f21fdb083020ae2e3e79e4227ef59cd4f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 30 Jul 2020 23:43:50 +0000 Subject: www: rework async_* to use method table Although the ->async_next method does not take $self as a receiver, but rather a PublicInbox::HTTP object, we may still retrieve it to be called with the HTTP object via UNIVERSAL->can. --- lib/PublicInbox/WwwStream.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/WwwStream.pm') diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index 23b03f0e..d79770ed 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -28,7 +28,7 @@ sub init { bless $ctx, __PACKAGE__; } -sub async_eml { # ->{async_eml} for async_blob_cb +sub async_eml { # for async_blob_cb my ($ctx, $eml) = @_; $ctx->{http_out}->write($ctx->translate($ctx->{cb}->($ctx, $eml))); } @@ -198,7 +198,7 @@ sub aresponse { my ($ctx, $code, $cb) = @_; my $res_hdr = [ 'Content-Type' => 'text/html; charset=UTF-8' ]; init($ctx, $cb); - $ctx->psgi_response($code, $res_hdr, \&async_next, \&async_eml); + $ctx->psgi_response($code, $res_hdr); } 1; -- cgit v1.2.3-24-ge0c7