• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 18837422702

27 Oct 2025 10:15AM UTC coverage: 73.025% (+0.02%) from 73.004%
18837422702

Pull #16375

github

web-flow
Merge 2f23fc90d into 82ea647b4
Pull Request #16375: dnsdist: Include a Date: response header for rejected HTTP1 requests

38279 of 63122 branches covered (60.64%)

Branch coverage included in aggregate %.

0 of 11 new or added lines in 1 file covered. (0.0%)

10680 existing lines in 98 files now uncovered.

127481 of 163870 relevant lines covered (77.79%)

5384548.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.0
/pdns/dnsdistdist/dnsdist-idstate.cc
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22

23
#include "dnsdist-idstate.hh"
24
#include "dnsdist-doh-common.hh"
25
#include "doh3.hh"
26
#include "doq.hh"
27

28
InternalQueryState InternalQueryState::partialCloneForXFR() const
29
{
449✔
30
  /* for XFR responses we cannot move the state from the query
31
     because we usually have more than one response packet per query,
32
     so we need to do a partial clone.
33
  */
34
  InternalQueryState ids;
449✔
35
  ids.qtype = qtype;
449✔
36
  ids.qclass = qclass;
449✔
37
  ids.qname = qname;
449✔
38
  ids.poolName = poolName;
449✔
39
  ids.queryRealTime = queryRealTime;
449✔
40
  ids.protocol = protocol;
449✔
41
  ids.subnet = subnet;
449✔
42
  ids.origRemote = origRemote;
449✔
43
  ids.origDest = origDest;
449✔
44
  ids.hopRemote = hopRemote;
449✔
45
  ids.hopLocal = hopLocal;
449✔
46
  if (qTag) {
449!
47
    ids.qTag = std::make_unique<QTag>(*qTag);
×
48
  }
×
49
  if (d_protoBufData) {
449!
50
    ids.d_protoBufData = std::make_unique<InternalQueryState::ProtoBufData>(*d_protoBufData);
×
51
  }
×
52
  ids.cs = cs;
449✔
53
  /* in case we want to support XFR over DoH, or the stream ID becomes used for QUIC */
54
  ids.d_streamID = d_streamID;
449✔
55
#if !defined(DISABLE_PROTOBUF)
443✔
56
  ids.d_rawProtobufContent = d_rawProtobufContent;
443✔
57
#endif
443✔
58
  return ids;
449✔
59
}
449✔
60

61
void InternalQueryState::sendDelayedProtobufMessages() const
UNCOV
62
{
5,389✔
63
#ifndef DISABLE_PROTOBUF
5,389✔
64
  static thread_local string otPBBuf;
5,389✔
65
  otPBBuf.clear();
5,389✔
66
  if (tracingEnabled) {
5,389✔
67
    pdns::ProtoZero::Message msg{otPBBuf};
8✔
68
    msg.setOpenTelemetryData(d_OTTracer->getOTProtobuf());
8✔
69
  }
8✔
70

71
  for (auto const& msg_logger : delayedResponseMsgs) {
5,389✔
72
    // TODO: we should probably do something with the return value of queueData
73
    if (!tracingEnabled) {
4!
74
      msg_logger.second->queueData(msg_logger.first);
75
      continue;
76
    }
77
    // Protobuf wireformat allows us to simply append the second "message"
78
    // that only contains the OTTrace data as a single bytes field
79
    msg_logger.second->queueData(msg_logger.first + otPBBuf);
4✔
80
  }
4✔
81
#endif
5,389✔
UNCOV
82
}
5,389✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc