diff options
author | Eric Wong <e@80x24.org> | 2016-05-21 03:03:17 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-05-21 03:06:07 +0000 |
commit | 97d3489257811dad5381ca8b114d1b0c45554a20 (patch) | |
tree | e594a59732abed2e3512ad79205be030fccbff07 /lib/PublicInbox/Git.pm | |
parent | 21cea5b3a662e66e69064456a1fec348f0834f64 (diff) | |
download | public-inbox-97d3489257811dad5381ca8b114d1b0c45554a20.tar.gz |
This allows us to easily provide gigantic inboxes with proper backpressure handling for slow clients. It also eliminates public-inbox-httpd and Danga::Socket-specific knowledge from this class, making it easier to follow for those used to generic PSGI applications.
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r-- | lib/PublicInbox/Git.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index d8211827..473cdffa 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -41,6 +41,7 @@ sub cat_file { $self->{out}->print($obj, "\n") or fail($self, "write error: $!"); my $in = $self->{in}; + local $/ = "\n"; my $head = $in->getline; $head =~ / missing$/ and return undef; $head =~ /^[0-9a-f]{40} \S+ (\d+)$/ or @@ -90,6 +91,7 @@ sub check { my ($self, $obj) = @_; $self->_bidi_pipe(qw(--batch-check in_c out_c pid_c)); $self->{out_c}->print($obj, "\n") or fail($self, "write error: $!"); + local $/ = "\n"; chomp(my $line = $self->{in_c}->getline); my ($hex, $type, $size) = split(' ', $line); return if $type eq 'missing'; |