aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/http/lib/Sapi.php
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2017-07-07 12:16:27 +0200
committerGitHub <noreply@github.com>2017-07-07 12:16:27 +0200
commitd077f15270e7c6954a7fb4d6e4d60d6dbb0777c7 (patch)
treefdfd2b1908a87f6e1396046ee95307506c079172 /vendor/sabre/http/lib/Sapi.php
parentb16e4c558ffb47d2b48f0dab97e4389c9198f831 (diff)
parent31d1a728544f7ae740463cd0d1f345544175fcd2 (diff)
downloadvolse-hubzilla-d077f15270e7c6954a7fb4d6e4d60d6dbb0777c7.tar.gz
volse-hubzilla-d077f15270e7c6954a7fb4d6e4d60d6dbb0777c7.tar.bz2
volse-hubzilla-d077f15270e7c6954a7fb4d6e4d60d6dbb0777c7.zip
Merge pull request #822 from dawnbreak/composer-light
Add optimize-autoloader to composer config.
Diffstat (limited to 'vendor/sabre/http/lib/Sapi.php')
-rw-r--r--vendor/sabre/http/lib/Sapi.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/sabre/http/lib/Sapi.php b/vendor/sabre/http/lib/Sapi.php
index 6c83c8719..6fc6452e4 100644
--- a/vendor/sabre/http/lib/Sapi.php
+++ b/vendor/sabre/http/lib/Sapi.php
@@ -75,7 +75,15 @@ class Sapi {
if ($contentLength !== null) {
$output = fopen('php://output', 'wb');
if (is_resource($body) && get_resource_type($body) == 'stream') {
- stream_copy_to_stream($body, $output, $contentLength);
+ if (PHP_INT_SIZE !== 4){
+ // use the dedicated function on 64 Bit systems
+ stream_copy_to_stream($body, $output, $contentLength);
+ } else {
+ // workaround for 32 Bit systems to avoid stream_copy_to_stream
+ while (!feof($body)) {
+ fwrite($output, fread($body, 8192));
+ }
+ }
} else {
fwrite($output, $body, $contentLength);
}