-sub rbuf_process {
- my ($self, $rbuf) = @_;
- $rbuf //= $self->{rbuf} // (\(my $x = ''));
-
- my %env = %{$self->{httpd}->{env}}; # full hash copy
- my $r = parse_http_request($$rbuf, \%env);
-
- # We do not support Trailers in chunked requests, for now
- # (they are rarely-used and git (as of 2.7.2) does not use them)
- if ($r == -1 || $env{HTTP_TRAILER} ||
- # this length-check is necessary for PURE_PERL=1:
- ($r == -2 && bytes::length($$rbuf) > 0x4000)) {
- return quit($self, 400);
- }
- if ($r < 0) { # incomplete
- $self->rbuf_idle($rbuf);
- return $self->requeue;
+ my $rbuf = $self->{rbuf} // (\(my $x = ''));
+ my %env = %{$self->{srv_env}}; # full hash copy
+ my $r;
+ while (($r = parse_http_request($$rbuf, \%env)) < 0) {
+ # We do not support Trailers in chunked requests, for
+ # now (they are rarely-used and git (as of 2.7.2) does
+ # not use them).
+ # this length-check is necessary for PURE_PERL=1:
+ if ($r == -1 || $env{HTTP_TRAILER} ||
+ ($r == -2 && length($$rbuf) > 0x4000)) {
+ return quit($self, 400);
+ }
+ $self->do_read($rbuf, 8192, length($$rbuf)) or return;