Ticket #200: split.diff

File split.diff, 2.8 KB (added by jinmei, 9 years ago)
  • sqlite3_datasrc.cc

     
    330330Sqlite3DataSrc::findClosest(const Name& name, unsigned int* position) const {
    331331    const unsigned int nlabels = name.getLabelCount();
    332332    for (unsigned int i = 0; i < nlabels; ++i) {
    333         const Name matchname(name.split(i, nlabels - i));
     333        const Name matchname(name.split(i));
    334334        const int rc = hasExactZone(matchname.toText().c_str());
    335335        if (rc >= 0) {
    336336            if (position != NULL) {
     
    356356        return;
    357357    }
    358358
    359     match.update(*this, match.qname().split(position,
    360                                             match.qname().getLabelCount() -
    361                                             position));
     359    match.update(*this, match.qname().split(position));
    362360}
    363361
    364362DataSrc::Result
  • data_source.cc

     
    212212    if (diff > 1) {
    213213        bool found = false;
    214214        RRsetList ref;
    215         for (int i = diff; i > 1; --i) {
    216             const Name sub(task->qname.split(i - 1, nlen - i));
     215        for (int i = diff - 1; i >= 0; --i) {
     216            const Name sub(task->qname.split(i));
    217217            if (refQuery(sub, q.qclass(), ds, zonename, ref)) {
    218218                found = true;
    219219                break;
     
    364364        const int diff = nlen - enclosure.getLabelCount();
    365365        string hash2;
    366366        for (int i = 1; i <= diff; ++i) {
    367             enclosure = task->qname.split(i, nlen - i);
     367            enclosure = task->qname.split(i);
    368368            string nodehash(nsec3->getHash(enclosure));
    369369            if (nodehash == hash1) {
    370370                break;
     
    445445    bool cname = false;
    446446
    447447    for (int i = 1; i <= diff; ++i) {
    448         const Name& wname(star.concatenate(task->qname.split(i, nlen - i)));
     448        const Name& wname(star.concatenate(task->qname.split(i)));
    449449        QueryTask newtask(wname, task->qclass, task->qtype, Section::ANSWER(),
    450450                          QueryTask::AUTH_QUERY);
    451451        result = doQueryTask(ds, zonename, newtask, wild);
     
    541541        // (Note that RRtype DS queries need to go to the parent.)
    542542        const int nlabels = task->qname.getLabelCount() - 1;
    543543        NameMatch match(nlabels != 0 && task->qtype == RRType::DS() ?
    544                         task->qname.split(1, task->qname.getLabelCount() - 1) :
    545                         task->qname);
     544                        task->qname.split(1) : task->qname);
    546545        findClosestEnclosure(match, task->qclass);
    547546        const DataSrc* datasource = match.bestDataSrc();
    548547        const Name* zonename = match.closestName();