32 #define NDN_LOG_DEBUG_DEPTH(x) NDN_LOG_DEBUG(std::string(state->getDepth() + 1, '>') << " " << x)
33 #define NDN_LOG_TRACE_DEPTH(x) NDN_LOG_TRACE(std::string(state->getDepth() + 1, '>') << " " << x)
37 , m_scheduler(face.getIoService())
43 const shared_ptr<ValidationState>& state,
48 dataCallback(data, certRequest, state, continueValidation);
51 nackCallback(nack, certRequest, state, continueValidation);
54 timeoutCallback(certRequest, state, continueValidation);
60 const shared_ptr<CertificateRequest>& certRequest,
61 const shared_ptr<ValidationState>& state,
71 return state->fail({ValidationError::Code::MALFORMED_CERT,
"Fetched a malformed certificate "
72 "`" + data.
getName().toUri() +
"` (" + e.what() +
")"});
74 continueValidation(cert, state);
79 const shared_ptr<CertificateRequest>& certRequest,
80 const shared_ptr<ValidationState>& state,
84 << certRequest->interest.getName());
86 --certRequest->nRetriesLeft;
87 if (certRequest->nRetriesLeft >= 0) {
89 [=] { fetch(certRequest, state, continueValidation); });
90 certRequest->waitAfterNack *= 2;
93 state->fail({ValidationError::Code::CANNOT_RETRIEVE_CERT,
"Cannot fetch certificate after all "
94 "retries `" + certRequest->interest.getName().toUri() +
"`"});
100 const shared_ptr<ValidationState>& state,
103 NDN_LOG_DEBUG_DEPTH(
"Timeout while fetching certificate " << certRequest->interest.getName()
106 --certRequest->nRetriesLeft;
107 if (certRequest->nRetriesLeft >= 0) {
108 fetch(certRequest, state, continueValidation);
111 state->fail({ValidationError::Code::CANNOT_RETRIEVE_CERT,
"Cannot fetch certificate after all "
112 "retries `" + certRequest->interest.getName().toUri() +
"`"});