Skip to content

Commit

Permalink
Merge pull request #16182 from mlschroe/master
Browse files Browse the repository at this point in the history
[backend] BSHTTP::read_data: save some memory
  • Loading branch information
mlschroe committed May 23, 2024
2 parents c654b55 + 1a2ae6b commit 92bd65f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/backend/BSHTTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,11 @@ sub read_data {
$cl = $maxl = length($qu);
}
}
$cl -= $maxl if defined($cl);
$ret = substr($qu, 0, $maxl);
$cl -= $maxl if defined $cl;
$req->{'__cl'} = $cl;
$req->{'__data'} = substr($qu, $maxl);
$req->{'__data'} = substr($qu, $maxl, length($qu) - $maxl, '');
$req->{'__eof'} = 1 if defined($cl) && $cl == 0;
return $ret;
return $qu;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/backend/BSServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ sub server {
last unless $pid > 0;
my $slot = delete $chld{$pid};
$slot = delete $chld2{$pid} unless defined $slot;
printf("Child %d died from signal %d\n", $pid, $? & 127) if $? & 127;
if (defined($slot)) {
if ($serverstatus_ok && defined(sysseek(STA, $slot * 256, Fcntl::SEEK_SET))) {
syswrite(STA, "\0" x 256, 256);
Expand Down

0 comments on commit 92bd65f

Please sign in to comment.