projects
/
selectricity-live
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix WHOIS library not to puke on strange IP addresses
[selectricity-live]
/
app
/
views
/
quickvote
/
list_voters.rhtml
diff --git
a/app/views/quickvote/list_voters.rhtml
b/app/views/quickvote/list_voters.rhtml
index 1672499f0a3b38af7fe185ee5e750e4a5b703667..695794fc3f536d4776897b845b0460b548ba4086 100644
(file)
--- a/
app/views/quickvote/list_voters.rhtml
+++ b/
app/views/quickvote/list_voters.rhtml
@@
-27,13
+27,17
@@
voter.ipaddress =~ /^172\.[1-3]/
%>
<% w=nil
voter.ipaddress =~ /^172\.[1-3]/
%>
<% w=nil
+ puts "WHOIS #{voter.ipaddress}"
if Cache and w=Cache.get("WHOIS:#{voter.ipaddress}")
elsif Cache
if Cache and w=Cache.get("WHOIS:#{voter.ipaddress}")
elsif Cache
- w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)
+ puts "CREATE"
+ w= Whois::Whois.new(IPAddr.new(voter.ipaddress),false)
+ puts "SEARCH"
w.search_whois
w.search_whois
+ puts "DONE"
Cache.set("WHOIS:#{voter.ipaddress}", w)
else
Cache.set("WHOIS:#{voter.ipaddress}", w)
else
- w= Whois::Whois.new(IPAddr.new(voter.ipaddress),
tru
e)
+ w= Whois::Whois.new(IPAddr.new(voter.ipaddress),
fals
e)
w.search_whois
end
w.search_whois
end
Benjamin Mako Hill
||
Want to submit a patch?