Diff

net/dns.lua @ 5266:5c3a3ef6b769

net.dns: Clean up query list when a server is marked down
author Matthew Wild <mwild1@gmail.com>
date Sat, 22 Dec 2012 12:06:36 +0000
parent 4422:c25dee24623f
child 5267:a2080e5c4eda
line wrap: on
line diff
--- a/net/dns.lua	Fri Dec 21 20:40:29 2012 +0100
+++ b/net/dns.lua	Sat Dec 22 12:06:36 2012 +0000
@@ -549,6 +549,7 @@
 
 	if not force then
 		if not self.active[response.header.id] or not self.active[response.header.id][response.question.raw] then
+			self.active[response.header.id] = nil;
 			return nil;
 		end
 	end
@@ -796,6 +797,9 @@
 				end
 			end
 		end
+		if next(queries) == nil then
+			self.active[id] = nil;
+		end
 	end
 
 	if num == self.best_server then
@@ -852,6 +856,7 @@
 						set(self.wanted, q.class, q.type, q.name, nil);
 					end
 				end
+				
 			end
 		end
 	end