diff options
author | Eric Wong <e@80x24.org> | 2016-03-07 19:10:33 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-04-29 18:50:59 +0000 |
commit | 0b0d9b7f6237593c69dc38ec64566343fd20191c (patch) | |
tree | 09de86d78c876d2c9b1aaefd39f2d703adb4d272 /lib/PublicInbox | |
parent | e901b85c67912a3fd8d17ac0460a57029439f71d (diff) | |
download | public-inbox-0b0d9b7f6237593c69dc38ec64566343fd20191c.tar.gz |
The blocking PSGI server may cause EINTR to be hit, here.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/GitHTTPBackend.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm index a7cac100..30efa839 100644 --- a/lib/PublicInbox/GitHTTPBackend.pm +++ b/lib/PublicInbox/GitHTTPBackend.pm @@ -205,18 +205,18 @@ sub serve_smart { ref($dumb) eq 'ARRAY' ? $res->($dumb) : $dumb->($res); }; my $fail = sub { - my ($e) = @_; - if ($e eq 'EAGAIN') { + if ($!{EAGAIN} || $!{EINTR}) { select($vin, undef, undef, undef) if defined $vin; # $vin is undef on async, so this is a noop on EAGAIN return; } + my $e = $!; $end->(); $err->print("git http-backend ($git_dir): $e\n"); }; my $cb = sub { # read git-http-backend output and stream to client my $r = $rpipe ? $rpipe->sysread($buf, 8192, length($buf)) : 0; - return $fail->($!{EAGAIN} ? 'EAGAIN' : $!) unless defined $r; + return $fail->() unless defined $r; return $end->() if $r == 0; # EOF if ($fh) { # stream body from git-http-backend to HTTP client $fh->write($buf); |