diff --git a/mailboxes/boxes-lib.pl b/mailboxes/boxes-lib.pl index 483ab78cd..08e1e36ba 100755 --- a/mailboxes/boxes-lib.pl +++ b/mailboxes/boxes-lib.pl @@ -3074,7 +3074,8 @@ if (&should_switch_to_mail_user()) { &open_as_mail_user(SRC, $src) || return 0; &open_as_mail_user(DST, ">$dst") || return 0; my $buf; - while(read(SRC, $buf, 32768) > 0) { + my $bs = &get_buffer_size(); + while(read(SRC, $buf, $bs) > 0) { print DST $buf; } close(SRC); diff --git a/mailboxes/detach.cgi b/mailboxes/detach.cgi index 8ba85c064..a9bc8af6e 100755 --- a/mailboxes/detach.cgi +++ b/mailboxes/detach.cgi @@ -53,13 +53,14 @@ if ($in{'scale'}) { ($jpegin, $jpegout) = &pipeopen("pnmscale $scale 2>/dev/null | cjpeg"); print $jpegin $type; print $jpegin $size; - while(read($pnmout, $buf, 32768)) { + my $bs = &get_buffer_size(); + while(read($pnmout, $buf, $bs)) { print $jpegin $buf; } close($jpegin); close($pnmout); print "Content-type: image/jpeg\n\n"; - while(read($jpegout, $buf, 32768)) { + while(read($jpegout, $buf, $bs)) { print $buf; } close($jpegout); diff --git a/mailboxes/detachall.cgi b/mailboxes/detachall.cgi index 25924bc9f..2f863406d 100755 --- a/mailboxes/detachall.cgi +++ b/mailboxes/detachall.cgi @@ -55,7 +55,8 @@ if ($?) { # Output the ZIP print "Content-type: application/zip\n\n"; open(ZIP, "<$zip"); -while(read(ZIP, $buf, 32768) > 0) { +my $bs = &get_buffer_size(); +while(read(ZIP, $buf, $bs) > 0) { print $buf; } close(ZIP); diff --git a/updown/fetch.cgi b/updown/fetch.cgi index cb6dfcfed..047da9c07 100755 --- a/updown/fetch.cgi +++ b/updown/fetch.cgi @@ -53,7 +53,8 @@ if ($ENV{'PATH_INFO'}) { print "Content-type: application/zip\n\n"; open(FILE, "<$temp"); unlink($temp); - while(read(FILE, $buffer, 32768)) { + my $bs = &get_buffer_size(); + while(read(FILE, $buffer, $bs)) { print("$buffer"); } close(FILE); diff --git a/usermin/export_mod.cgi b/usermin/export_mod.cgi index 5fc1e3ef4..01805a3e4 100755 --- a/usermin/export_mod.cgi +++ b/usermin/export_mod.cgi @@ -30,7 +30,8 @@ if ($in{'to'} == 0) { print "Content-type: application/octet-stream\n\n"; open(TEMP, "<$temp"); my $buf; - while(read(TEMP, $buf, 32768)) { + my $bs = &get_buffer_size(); + while(read(TEMP, $buf, $bs)) { print $buf; } close(TEMP); diff --git a/webmin/export_mod.cgi b/webmin/export_mod.cgi index 503fa3b5a..26fc9958a 100755 --- a/webmin/export_mod.cgi +++ b/webmin/export_mod.cgi @@ -28,7 +28,8 @@ if ($in{'to'} == 0) { print "Content-type: application/x-gzip\n\n"; open(TEMP, "<$temp"); my $buf; - while(read(TEMP, $buf, 32768)) { + my $bs = &get_buffer_size(); + while(read(TEMP, $buf, $bs)) { print $buf; } close(TEMP);