Fix read in callbackwrapper

The number of read bytes is not the same as the number of bytes
requested to read.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-02-14 15:28:47 +01:00
commit 0bc7fe4cb1
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -90,7 +90,7 @@ class CallbackWrapper extends Wrapper {
public function stream_read($count) { public function stream_read($count) {
$result = parent::stream_read($count); $result = parent::stream_read($count);
if (is_callable($this->readCallback)) { if (is_callable($this->readCallback)) {
call_user_func($this->readCallback, $count); call_user_func($this->readCallback, $result);
} }
return $result; return $result;
} }