Skip to content

Commit 3b4ad14

Browse files
committed
Merge pull request #26 from php-http/joelwurtz-patch-1
Lower buffer size, and use it in the getContents
2 parents 0e4361f + 2b97b2f commit 3b4ad14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Encoding/FilteredStream.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
abstract class FilteredStream implements StreamInterface
1515
{
16-
const BUFFER_SIZE = 65536;
16+
const BUFFER_SIZE = 8192;
1717

1818
use StreamDecorator;
1919

@@ -115,7 +115,7 @@ public function getContents()
115115
$buffer = '';
116116

117117
while (!$this->eof()) {
118-
$buf = $this->read(1048576);
118+
$buf = $this->read(self::BUFFER_SIZE);
119119
// Using a loose equality here to match on '' and false.
120120
if ($buf == null) {
121121
break;

0 commit comments

Comments
 (0)