Skip to content

Commit 24a7cbe

Browse files
tatsuhiro-tbagder
authored andcommitted
ngtcp2: fix build with ngtcp2 and nghttp3
ngtcp2_conn_client_new and nghttp3_conn_client_new are now macros. Check the wrapped functions instead. ngtcp2_stream_close callback now takes flags parameter. Closes curl#7709
1 parent dbe693e commit 24a7cbe

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

configure.ac

+2-2
Original file line numberDiff line numberDiff line change
@@ -2677,7 +2677,7 @@ if test X"$want_tcp2" != Xno; then
26772677
if test "x$cross_compiling" != "xyes"; then
26782678
DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
26792679
fi
2680-
AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new,
2680+
AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
26812681
[
26822682
AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
26832683
NGTCP2_ENABLED=1
@@ -2876,7 +2876,7 @@ if test X"$want_nghttp3" != Xno; then
28762876
if test "x$cross_compiling" != "xyes"; then
28772877
DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
28782878
fi
2879-
AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new,
2879+
AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
28802880
[
28812881
AC_CHECK_HEADERS(nghttp3/nghttp3.h,
28822882
curl_h3_msg="enabled (ngtcp2 + nghttp3)"

lib/vquic/ngtcp2.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,8 @@ cb_acked_stream_data_offset(ngtcp2_conn *tconn, int64_t stream_id,
559559
return 0;
560560
}
561561

562-
static int cb_stream_close(ngtcp2_conn *tconn, int64_t stream_id,
563-
uint64_t app_error_code,
562+
static int cb_stream_close(ngtcp2_conn *tconn, uint32_t flags,
563+
int64_t stream_id, uint64_t app_error_code,
564564
void *user_data, void *stream_user_data)
565565
{
566566
struct quicsocket *qs = (struct quicsocket *)user_data;
@@ -569,6 +569,10 @@ static int cb_stream_close(ngtcp2_conn *tconn, int64_t stream_id,
569569
(void)stream_user_data;
570570
/* stream is closed... */
571571

572+
if(!(flags & NGTCP2_STREAM_CLOSE_FLAG_APP_ERROR_CODE_SET)) {
573+
app_error_code = NGHTTP3_H3_NO_ERROR;
574+
}
575+
572576
rv = nghttp3_conn_close_stream(qs->h3conn, stream_id,
573577
app_error_code);
574578
if(rv) {

0 commit comments

Comments
 (0)