]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/updxlrator/updxlrator
update accelerator: Adapt to new squid helper protocol.
[people/teissler/ipfire-2.x.git] / config / updxlrator / updxlrator
index cdfce26d8aa16813e99196c2de431aa42fc94381..2ddc6d8e4425d133d2673c7bc913949723d23970 100644 (file)
@@ -70,7 +70,7 @@ while (<>) {
        $username   = $tmp[2]; if ($username eq '') { $username='-'; };
        $method     = $tmp[3];
 
-       $xlrator_url = $source_url;
+       $xlrator_url = "";
 
        if (($method eq 'GET') || ($method eq 'HEAD')) 
        {
@@ -108,8 +108,8 @@ while (<>) {
        # -----------------------------------------------------------
 
        if (
-               ($source_url =~ m@^[h|f]t?tp://[^?]+\.(deb|rpm)$@i) ||
-               ($source_url =~ m@^[h|f]t?tp://[^?]+/distfiles/[^?]+\.(tar\.gz|tar\.bz2|tgz|zip|patch\.bz2|gz|docx|patch|pdf|exe)$@i)
+               ($source_url =~ m@^[h|f]t?tp://[^?]+\.(pkg\.tar\.xz|deb|rpm)$@i) ||
+               ($source_url =~ m@^[h|f]t?tp://[^?]+/distfiles/[^?]+\.(tar\.gz|tar\.bz2|tar\.xz|tgz|zip|patch\.bz2|gz|docx|patch|pdf|exe)$@i)
        )
        {
                $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Linux",$mirror);
@@ -212,9 +212,11 @@ while (<>) {
 # ----------- ADD NEW SOURCES BEFORE THIS LINE !!! ------------------
        }
 
-       $request="$xlrator_url $hostaddr $username $method\n";
-
-       print $request;
+       if ($xlrator_url) {
+               print "OK rewrite-url=\"$xlrator_url\"\n";
+       } else {
+               print "ERR\n";
+       }
 }
 
 # -------------------------------------------------------------------