about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-02-24 00:47:45 +0000
committerEric Wong <e@80x24.org>2017-02-24 01:59:33 +0000
commitee6b0dac82b05ef83b497787591de8b3645e0288 (patch)
treed852399f357bbf4a4d7e23cd06b82d71564e086d /lib
parentc1043e6471fdd5d88ceb6ed53a6af330d20b85a7 (diff)
downloadpublic-inbox-ee6b0dac82b05ef83b497787591de8b3645e0288.tar.gz
We don't actually know what context we'll be called under,
so detecting the mere use-ability of Danga::Socket is not
sufficient.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Git.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index caca3b09..3ca0b680 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -274,12 +274,13 @@ sub cat_async_compat ($$$) {
         fail($self, 'newline missing after blob') if ($r != 1 || $buf ne "\n");
 }
 
-if ($have_async) {
-        *check_async = *check_async_ds;
-        *cat_async = *cat_async_ds;
-} else {
-        *check_async = *check_async_compat;
-        *cat_async = *cat_async_compat;
+sub check_async {
+        my ($self, $env, $obj, $cb) = @_;
+        if ($env->{'pi-httpd.async'}) {
+                check_async_ds($self, $obj, $cb);
+        } else {
+                check_async_compat($self, $obj, $cb);
+        }
 }
 
 1;