Skip to content

Commit

Permalink
increase read size limits when searching for chunk InhabitedTime values
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtThiemann committed Nov 28, 2022
1 parent f3393fc commit 933645e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Chunk/AnvilChunk.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function getInhabitedTime(): int
protected function readAfter(
string $str,
int $length,
int $limit = 8192
int $limit = 1024 * 1024 * 10
): ?string {
$startPointer = $this->zlibReader->tell();
$strPointer = 0;
Expand All @@ -197,7 +197,7 @@ protected function readAfter(
!$this->zlibReader->eof()
&& $this->zlibReader->tell() < $startPointer + $limit
) {
$data = $this->zlibReader->read(512);
$data = $this->zlibReader->read(2048);
$dataStart = $this->zlibReader->tell() - strlen($data);
$pos = strpos($data, $str);
if ($pos !== false) {
Expand Down

0 comments on commit 933645e

Please sign in to comment.