Browse Source

ngtcp2: use 0.15.0

- nghttp3 0.11.0
- nghttp2 1.53.0

Adapt to new API calls

Closes #11031
Daniel Stenberg 1 year ago
parent
commit
10998e3b89

+ 3 - 3
.github/workflows/ngtcp2-gnutls.yml

@@ -101,7 +101,7 @@ jobs:
       name: 'install gnutls'
 
     - run: |
-        git clone --quiet --depth=1 -b v0.10.0 https://github.com/ngtcp2/nghttp3
+        git clone --quiet --depth=1 -b v0.11.0 https://github.com/ngtcp2/nghttp3
         cd nghttp3
         autoreconf -fi
         ./configure --prefix=$HOME/all PKG_CONFIG_PATH="$HOME/all/lib/pkgconfig" --enable-lib-only
@@ -109,7 +109,7 @@ jobs:
       name: 'install nghttp3'
 
     - run: |
-        git clone --quiet --depth=1 -b v0.13.1 https://github.com/ngtcp2/ngtcp2
+        git clone --quiet --depth=1 -b v0.15.0 https://github.com/ngtcp2/ngtcp2
         cd ngtcp2
         autoreconf -fi
         ./configure ${{ matrix.build.ngtcp2-configure }} --with-openssl --with-gnutls
@@ -117,7 +117,7 @@ jobs:
       name: 'install ngtcp2'
 
     - run: |
-        git clone --quiet --depth=1 -b v1.52.0 https://github.com/nghttp2/nghttp2
+        git clone --quiet --depth=1 -b v1.53.0 https://github.com/nghttp2/nghttp2
         cd nghttp2
         autoreconf -fi
         ./configure --prefix=$HOME/all PKG_CONFIG_PATH="$HOME/all/lib/pkgconfig" --enable-http3

+ 3 - 3
.github/workflows/ngtcp2-quictls.yml

@@ -78,7 +78,7 @@ jobs:
       name: 'install quictls'
 
     - run: |
-        git clone --quiet --depth=1 -b v0.10.0 https://github.com/ngtcp2/nghttp3
+        git clone --quiet --depth=1 -b v0.11.0 https://github.com/ngtcp2/nghttp3
         cd nghttp3
         autoreconf -fi
         ./configure --prefix=$HOME/all PKG_CONFIG_PATH="$HOME/all/lib/pkgconfig" --enable-lib-only
@@ -86,7 +86,7 @@ jobs:
       name: 'install nghttp3'
 
     - run: |
-        git clone --quiet --depth=1 -b v0.13.1 https://github.com/ngtcp2/ngtcp2
+        git clone --quiet --depth=1 -b v0.15.0 https://github.com/ngtcp2/ngtcp2
         cd ngtcp2
         autoreconf -fi
         ./configure ${{ matrix.build.ngtcp2-configure }} --with-openssl
@@ -94,7 +94,7 @@ jobs:
       name: 'install ngtcp2'
 
     - run: |
-        git clone --quiet --depth=1 -b v1.52.0 https://github.com/nghttp2/nghttp2
+        git clone --quiet --depth=1 -b v1.53.0 https://github.com/nghttp2/nghttp2
         cd nghttp2
         autoreconf -fi
         ./configure --prefix=$HOME/all PKG_CONFIG_PATH="$HOME/all/lib/pkgconfig" --enable-http3

+ 3 - 3
.github/workflows/ngtcp2-wolfssl.yml

@@ -88,7 +88,7 @@ jobs:
       name: 'install quictls'
 
     - run: |
-        git clone --quiet --depth=1 -b v0.10.0 https://github.com/ngtcp2/nghttp3
+        git clone --quiet --depth=1 -b v0.11.0 https://github.com/ngtcp2/nghttp3
         cd nghttp3
         autoreconf -fi
         ./configure --prefix=$HOME/all PKG_CONFIG_PATH="$HOME/all/lib/pkgconfig" --enable-lib-only
@@ -96,7 +96,7 @@ jobs:
       name: 'install nghttp3'
 
     - run: |
-        git clone --quiet --depth=1 -b v0.13.1 https://github.com/ngtcp2/ngtcp2
+        git clone --quiet --depth=1 -b v0.15.0 https://github.com/ngtcp2/ngtcp2
         cd ngtcp2
         autoreconf -fi
         ./configure ${{ matrix.build.ngtcp2-configure }} --with-openssl  --with-wolfssl
@@ -104,7 +104,7 @@ jobs:
       name: 'install ngtcp2'
 
     - run: |
-        git clone --quiet --depth=1 -b v1.52.0 https://github.com/nghttp2/nghttp2
+        git clone --quiet --depth=1 -b v1.53.0 https://github.com/nghttp2/nghttp2
         cd nghttp2
         autoreconf -fi
         ./configure --prefix=$HOME/all PKG_CONFIG_PATH="$HOME/all/lib/pkgconfig" --enable-http3

+ 8 - 8
docs/HTTP3.md

@@ -39,8 +39,8 @@ Building curl with ngtcp2 involves 3 components: `ngtcp2` itself, `nghttp3` and
 
 For now, `ngtcp2` and `nghttp3` are still *experimental* which means their evolution bring breaking changes. Therefore, the proper version of both libraries need to be used when building curl. These are
 
- * `ngtcp2`: v0.13.1
- * `nghttp3`: v0.10.0
+ * `ngtcp2`: v0.15.0
+ * `nghttp3`: v0.11.0
 
 ## Build with OpenSSL
 
@@ -55,7 +55,7 @@ Build (patched) OpenSSL
 Build nghttp3
 
      % cd ..
-     % git clone -b v0.10.0 https://github.com/ngtcp2/nghttp3
+     % git clone -b v0.11.0 https://github.com/ngtcp2/nghttp3
      % cd nghttp3
      % autoreconf -fi
      % ./configure --prefix=<somewhere2> --enable-lib-only
@@ -65,7 +65,7 @@ Build nghttp3
 Build ngtcp2
 
      % cd ..
-     % git clone -b v0.13.1 https://github.com/ngtcp2/ngtcp2
+     % git clone -b v0.15.0 https://github.com/ngtcp2/ngtcp2
      % cd ngtcp2
      % autoreconf -fi
      % ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only
@@ -98,7 +98,7 @@ Build GnuTLS
 Build nghttp3
 
      % cd ..
-     % git clone -b v0.10.0 https://github.com/ngtcp2/nghttp3
+     % git clone -b v0.11.0 https://github.com/ngtcp2/nghttp3
      % cd nghttp3
      % autoreconf -fi
      % ./configure --prefix=<somewhere2> --enable-lib-only
@@ -108,7 +108,7 @@ Build nghttp3
 Build ngtcp2
 
      % cd ..
-     % git clone -b v0.13.1 https://github.com/ngtcp2/ngtcp2
+     % git clone -b v0.15.0 https://github.com/ngtcp2/ngtcp2
      % cd ngtcp2
      % autoreconf -fi
      % ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only --with-gnutls
@@ -139,7 +139,7 @@ Build wolfSSL
 Build nghttp3
 
      % cd ..
-     % git clone -b v0.10.0 https://github.com/ngtcp2/nghttp3
+     % git clone -b v0.11.0 https://github.com/ngtcp2/nghttp3
      % cd nghttp3
      % autoreconf -fi
      % ./configure --prefix=<somewhere2> --enable-lib-only
@@ -149,7 +149,7 @@ Build nghttp3
 Build ngtcp2
 
      % cd ..
-     % git clone -b v0.13.1 https://github.com/ngtcp2/ngtcp2
+     % git clone -b v0.15.0 https://github.com/ngtcp2/ngtcp2
      % cd ngtcp2
      % autoreconf -fi
      % ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only --with-wolfssl

+ 17 - 20
lib/vquic/curl_ngtcp2.c

@@ -140,7 +140,7 @@ struct cf_ngtcp2_ctx {
   uint32_t version;
   ngtcp2_settings settings;
   ngtcp2_transport_params transport_params;
-  ngtcp2_connection_close_error last_error;
+  ngtcp2_ccerr last_error;
   ngtcp2_crypto_conn_ref conn_ref;
 #ifdef USE_OPENSSL
   SSL_CTX *sslctx;
@@ -729,9 +729,9 @@ static int cb_recv_stream_data(ngtcp2_conn *tconn, uint32_t flags,
   DEBUGF(LOG_CF(data, cf, "[h3sid=%" PRId64 "] read_stream(len=%zu) -> %zd",
                 stream_id, buflen, nconsumed));
   if(nconsumed < 0) {
-    ngtcp2_connection_close_error_set_application_error(
-        &ctx->last_error,
-        nghttp3_err_infer_quic_app_error_code((int)nconsumed), NULL, 0);
+    ngtcp2_ccerr_set_application_error(
+      &ctx->last_error,
+      nghttp3_err_infer_quic_app_error_code((int)nconsumed), NULL, 0);
     return NGTCP2_ERR_CALLBACK_FAILURE;
   }
 
@@ -788,8 +788,8 @@ static int cb_stream_close(ngtcp2_conn *tconn, uint32_t flags,
   DEBUGF(LOG_CF(data, cf, "[h3sid=%" PRId64 "] quic close(err=%"
                 PRIu64 ") -> %d", stream3_id, app_error_code, rv));
   if(rv) {
-    ngtcp2_connection_close_error_set_application_error(
-        &ctx->last_error, nghttp3_err_infer_quic_app_error_code(rv), NULL, 0);
+    ngtcp2_ccerr_set_application_error(
+      &ctx->last_error, nghttp3_err_infer_quic_app_error_code(rv), NULL, 0);
     return NGTCP2_ERR_CALLBACK_FAILURE;
   }
 
@@ -1257,7 +1257,7 @@ static int init_ngh3_conn(struct Curl_cfilter *cf)
   int rc;
   int64_t ctrl_stream_id, qpack_enc_stream_id, qpack_dec_stream_id;
 
-  if(ngtcp2_conn_get_max_local_streams_uni(ctx->qconn) < 3) {
+  if(ngtcp2_conn_get_streams_uni_left(ctx->qconn) < 3) {
     return CURLE_QUIC_CONNECT_ERROR;
   }
 
@@ -1781,13 +1781,12 @@ static CURLcode recv_pkt(const unsigned char *pkt, size_t pktlen,
                   ngtcp2_strerror(rv)));
     if(!ctx->last_error.error_code) {
       if(rv == NGTCP2_ERR_CRYPTO) {
-        ngtcp2_connection_close_error_set_transport_error_tls_alert(
-            &ctx->last_error,
-            ngtcp2_conn_get_tls_alert(ctx->qconn), NULL, 0);
+        ngtcp2_ccerr_set_tls_alert(&ctx->last_error,
+                                   ngtcp2_conn_get_tls_alert(ctx->qconn),
+                                   NULL, 0);
       }
       else {
-        ngtcp2_connection_close_error_set_transport_error_liberr(
-            &ctx->last_error, rv, NULL, 0);
+        ngtcp2_ccerr_set_liberr(&ctx->last_error, rv, NULL, 0);
       }
     }
 
@@ -1874,9 +1873,9 @@ static ssize_t read_pkt_to_send(void *userp,
       if(veccnt < 0) {
         failf(x->data, "nghttp3_conn_writev_stream returned error: %s",
               nghttp3_strerror((int)veccnt));
-        ngtcp2_connection_close_error_set_application_error(
-            &ctx->last_error,
-            nghttp3_err_infer_quic_app_error_code((int)veccnt), NULL, 0);
+        ngtcp2_ccerr_set_application_error(
+          &ctx->last_error,
+          nghttp3_err_infer_quic_app_error_code((int)veccnt), NULL, 0);
         *err = CURLE_SEND_ERROR;
         return -1;
       }
@@ -1916,8 +1915,7 @@ static ssize_t read_pkt_to_send(void *userp,
         DEBUGASSERT(ndatalen == -1);
         failf(x->data, "ngtcp2_conn_writev_stream returned error: %s",
               ngtcp2_strerror((int)n));
-        ngtcp2_connection_close_error_set_transport_error_liberr(
-            &ctx->last_error, (int)n, NULL, 0);
+        ngtcp2_ccerr_set_liberr(&ctx->last_error, (int)n, NULL, 0);
         *err = CURLE_SEND_ERROR;
         nwritten = -1;
         goto out;
@@ -1964,8 +1962,7 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf,
   if(rv) {
     failf(data, "ngtcp2_conn_handle_expiry returned error: %s",
           ngtcp2_strerror(rv));
-    ngtcp2_connection_close_error_set_transport_error_liberr(&ctx->last_error,
-                                                             rv, NULL, 0);
+    ngtcp2_ccerr_set_liberr(&ctx->last_error, rv, NULL, 0);
     return CURLE_SEND_ERROR;
   }
 
@@ -2317,7 +2314,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf,
   ngtcp2_conn_set_tls_native_handle(ctx->qconn, ctx->ssl);
 #endif
 
-  ngtcp2_connection_close_error_default(&ctx->last_error);
+  ngtcp2_ccerr_default(&ctx->last_error);
 
   ctx->conn_ref.get_conn = get_conn;
   ctx->conn_ref.user_data = cf;