about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwStream.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-09-10 08:16:58 +0000
committerEric Wong <e@80x24.org>2022-09-10 19:50:29 +0000
commit0ff8c4f7e0815a0aa2e9935dd07ae446ce83c906 (patch)
treef78d95863027d2eab6b6cf374dd24f80d14002a7 /lib/PublicInbox/WwwStream.pm
parent10839bf81e72f7699ba818db35237028731cf1fd (diff)
downloadpublic-inbox-0ff8c4f7e0815a0aa2e9935dd07ae446ce83c906.tar.gz
viewvcs: use shorter and simpler ctx->html_done
We only return 200s for any response large enough to warrant
->html_done, so we can just assume it.  ViewVCS can also take
advantage of it with some tweaking to avoid an extra method
dispatch.
Diffstat (limited to 'lib/PublicInbox/WwwStream.pm')
-rw-r--r--lib/PublicInbox/WwwStream.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index 1fc213d4..c23668a4 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -167,12 +167,12 @@ sub getline {
         $ctx->zflush(_html_end($ctx));
 }
 
-sub html_done ($$) {
-        my ($ctx, $code) = @_;
-        my $bdy = $ctx->zflush(_html_end($ctx));
+sub html_done ($;@) {
+        my $ctx = $_[0];
+        my $bdy = $ctx->zflush(@_[1..$#_], _html_end($ctx));
         my $res_hdr = delete $ctx->{-res_hdr};
         push @$res_hdr, 'Content-Length', length($bdy);
-        [ $code, $res_hdr, [ $bdy ] ]
+        [ 200, $res_hdr, [ $bdy ] ]
 }
 
 sub html_oneshot ($$;@) {