summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2023-04-26 12:20:12 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-04-26 12:20:12 +0200
commit20a185127b955e91815e992bc718b2801f93086a (patch)
treea256286d82b04322e37dce3482485ce3319049a7
parent91b53efa4b6854dc3688f55bfb329b0cafcf5325 (diff)
downloadcurl-bagder/bump-ngtcp2.tar.gz
ngtcp2: use 0.15.0bagder/bump-ngtcp2
Adapt to new API calls
-rw-r--r--.github/workflows/ngtcp2-gnutls.yml4
-rw-r--r--.github/workflows/ngtcp2-quictls.yml4
-rw-r--r--.github/workflows/ngtcp2-wolfssl.yml4
-rw-r--r--docs/HTTP3.md16
-rw-r--r--lib/vquic/curl_ngtcp2.c37
5 files changed, 31 insertions, 34 deletions
diff --git a/.github/workflows/ngtcp2-gnutls.yml b/.github/workflows/ngtcp2-gnutls.yml
index 943dc6642..bb9661181 100644
--- a/.github/workflows/ngtcp2-gnutls.yml
+++ b/.github/workflows/ngtcp2-gnutls.yml
@@ -102,7 +102,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
@@ -110,7 +110,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
diff --git a/.github/workflows/ngtcp2-quictls.yml b/.github/workflows/ngtcp2-quictls.yml
index 0cce56cf8..c371dd603 100644
--- a/.github/workflows/ngtcp2-quictls.yml
+++ b/.github/workflows/ngtcp2-quictls.yml
@@ -77,7 +77,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
@@ -85,7 +85,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
diff --git a/.github/workflows/ngtcp2-wolfssl.yml b/.github/workflows/ngtcp2-wolfssl.yml
index b5aa42128..2ac47560e 100644
--- a/.github/workflows/ngtcp2-wolfssl.yml
+++ b/.github/workflows/ngtcp2-wolfssl.yml
@@ -89,7 +89,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
@@ -97,7 +97,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
diff --git a/docs/HTTP3.md b/docs/HTTP3.md
index 5c58fd974..b66161cc3 100644
--- a/docs/HTTP3.md
+++ b/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
diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c
index 6eee431cc..cbf74f6fd 100644
--- a/lib/vquic/curl_ngtcp2.c
+++ b/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;