},
};
quiche_h3_send_response(conn, quic_conn,
- streamID, headers, 2, false);
+ streamID, headers, 2, len == 0);
+
+ if (len == 0) {
+ return;
+ }
size_t pos = 0;
while (pos < len) {
else {
++frontend.d_errorResponses;
}
- h3_send_response(conn, streamID, statusCode, &response.at(0), response.size());
+ if (response.empty()) {
+ quiche_conn_stream_shutdown(conn.d_conn.get(), streamID, QUICHE_SHUTDOWN_WRITE, static_cast<uint64_t>(DOQ_Error_Codes::DOQ_UNSPECIFIED_ERROR));
+ }
+ else {
+ h3_send_response(conn, streamID, statusCode, &response.at(0), response.size());
+ }
}
static void fillRandom(PacketBuffer& buffer, size_t size)
std::shared_ptr<DOQTCPCrossQuerySender> DOQCrossProtocolQuery::s_sender = std::make_shared<DOQTCPCrossQuerySender>();
-/* from rfc9250 section-4.3 */
-enum class DOQ_Error_Codes : uint64_t
-{
- DOQ_NO_ERROR = 0,
- DOQ_INTERNAL_ERROR = 1,
- DOQ_PROTOCOL_ERROR = 2,
- DOQ_REQUEST_CANCELLED = 3,
- DOQ_EXCESSIVE_LOAD = 4,
- DOQ_UNSPECIFIED_ERROR = 5
-};
-
static void handleResponse(DOQFrontend& frontend, Connection& conn, const uint64_t streamID, const PacketBuffer& response)
{
if (response.empty()) {
#include "iputils.hh"
#include "libssl.hh"
#include "noinitvector.hh"
+#include "doq.hh"
#include "stat_t.hh"
#include "dnsdist-idstate.hh"
#ifdef HAVE_DNS_OVER_QUIC
+/* from rfc9250 section-4.3 */
+enum class DOQ_Error_Codes : uint64_t
+{
+ DOQ_NO_ERROR = 0,
+ DOQ_INTERNAL_ERROR = 1,
+ DOQ_PROTOCOL_ERROR = 2,
+ DOQ_REQUEST_CANCELLED = 3,
+ DOQ_EXCESSIVE_LOAD = 4,
+ DOQ_UNSPECIFIED_ERROR = 5
+};
+
struct DOQFrontend
{
DOQFrontend();