pike.git
/
lib
/
modules
/
Protocols.pmod
/
DNS.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Protocols.pmod/DNS.pmod:1527:
if (nsno >= sizeof(nameservers)) { if(r->retries++ > RETRIES) { r->retry_co = call_out(remove, REMOVE_DELAY, r); return; } else { nsno = 0; } }
-
send(nameservers[nsno],53,r->req);
+
r->retry_co = call_out(retry, RETRY_DELAY, r, nsno+1);
-
+
udp::send(nameservers[nsno], 53, r->req);
} void do_query(string domain, int cl, int type, function(string,mapping,mixed...:void) callback, mixed ... args) { for(int e=next_client ? 100 : 256;e>=0;e--) { int lid = random(65536); if(!catch { requests[lid]++; }) { string req=low_mkquery(lid,domain,cl,type); object r=Request(); r->req=req; r->domain=domain; r->callback=callback; r->args=args; r->timestamp=time();
-
requests[lid]=r;
-
udp::send(nameservers[0],53,r->req);
+
r->retry_co = call_out(retry, RETRY_DELAY, r, 1);
-
+
requests[lid] = r;
+
udp::send(nameservers[0], 53, req);
return; } } /* We failed miserably to find a request id to use, * so we create a second UDP port to be able to have more * requests 'in the air'. /Hubbe */ if(!next_client) next_client=async_client(nameservers,domains);