Skip to content

Commit b38903e

Browse files
committed
Fix for "Maximum execution time of 30 seconds exceeded" error
1 parent bbe6a12 commit b38903e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Net/Socket.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,9 @@ function readAll()
601601
}
602602

603603
$data = '';
604-
while (!feof($this->fp)) {
604+
$timeout = time() + $this->timeout;
605+
606+
while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) {
605607
$data .= @fread($this->fp, $this->lineLength);
606608
}
607609
return $data;
@@ -683,4 +685,4 @@ function enableCrypto($enabled, $type)
683685
}
684686
}
685687

686-
}
688+
}

0 commit comments

Comments
 (0)