Search in sources :

Example 1 with MaxIterativeStepsReached

use of org.minidns.iterative.IterativeClientException.MaxIterativeStepsReached in project minidns by MiniDNS.

the class ResolutionState method recurse.

void recurse(InetAddress address, DNSMessage query) throws LoopDetected, MaxIterativeStepsReached {
    Question question = query.getQuestion();
    if (!map.containsKey(address)) {
        map.put(address, new HashSet<Question>());
    } else if (map.get(address).contains(question)) {
        throw new IterativeClientException.LoopDetected();
    }
    if (++steps > recursiveDnsClient.maxSteps) {
        throw new IterativeClientException.MaxIterativeStepsReached();
    }
    boolean isNew = map.get(address).add(question);
    assert (isNew);
}
Also used : LoopDetected(org.minidns.iterative.IterativeClientException.LoopDetected) Question(org.minidns.dnsmessage.Question) MaxIterativeStepsReached(org.minidns.iterative.IterativeClientException.MaxIterativeStepsReached)

Aggregations

Question (org.minidns.dnsmessage.Question)1 LoopDetected (org.minidns.iterative.IterativeClientException.LoopDetected)1 MaxIterativeStepsReached (org.minidns.iterative.IterativeClientException.MaxIterativeStepsReached)1