aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/attach.php b/include/attach.php
index 0f31ed012..7988286c9 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1632,16 +1632,17 @@ function find_filename_by_hash($channel_id, $attachHash) {
}
/**
- * @brief Pipes $in to $out in 16MB chunks.
+ * @brief Pipes $in to $out in 16KB chunks.
*
* @param resource $in File pointer of input
* @param resource $out File pointer of output
+ * @param int $bufsize size of chunk, default 16384
* @return number with the size
*/
-function pipe_streams($in, $out) {
+function pipe_streams($in, $out, $bufize = 16384) {
$size = 0;
while (!feof($in))
- $size += fwrite($out, fread($in, 16384));
+ $size += fwrite($out, fread($in, $bufsize));
return $size;
}