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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/DNS.pmod:1: - // $Id: DNS.pmod,v 1.78 2003/08/05 18:04:35 nilsson Exp $ + // $Id: DNS.pmod,v 1.79 2003/08/07 14:22:17 nilsson Exp $   // Not yet finished -- Fredrik Hubinette      //! Domain Name System   //! RFC 1035      #pike __REAL_VERSION__      constant NOERROR=0;   constant FORMERR=1;   constant SERVFAIL=2;
pike.git/lib/modules/Protocols.pmod/DNS.pmod:784:    // upd->wait() can throw an error sometimes.    catch    {    while (udp->wait(RETRY_DELAY))    {    // udp->read() can throw an error on connection refused.    catch {    m = udp->read();    if ((m->port == 53) &&    (m->data[0..1] == s[0..1]) && -  (search(nameservers, m->ip) != -1)) { +  has_value(nameservers, m->ip)) {    // Success.    return decode_res(m->data);    }    };    }    };    }    // Failure.    return 0;    }
pike.git/lib/modules/Protocols.pmod/DNS.pmod:1127:    if(!next_client)    next_client=async_client(nameservers,domains);       next_client->do_query(domain, cl, type, callback, @args);    }       static private void rec_data(mapping m)    {    mixed err;    if (err = catch { -  if(m->port != 53 || search(nameservers, m->ip) == -1) return; +  if(m->port != 53 || !has_value(nameservers, m->ip)) return;    sscanf(m->data,"%2c",int id);    object r=requests[id];    if(!r) return;    m_delete(requests,id);    r->callback(r->domain,decode_res(m->data),@r->args);    destruct(r);    }) {    werror(sprintf("DNS: Failed to read UDP packet. Connection refused?\n"    "%s\n",    describe_backtrace(err)));