]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/GitHTTPBackend.pm
git-http-backend: favor sysread for regular files
[public-inbox.git] / lib / PublicInbox / GitHTTPBackend.pm
index 56bf24f4588c97036bf39291cb93016621528896..50bb4331f5aaaa017b21d846fdbd040d32d0ca79 100644 (file)
@@ -73,7 +73,7 @@ sub serve {
                my $n = 8192;
                while ($len > 0) {
                        $n = $len if $len < $n;
-                       my $r = read($in, $buf, $n);
+                       my $r = sysread($in, $buf, $n);
                        last if (!defined($r) || $r <= 0);
                        $len -= $r;
                        $fh->write($buf);
@@ -224,7 +224,7 @@ sub serve_smart {
        if (my $async = $env->{'pi-httpd.async'}) {
                $rpipe = $async->($rpipe, $cb);
                sub { ($res) = @_ } # let Danga::Socket handle the rest.
-       } else { # synchronous loop
+       } else { # synchronous loop for other PSGI servers
                $vin = '';
                vec($vin, fileno($rpipe), 1) = 1;
                sub {