} elsif ($filename =~ m/\.woff$/) {
$ct = 'application/font-woff';
$nocomp = 1;
+ } elsif ($filename =~ m/\.woff2$/) {
+ $ct = 'application/font-woff2';
+ $nocomp = 1;
} elsif ($filename =~ m/\.ttf$/) {
- $ct = 'application/x-font-ttf';
+ $ct = 'application/font-snft';
+ $nocomp = 1;
+ } elsif ($filename =~ m/\.pdf$/) {
+ $ct = 'application/pdf';
+ $nocomp = 1;
+ } elsif ($filename =~ m/\.epub$/) {
+ $ct = 'application/epub+zip';
$nocomp = 1;
} else {
die "unable to detect content type";
}
if ($param->{port}) {
- $remhost = '127.0.0.1';
+ $remhost = 'localhost';
$remport = $param->{port};
} elsif ($param->{socket}) {
$remhost = 'unix/';
$target = "http://$host:85$uri";
# keep alive for localhost is not worth (connection setup is about 0.2ms)
$keep_alive = 0;
+ } elsif (Net::IP::ip_is_ipv6($host)) {
+ $target = "https://[$host]:8006$uri";
} else {
$target = "https://$host:8006$uri";
}
$reqstate->{hdl}->timeout(0);
$reqstate->{hdl}->wbuf_max(64*10*1024);
- my $remhost = $remip ? $remip : "127.0.0.1";
+ my $remhost = $remip ? $remip : "localhost";
my $remport = $remip ? 3128 : $spiceport;
tcp_connect $remhost, $remport, sub {
return;
}
+ # fork and exit, so that parent starts a new worker
+ if (fork()) {
+ exit(0);
+ }
+
# else we need to wait until all open connections gets closed
my $w; $w = AnyEvent->timer (after => 1, interval => 1, cb => sub {
eval {