mirror of
https://github.com/webmin/webmin.git
synced 2026-07-04 09:30:30 +01:00
Undo recent encoding fixes, add stack trace on failed syswrite
This commit is contained in:
16
miniserv.pl
16
miniserv.pl
@@ -861,12 +861,7 @@ while(1) {
|
||||
# got new connection
|
||||
$acptaddr = accept(SOCK, $s);
|
||||
if (!$acptaddr) { next; }
|
||||
if ($use_ssl) {
|
||||
binmode(SOCK);
|
||||
}
|
||||
else {
|
||||
binmode(SOCK, ':utf8');
|
||||
}
|
||||
binmode(SOCK);
|
||||
|
||||
# create pipes
|
||||
local ($PASSINr, $PASSINw, $PASSOUTr, $PASSOUTw);
|
||||
@@ -2658,7 +2653,6 @@ else {
|
||||
"Last-Modified: ".&http_date($stopen[9])."\r\n".
|
||||
"Expires: ".&http_date(time()+$etime)."\r\n".
|
||||
"Cache-Control: public; max-age=".$etime."\r\n";
|
||||
binmode(SOCK); # Compressed data is NOT UTF-8
|
||||
|
||||
if (!$gzipped && $use_gzip && $acceptenc{'gzip'} &&
|
||||
&should_gzip_file($full)) {
|
||||
@@ -3143,7 +3137,13 @@ if ($use_ssl) {
|
||||
Net::SSLeay::write($ssl_con, $str);
|
||||
}
|
||||
else {
|
||||
syswrite(SOCK, $str, length($str));
|
||||
eval { syswrite(SOCK, $str, length($str)); };
|
||||
if ($@) {
|
||||
print STDERR $@,"\n";
|
||||
for(my $i=0; my @stack = caller($i); $i++) {
|
||||
print STDERR join(" ", @stack),"\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
# Intentionally introduce a small delay to avoid problems where IE reports
|
||||
# the page as empty / DNS failed when it get a large response too quickly!
|
||||
|
||||
Reference in New Issue
Block a user