Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
25d3323c
Commit
25d3323c
authored
Feb 20, 2021
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support both h3 and h3-29 ALPN and their corresponding QUIC versions
parent
e7f35e87
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
README.rst
README.rst
+3
-3
src/h2load.cc
src/h2load.cc
+4
-2
src/h2load_quic.cc
src/h2load_quic.cc
+12
-3
No files found.
README.rst
View file @
25d3323c
...
@@ -24,12 +24,12 @@ ngtcp2, nghttp3 and my patched OpenSSL.
...
@@ -24,12 +24,12 @@ ngtcp2, nghttp3 and my patched OpenSSL.
https://github.com/ngtcp2/ngtcp2#build-from-git describes how to build
https://github.com/ngtcp2/ngtcp2#build-from-git describes how to build
these three software.
these three software.
To run h2load against HTTP/3 server, specify h3-29 ALPN with
To run h2load against HTTP/3 server, specify h3
or h3
-29 ALPN with
``--npn-list`` option like so:
``--npn-list`` option like so:
.. code-block:: text
.. code-block:: text
$ h2load --npn-list h3
-29
https://127.0.0.1:4433
$ h2load --npn-list h3 https://127.0.0.1:4433
You can use Dockerfile to skip the tedious build steps to manually
You can use Dockerfile to skip the tedious build steps to manually
pull and build dependencies. In order to build Docker image, do this:
pull and build dependencies. In order to build Docker image, do this:
...
@@ -43,7 +43,7 @@ Run h2load:
...
@@ -43,7 +43,7 @@ Run h2load:
.. code-block:: text
.. code-block:: text
$ docker run --rm -it --network=host nghttp2-quic /usr/local/bin/h2load --npn-list h3
-29
https://127.0.0.1:4433
$ docker run --rm -it --network=host nghttp2-quic /usr/local/bin/h2load --npn-list h3 https://127.0.0.1:4433
Development Status
Development Status
------------------
------------------
...
...
src/h2load.cc
View file @
25d3323c
...
@@ -138,7 +138,8 @@ bool Config::is_timing_based_mode() const { return (this->duration > 0); }
...
@@ -138,7 +138,8 @@ bool Config::is_timing_based_mode() const { return (this->duration > 0); }
bool
Config
::
has_base_uri
()
const
{
return
(
!
this
->
base_uri
.
empty
());
}
bool
Config
::
has_base_uri
()
const
{
return
(
!
this
->
base_uri
.
empty
());
}
bool
Config
::
rps_enabled
()
const
{
return
this
->
rps
>
0.0
;
}
bool
Config
::
rps_enabled
()
const
{
return
this
->
rps
>
0.0
;
}
bool
Config
::
is_quic
()
const
{
bool
Config
::
is_quic
()
const
{
return
!
npn_list
.
empty
()
&&
npn_list
[
0
]
==
NGHTTP3_ALPN_H3
;
return
!
npn_list
.
empty
()
&&
(
npn_list
[
0
]
==
NGHTTP3_ALPN_H3
||
npn_list
[
0
]
==
"\x5h3-29"
);
}
}
Config
config
;
Config
config
;
...
@@ -1042,7 +1043,8 @@ int Client::connection_made() {
...
@@ -1042,7 +1043,8 @@ int Client::connection_made() {
auto
proto
=
StringRef
{
next_proto
,
next_proto_len
};
auto
proto
=
StringRef
{
next_proto
,
next_proto_len
};
if
(
config
.
is_quic
())
{
if
(
config
.
is_quic
())
{
assert
(
session
);
assert
(
session
);
if
(
!
util
::
streq
(
StringRef
{
&
NGHTTP3_ALPN_H3
[
1
]},
proto
))
{
if
(
!
util
::
streq
(
StringRef
{
&
NGHTTP3_ALPN_H3
[
1
]},
proto
)
&&
!
util
::
streq_l
(
"h3-29"
,
proto
))
{
return
-
1
;
return
-
1
;
}
}
}
else
if
(
util
::
check_h2_is_selected
(
proto
))
{
}
else
if
(
util
::
check_h2_is_selected
(
proto
))
{
...
...
src/h2load_quic.cc
View file @
25d3323c
...
@@ -370,9 +370,18 @@ int Client::quic_init(const sockaddr *local_addr, socklen_t local_addrlen,
...
@@ -370,9 +370,18 @@ int Client::quic_init(const sockaddr *local_addr, socklen_t local_addrlen,
{
remote_addrlen
,
const_cast
<
sockaddr
*>
(
remote_addr
)},
{
remote_addrlen
,
const_cast
<
sockaddr
*>
(
remote_addr
)},
};
};
rv
=
ngtcp2_conn_client_new
(
&
quic
.
conn
,
&
dcid
,
&
scid
,
&
path
,
assert
(
config
->
npn_list
.
size
());
NGTCP2_PROTO_VER_MIN
,
&
callbacks
,
&
settings
,
&
params
,
nullptr
,
this
);
uint32_t
quic_version
;
if
(
config
->
npn_list
[
0
]
==
NGHTTP3_ALPN_H3
)
{
quic_version
=
NGTCP2_PROTO_VER_V1
;
}
else
{
quic_version
=
NGTCP2_PROTO_VER_MIN
;
}
rv
=
ngtcp2_conn_client_new
(
&
quic
.
conn
,
&
dcid
,
&
scid
,
&
path
,
quic_version
,
&
callbacks
,
&
settings
,
&
params
,
nullptr
,
this
);
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
return
-
1
;
return
-
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment