]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WWW.pm
www: manifest.js.gz generation no longer hogs event loop
[public-inbox.git] / lib / PublicInbox / WWW.pm
index 289d0ce48e255a9bf4e315164ed380da284f2fe4..93ab3c9d82c7ee12b8139420f07dee6d2cd13396 100644 (file)
@@ -301,9 +301,8 @@ sub get_text {
 }
 
 # show git objects (blobs and commits)
-# /$INBOX/_/$OBJECT_ID/show
-# /$INBOX/_/${OBJECT_ID}_${FILENAME}
-# KEY may contain slashes
+# /$INBOX/$GIT_OBJECT_ID/s/
+# /$INBOX/$GIT_OBJECT_ID/s/$FILENAME
 sub get_vcs_object ($$$;$) {
        my ($ctx, $inbox, $oid, $filename) = @_;
        my $r404 = invalid_inbox($ctx, $inbox);
@@ -322,12 +321,11 @@ sub get_altid_dump {
 
 sub need {
        my ($ctx, $extra) = @_;
-       my $msg = <<EOF;
-<html><head><title>$extra not available for this
-public-inbox</title><body><pre>$extra is not available for this public-inbox
-<a href="../">Return to index</a></pre></body></html>
+       require PublicInbox::WwwStream;
+       PublicInbox::WwwStream::html_oneshot($ctx, 501, \<<EOF);
+<pre>$extra is not available for this public-inbox
+<a\nhref="../">Return to index</a></pre>
 EOF
-       [ 501, [ 'Content-Type' => 'text/html; charset=UTF-8' ], [ $msg ] ];
 }
 
 # /$INBOX/$MESSAGE_ID/t.mbox           -> thread as mbox
@@ -511,8 +509,8 @@ sub get_inbox_manifest ($$$) {
        my ($ctx, $inbox, $key) = @_;
        my $r404 = invalid_inbox($ctx, $inbox);
        return $r404 if $r404;
-       require PublicInbox::WwwListing;
-       PublicInbox::WwwListing::js($ctx->{env}, [$ctx->{-inbox}]);
+       require PublicInbox::ManifestJsGz;
+       PublicInbox::ManifestJsGz::response($ctx->{env}, [$ctx->{-inbox}]);
 }
 
 sub get_attach {