pike.git / lib / modules / Protocols.pmod / DNS.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/DNS.pmod:1061:   //! // Perform a hostname lookup, results stored in r->an   //! object d=Protocols.DNS.client();   //! mapping r=d->do_sync_query(d->mkquery("pike.lysator.liu.se", C_IN, T_A));   //! @endcode    mapping do_sync_query(string s)    {    int i;    object udp = Stdio.UDP();    // Attempt to randomize the source port.    for (i = 0; i < RETRIES; i++) { -  if (!catch { udp->bind(1024 + random(65536-1024)); }) continue; +  if (!catch { udp->bind(1024 + random(65536-1024),"::"); }) continue;    } -  if (i >= RETRIES) udp->bind(0); +  if (i >= RETRIES) udp->bind(0,"::") || udp->bind(0);   #if 0    werror("Protocols.DNS.client()->do_sync_query(%O)\n"    "UDP Address: %s\n"    "%s\n", s, udp->query_address(), describe_backtrace(backtrace()));   #endif /* 0 */    mapping m;    for (i=0; i < RETRIES; i++) {    udp->send(nameservers[i % sizeof(nameservers)], 53, s);       // upd->wait() can throw an error sometimes.