]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
contrib: upgrade embedded library ngtcp2 to v0.13.1
authorDaniel Salzman <daniel.salzman@nic.cz>
Thu, 9 Feb 2023 13:36:45 +0000 (14:36 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Thu, 9 Feb 2023 13:36:45 +0000 (14:36 +0100)
src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_conn.c
src/contrib/libngtcp2/ngtcp2/version.h

index 1e3c6ecbaaa8a6c222e725e2e2a031b484de400c..fb00ca852d06cfbf40b5d1f9b3fbdbc63bb746ce 100644 (file)
@@ -7122,14 +7122,15 @@ static int conn_recv_stream(ngtcp2_conn *conn, const ngtcp2_stream *fr) {
       return rv;
     }
 
+    if (!bidi) {
+      ngtcp2_strm_shutdown(strm, NGTCP2_STRM_FLAG_SHUT_WR);
+      strm->flags |= NGTCP2_STRM_FLAG_FIN_ACKED;
+    }
+
     rv = conn_call_stream_open(conn, strm);
     if (rv != 0) {
       return rv;
     }
-
-    if (!bidi) {
-      ngtcp2_strm_shutdown(strm, NGTCP2_STRM_FLAG_SHUT_WR);
-    }
   }
 
   fr_end_offset = fr->offset + datalen;
@@ -12000,7 +12001,15 @@ ngtcp2_ssize ngtcp2_conn_write_vmsg(ngtcp2_conn *conn, ngtcp2_path *path,
 
   if (res == 0) {
     if (conn_handshake_remnants_left(conn)) {
-      if (conn_handshake_probe_left(conn)) {
+      if (conn_handshake_probe_left(conn) ||
+          /* Allow exceeding CWND if an Handshake packet needs to be
+             sent in order to avoid dead lock.  In some situation,
+             typically for client, 1 RTT packets may occupy in-flight
+             bytes (e.g., some large requests and PMTUD), and
+             Handshake packet loss shrinks CWND, and we may get in the
+             situation that we are unable to send Handshake packet. */
+          (conn->hs_pktns->rtb.num_pto_eliciting == 0 &&
+           ngtcp2_ksl_len(&conn->hs_pktns->crypto.tx.frq))) {
         destlen = origlen;
       }
       nwrite = conn_write_handshake_pkts(conn, pi, dest, destlen,
@@ -12012,6 +12021,11 @@ ngtcp2_ssize ngtcp2_conn_write_vmsg(ngtcp2_conn *conn, ngtcp2_path *path,
         res = nwrite;
         dest += nwrite;
         destlen -= (size_t)nwrite;
+      } else if (destlen == 0) {
+        res = conn_write_handshake_ack_pkts(conn, pi, dest, origlen, ts);
+        if (res) {
+          return res;
+        }
       }
     }
   }
index 825f1324fd91b70a52f955f304055d90d60cc718..54b2035edecdadaef9ab96feeaf54ddb164e67cf 100644 (file)
@@ -36,7 +36,7 @@
  *
  * Version number of the ngtcp2 library release.
  */
-#define NGTCP2_VERSION "0.13.0"
+#define NGTCP2_VERSION "0.13.1"
 
 /**
  * @macro
@@ -46,6 +46,6 @@
  * number, 8 bits for minor and 8 bits for patch. Version 1.2.3
  * becomes 0x010203.
  */
-#define NGTCP2_VERSION_NUM 0x000d00
+#define NGTCP2_VERSION_NUM 0x000d01
 
 #endif /* VERSION_H */