From a4df292ed39f6e02a7d57326f291583339cb562d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 2 Mar 2017 03:36:24 +0000 Subject: repobrowse: rework source view to use async cat-file API This will allow most source files to be displayed without blocking public-inbox-httpd on slow disk access. However, we no longer support displaying source files larger than 65536 bytes (the size of a pipe on current Linux). --- lib/PublicInbox/Git.pm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/PublicInbox/Git.pm') diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 3ca0b680..aba4616e 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -283,6 +283,15 @@ sub check_async { } } +sub cat_async { + my ($self, $env, $obj, $cb) = @_; + if ($env->{'pi-httpd.async'}) { + cat_async_ds($self, $obj, $cb); + } else { + cat_async_compat($self, $obj, $cb); + } +} + 1; __END__ =pod -- cgit v1.2.3-24-ge0c7