int oldFD = ids->origFD.exchange(-1);
if (oldFD == origFD) {
+ ids->du = nullptr;
/* we only decrement the outstanding counter if the value was not
altered in the meantime, which would mean that the state has been actively reused
and the other thread has not incremented the outstanding counter, so we don't
} else {
du = nullptr;
}
- ids->du = nullptr;
if(dh->tc && g_truncateTC) {
truncateTC(response, &responseLen, responseSize, consumed);
if (du) {
#ifdef HAVE_DNS_OVER_HTTPS
// DoH query
- du->query = std::string(response, responseLen);
+ du->response = std::string(response, responseLen);
if (send(du->rsock, &du, sizeof(du), 0) != sizeof(du)) {
delete du;
}
}
if (result == ProcessQueryResult::SendAnswer) {
- du->query = std::string(reinterpret_cast<char*>(dq.dh), dq.len);
+ du->response = std::string(reinterpret_cast<char*>(dq.dh), dq.len);
send(du->rsock, &du, sizeof(du), 0);
return 0;
}
// struct dnsheader* dh = (struct dnsheader*)du->query.c_str();
// cout<<"Attempt to send out "<<du->query.size()<<" bytes over https, TC="<<dh->tc<<", RCODE="<<dh->rcode<<", qtype="<<du->qtype<<", req="<<(void*)du->req<<endl;
- du->req->res.content_length = du->query.size();
- h2o_send_inline(du->req, du->query.c_str(), du->query.size());
+ du->req->res.content_length = du->response.size();
+ h2o_send_inline(du->req, du->response.c_str(), du->response.size());
}
else {
switch(du->status_code) {