]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Made storeid_file_rewrite support concurrency protocol
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 14 Apr 2014 13:50:27 +0000 (15:50 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 14 Apr 2014 13:50:27 +0000 (15:50 +0200)
helpers/storeid_rewrite/file/storeid_file_rewrite.pl.in

index 342858cd17d81ede5162e2dfee8326a22213e8f1..c0d38565a94b8daa0ae3e28017349c69dabb4f95 100644 (file)
@@ -53,7 +53,12 @@ close RULES;
 URL: while (<STDIN>) {
        chomp;
        last if $_ eq 'quit';
-       
+
+  my $channel = "";
+  if (s/^(\d+\s+)//o) {
+    $channel = $1;
+  }
+
        foreach my $rule (@rules) {
                if (my @match = /$rule->[0]/) {
                        $_ = $rule->[1];
@@ -61,11 +66,11 @@ URL: while (<STDIN>) {
                        for (my $i=1; $i<=scalar(@match); $i++) {
                                s/\$$i/$match[$i-1]/g;
                        }
-                       print "OK store-id=$_\n";
+                       print $channel, "OK store-id=$_\n";
                        next URL;
                }
        }
-       print "ERR\n";
+       print $channel, "ERR\n";
 }
 
 =pod