net/dns.lua

changeset 1823
7c3ec7ac6316
parent 1815
1c0bde3db7d8
parent 1822
2f78ea5d0f11
child 1833
f4c88dd32724
--- a/net/dns.lua	Fri Sep 25 03:23:31 2009 +0500
+++ b/net/dns.lua	Thu Sep 24 23:47:16 2009 +0100
@@ -95,7 +95,10 @@
     if rr.tod then
       -- rr.tod = rr.tod - 50    -- accelerated decripitude
       rr.ttl = math.floor (rr.tod - time)
-      if rr.ttl <= 0 then  rrs[i] = nil  end
+      if rr.ttl <= 0 then
+        table.remove(rrs, i);
+        return prune(rrs, time, soft); -- Re-iterate
+      end
 
     elseif soft == 'soft' then    -- What is this?  I forget!
       assert (rr.ttl == 0)
@@ -507,7 +510,7 @@
   local resolv_conf = io.open("/etc/resolv.conf");
   if resolv_conf then
 	  for line in resolv_conf:lines() do
-		local address = string.match (line, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)')
+		local address = string.match (line, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)%s*$')
 		if address then self:addnameserver (address)  end
 	  end
   elseif os.getenv("WINDIR") then

mercurial