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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/DNS.pmod:2020:    //!    //! @returns    //! Returns a @[Request] object.    //!    //! @note    //! Pike versions prior to 8.0 did not return the @[Request] object.    Request do_query(string domain, int cl, int type,    function(string,mapping,mixed...:void) callback,    mixed ... args)    { +  if (!callback) return UNDEFINED;    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(domain, req, callback, args);    r->retry_co = call_out(retry, RETRY_DELAY, r, 1);    requests[lid] = r;
pike.git/lib/modules/Protocols.pmod/DNS.pmod:2076:    protected private Request generic_get(string d,    mapping answer,    int multi,    int all,    int type,    string field,    string domain,    function callback,    mixed ... args)    { +  if (!callback) return UNDEFINED;    if(!answer || !answer->an || !sizeof(answer->an))    {    if(multi == -1 || multi >= sizeof(domains)) {    // Either a request without multi (ip, or FQDN) or we have tried all    // domains.    callback(domain,0,@args);    } else {    // Multiple domain request. Try the next one...    return do_query(domain+"."+domains[multi], C_IN, type,    generic_get, ++multi, all, type, field, domain,
pike.git/lib/modules/Protocols.pmod/DNS.pmod:2259:    }       protected void close()    {    sock && sock->close();    sock = UNDEFINED;    }       protected void connectedcb(int ok)    { +  if (!callback) return;    if (!ok) {callback(domain, 0, @args); return;}    sock->set_nonblocking(readcb, writecb, closecb);    writebuf=sprintf("%2H",req);    writecb();    }       protected void readcb(mixed id,string data)    {    readbuf+=data;    if (sscanf(readbuf,"%2H",string ret))