Skip to content

Commit

Permalink
Merge pull request nghttp2#2008 from nghttp2/http3-resp-pri
Browse files Browse the repository at this point in the history
Use nghttp3_pri_parse_priority added since nghttp3 v1.1.0
  • Loading branch information
tatsuhiro-t authored Nov 26, 2023
2 parents 21d6bee + 15a9562 commit 6cf162b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ following libraries are required:
`BoringSSL <https://boringssl.googlesource.com/boringssl/>`_ (commit
6ca49385b168f47a50e7172d82a590b218f55e4d)
* `ngtcp2 <https://github.com/ngtcp2/ngtcp2>`_ >= 1.0.0
* `nghttp3 <https://github.com/ngtcp2/nghttp3>`_ >= 1.0.0
* `nghttp3 <https://github.com/ngtcp2/nghttp3>`_ >= 1.1.0

Use ``--enable-http3`` configure option to enable HTTP/3 feature for
h2load and nghttpx.
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ fi
# nghttp3 (for src)
have_libnghttp3=no
if test "x${request_libnghttp3}" != "xno"; then
PKG_CHECK_MODULES([LIBNGHTTP3], [libnghttp3 >= 1.0.0], [have_libnghttp3=yes],
PKG_CHECK_MODULES([LIBNGHTTP3], [libnghttp3 >= 1.1.0], [have_libnghttp3=yes],
[have_libnghttp3=no])
if test "x${have_libnghttp3}" = "xno"; then
AC_MSG_NOTICE($LIBNGHTTP3_PKG_ERRORS)
Expand Down
25 changes: 8 additions & 17 deletions src/shrpx_http3_upstream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1432,23 +1432,14 @@ int Http3Upstream::on_downstream_header_complete(Downstream *downstream) {
nghttp3_pri pri;

if (nghttp3_conn_get_stream_priority(httpconn_, &pri,
downstream->get_stream_id()) == 0) {
nghttp2_extpri extpri;

extpri.urgency = pri.urgency;
extpri.inc = pri.inc;

if (nghttp2_extpri_parse_priority(&extpri, priority->value.byte(),
priority->value.size()) == 0) {
pri.urgency = extpri.urgency;
pri.inc = extpri.inc;

rv = nghttp3_conn_set_server_stream_priority(
httpconn_, downstream->get_stream_id(), &pri);
if (rv != 0) {
ULOG(ERROR, this) << "nghttp3_conn_set_server_stream_priority: "
<< nghttp3_strerror(rv);
}
downstream->get_stream_id()) == 0 &&
nghttp3_pri_parse_priority(&pri, priority->value.byte(),
priority->value.size()) == 0) {
rv = nghttp3_conn_set_server_stream_priority(
httpconn_, downstream->get_stream_id(), &pri);
if (rv != 0) {
ULOG(ERROR, this) << "nghttp3_conn_set_server_stream_priority: "
<< nghttp3_strerror(rv);
}
}
}
Expand Down

0 comments on commit 6cf162b

Please sign in to comment.