Browse Source
harden seekable http stream a bit against failures
Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/20385/head
Robin Appelman
6 years ago
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with
13 additions and
3 deletions
-
lib/private/Files/Stream/SeekableHttpStream.php
|
|
|
@ -149,15 +149,25 @@ class SeekableHttpStream implements File { |
|
|
|
} |
|
|
|
|
|
|
|
public function stream_stat() { |
|
|
|
return fstat($this->current); |
|
|
|
if (is_resource($this->current)) { |
|
|
|
return fstat($this->current); |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function stream_eof() { |
|
|
|
return feof($this->current); |
|
|
|
if (is_resource($this->current)) { |
|
|
|
return feof($this->current); |
|
|
|
} else { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function stream_close() { |
|
|
|
fclose($this->current); |
|
|
|
if (is_resource($this->current)) { |
|
|
|
fclose($this->current); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function stream_write($data) { |
|
|
|
|