git://git.jankratochvil.net
/
MyWeb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fc5108
)
&a_href_cc: Stabilize 'headers_in' hits at the expense of CPU burden.
author
short
<>
Sun, 18 Sep 2005 17:40:39 +0000
(17:40 +0000)
committer
short
<>
Sun, 18 Sep 2005 17:40:39 +0000
(17:40 +0000)
Web.pm
patch
|
blob
|
history
diff --git
a/Web.pm
b/Web.pm
index
93a4bb5
..
6b76695
100644
(file)
--- a/
Web.pm
+++ b/
Web.pm
@@
-670,12
+670,14
@@
sub a_href_cc($$;%)
{
my($url,$contents,%args)=@_;
+ # A bit ineffective but we must process all the possibilities to get stable 'headers_in' hits!
+ my %map=map(($_=>a_href($url->{$_},$contents,%args)),keys(%$url));
my $cc;
$cc||=Geo::IP->new()->country_code_by_addr(remote_ip()) if $have_Geo_IP;
$cc||="";
-
$url=$url->
{$cc};
- return $
contents if !$url
;
- return
a_href $url,$contents,%arg
s;
+
my $r=$map
{$cc};
+ return $
r if $r
;
+ return
$content
s;
}
sub make ($)