Since we now detect the end of a XFR and reset the is_XFR flag, we
can't rely on it anymore to skip the insertion of the response into
the ring buffer. Set the type of these responses to AXFR and use that
instead.
A better fix would be to make the IDState available even for XFR
responses, at the cost of doing a copy, and perhaps insert an entry
into the ring buffer for the last message.
static void handleResponseSent(std::shared_ptr<IncomingTCPConnectionState>& state, const TCPResponse& currentResponse)
{
- if (state->d_isXFR) {
+ if (state->d_isXFR || currentResponse.d_idstate.qtype == QType::AXFR || currentResponse.d_idstate.qtype == QType::IXFR) {
return;
}
TCPResponse response;
response.d_buffer = std::move(d_responseBuffer);
response.d_connection = conn;
+ /* could be a IXFR but that does not matter,
+ we only need to know that this is a AXFR or IXFR response */
+ response.d_idstate.qtype = QType::AXFR;
done = isXFRFinished(response, clientConn);
clientConn->handleXFRResponse(clientConn, now, std::move(response));
if (done) {
conn->d_usedForXFR = false;
- d_clientConn->d_isXFR = false;
+ clientConn->d_isXFR = false;
d_state = State::idle;
d_clientConn.reset();
return IOState::Done;