]> git.treefish.org Git - fex.git/blobdiff - lib/dop
Original release 20150729
[fex.git] / lib / dop
diff --git a/lib/dop b/lib/dop
index df9511b70538fcd64f69ac88444d05805ea74283..9c428a52bd688da30b68d8b1316d97217cf0c538 100755 (executable)
--- a/lib/dop
+++ b/lib/dop
@@ -16,7 +16,7 @@ use Cwd       qw(getcwd abs_path);
 # import from fex.pp
 our ($bs,$tmpdir,@doc_dirs);
 
 # import from fex.pp
 our ($bs,$tmpdir,@doc_dirs);
 
-my $log = "$logdir/dop.log";
+my $log = 'dop.log';
 
 # POSIX time format needed for HTTP header
 setlocale(LC_TIME,'POSIX');
 
 # POSIX time format needed for HTTP header
 setlocale(LC_TIME,'POSIX');
@@ -46,12 +46,10 @@ sub dop {
     $doc = "$path/$link";
     $doc =~ s:/+:/:g;
     $doc =~ s:^/::;
     $doc = "$path/$link";
     $doc =~ s:/+:/:g;
     $doc =~ s:^/::;
-    $host = $ENV{HTTP_HOST} || $hostname;
     nvt_print(
     nvt_print(
-      "HTTP/1.1 301 Moved Permanently",
-      "Location: $ENV{PROTO}://$host/$doc",
+      "HTTP/1.1 302 Found",
+      "Location: /$doc",
       "Content-Length: 0",
       "Content-Length: 0",
-      "Connection: close",
       ""
     );
     &reexec;
       ""
     );
     &reexec;
@@ -307,6 +305,7 @@ sub http_output {
     if ($type eq 'text/html') {
       alarm($timeout*10);
       print $htmldoc;
     if ($type eq 'text/html') {
       alarm($timeout*10);
       print $htmldoc;
+      $s = $size;
     } else {
       # binary data # can be stream!
       seek $file,$seek,0 if $seek;
     } else {
       # binary data # can be stream!
       seek $file,$seek,0 if $seek;
@@ -417,11 +416,6 @@ sub showindex {
 }
 
 
 }
 
 
-sub mtime {
-  return (lstat shift)[9];
-}
-
-
 sub d3 {
   local $_ = shift;
   while (s/(\d)(\d\d\d\b)/$1,$2/) {};
 sub d3 {
   local $_ = shift;
   while (s/(\d)(\d\d\d\b)/$1,$2/) {};