From c56ef6719e29c41bb78f37f89d35cf65abaaf1d0 Mon Sep 17 00:00:00 2001 From: Charles-Henri Bruyand Date: Thu, 23 Nov 2023 14:43:29 +0100 Subject: [PATCH] dnsdist: doh3 clarify fin usage --- pdns/dnsdistdist/doh3.cc | 1 + pdns/dnsdistdist/doq.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/pdns/dnsdistdist/doh3.cc b/pdns/dnsdistdist/doh3.cc index 1a61509110..80d07caca9 100644 --- a/pdns/dnsdistdist/doh3.cc +++ b/pdns/dnsdistdist/doh3.cc @@ -306,6 +306,7 @@ static void h3_send_response(quiche_conn* quic_conn, quiche_h3_conn* conn, const size_t pos = 0; while (pos < len) { + // send_body takes care of setting fin to false if it cannot send the entire content so we can try again. auto res = quiche_h3_send_body(conn, quic_conn, streamID, const_cast(body) + pos, len - pos, true); if (res < 0) { diff --git a/pdns/dnsdistdist/doq.cc b/pdns/dnsdistdist/doq.cc index 521314f6e5..51b1f32a08 100644 --- a/pdns/dnsdistdist/doq.cc +++ b/pdns/dnsdistdist/doq.cc @@ -293,6 +293,7 @@ static void handleResponse(DOQFrontend& frontend, Connection& conn, const uint64 pos = 0; while (pos < response.size()) { + // stream_send sets fin to false itself when the capacity of the stream is less than the desired writing length auto res = quiche_conn_stream_send(conn.d_conn.get(), streamID, &response.at(pos), response.size() - pos, true); if (res < 0) { quiche_conn_stream_shutdown(conn.d_conn.get(), streamID, QUICHE_SHUTDOWN_WRITE, static_cast(DOQ_Error_Codes::DOQ_INTERNAL_ERROR)); -- 2.47.2