mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Use new function to get buffer size, instead of hard-coding
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user