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:863:
if (udp->bind(0, "::1") && udp->bind(0, "::") && (udp->send("127.0.0.1", 9, "/dev/null") == 9) && (udp->send("::1", 9, "/dev/null") == 9)) { // Note: The above tests are apparently not sufficient, since // WIN32 happily pretends to send stuff to ::ffff:0:0/96... Stdio.UDP udp2 = Stdio.UDP(); if (udp2->bind(0, "127.0.0.1")) { // IPv4 is present. array(string) a = udp2->query_address()/" "; int port = (int)a[1];
-
string key =
Crypto.Random.
random_string(16);
+
string key = random_string(16);
udp2->set_nonblocking(); // We shouldn't get any lost packets, since we're on the loop-back, // but for paranoia reasons we perform a couple of retries. retry: for (int i = 0; i < 16; i++) { if (!udp->send("127.0.0.1", port, key)) continue; // udp2->wait() throws errors on WIN32. catch(udp2->wait(1)); mapping res;