new appraoch
This commit is contained in:
30
pancake/system/vendor/php-http/message/src/Encoding/ChunkStream.php
vendored
Executable file
30
pancake/system/vendor/php-http/message/src/Encoding/ChunkStream.php
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Http\Message\Encoding;
|
||||
|
||||
/**
|
||||
* Transform a regular stream into a chunked one.
|
||||
*
|
||||
* @author Joel Wurtz <joel.wurtz@gmail.com>
|
||||
*/
|
||||
class ChunkStream extends FilteredStream
|
||||
{
|
||||
protected function readFilter(): string
|
||||
{
|
||||
return 'chunk';
|
||||
}
|
||||
|
||||
protected function writeFilter(): string
|
||||
{
|
||||
return 'dechunk';
|
||||
}
|
||||
|
||||
protected function fill(): void
|
||||
{
|
||||
parent::fill();
|
||||
|
||||
if ($this->stream->eof()) {
|
||||
$this->buffer .= "0\r\n\r\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user