]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: doh3 clarify fin usage
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Thu, 23 Nov 2023 13:43:29 +0000 (14:43 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 8 Dec 2023 07:55:08 +0000 (08:55 +0100)
pdns/dnsdistdist/doh3.cc
pdns/dnsdistdist/doq.cc

index 1a61509110716d9759c66bf4d3140a626bf357f5..80d07caca976bad72992e737281d28e7ad5322a3 100644 (file)
@@ -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<uint8_t*>(body) + pos, len - pos, true);
     if (res < 0) {
index 521314f6e5071e4d23a9d8fb6bc0cae6ea849ec5..51b1f32a08882cc326e28235d5fd5f3438e2f8de 100644 (file)
@@ -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<uint64_t>(DOQ_Error_Codes::DOQ_INTERNAL_ERROR));