Skip to content
Snippets Groups Projects
Commit ba8ea0e6 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Improved handling of connection refused in do_sync_query().

Rev: lib/modules/Protocols.pmod/DNS.pmod:1.41
parent 166f8974
No related branches found
No related tags found
No related merge requests found
...@@ -563,6 +563,8 @@ class client ...@@ -563,6 +563,8 @@ class client
udp->send(nameservers[i % sizeof(nameservers)], 53, s); udp->send(nameservers[i % sizeof(nameservers)], 53, s);
while (udp->wait(RETRY_DELAY)) { while (udp->wait(RETRY_DELAY)) {
// udp->read() can throw an error on connection refused.
catch {
m = udp->read(); m = udp->read();
if ((m->port == 53) && if ((m->port == 53) &&
(m->data[0..1] == s[0..1]) && (m->data[0..1] == s[0..1]) &&
...@@ -570,6 +572,7 @@ class client ...@@ -570,6 +572,7 @@ class client
// Success. // Success.
return decode_res(m->data); return decode_res(m->data);
} }
};
} }
} }
// Failure. // Failure.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment