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
5b788f52
Commit
5b788f52
authored
Jul 14, 2019
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h3-22
parent
d64488d9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
28 deletions
+30
-28
README.rst
README.rst
+6
-6
src/h2load.h
src/h2load.h
+2
-2
src/h2load_http3_session.cc
src/h2load_http3_session.cc
+13
-11
src/h2load_http3_session.h
src/h2load_http3_session.h
+3
-3
src/h2load_quic.cc
src/h2load_quic.cc
+4
-4
src/quic.h
src/quic.h
+2
-2
No files found.
README.rst
View file @
5b788f52
...
@@ -16,20 +16,20 @@ An experimental high level C++ library is also available.
...
@@ -16,20 +16,20 @@ An experimental high level C++ library is also available.
We have Python bindings of this library, but we do not have full
We have Python bindings of this library, but we do not have full
code coverage yet.
code coverage yet.
h2load IETF QUIC
Running h2load against HTTP/3 endpoint
----------------
----------------
----------------------
In order to build h2load with
IETF QUIC, you have to build ngtcp2,
In order to build h2load with
HTTP/3 support, you have to build
nghttp3 and my patched OpenSSL.
ng
tcp2, ng
http3 and my patched OpenSSL.
https://github.com/ngtcp2/ngtcp2/tree/draft-20#build-from-git
https://github.com/ngtcp2/ngtcp2/tree/draft-20#build-from-git
describes how to build these three software.
describes how to build these three software.
To run h2load against
IETF QUIC server, specify h3-20
ALPN with
To run h2load against
HTTP/3 server, specify h3-22
ALPN with
``--npn-list`` option like so:
``--npn-list`` option like so:
.. code-block:: text
.. code-block:: text
$ h2load --npn-list h3-2
0
https://localhost:4433
$ h2load --npn-list h3-2
2
https://localhost:4433
Development Status
Development Status
------------------
------------------
...
...
src/h2load.h
View file @
5b788f52
...
@@ -482,8 +482,8 @@ struct Client {
...
@@ -482,8 +482,8 @@ struct Client {
size_t
keylen
,
const
uint8_t
*
sample
,
size_t
samplelen
);
size_t
keylen
,
const
uint8_t
*
sample
,
size_t
samplelen
);
int
quic_recv_stream_data
(
int64_t
stream_id
,
int
fin
,
const
uint8_t
*
data
,
int
quic_recv_stream_data
(
int64_t
stream_id
,
int
fin
,
const
uint8_t
*
data
,
size_t
datalen
);
size_t
datalen
);
int
quic_stream_close
(
int64_t
stream_id
,
uint
16
_t
app_error_code
);
int
quic_stream_close
(
int64_t
stream_id
,
uint
64
_t
app_error_code
);
int
quic_stream_reset
(
int64_t
stream_id
,
uint
16
_t
app_error_code
);
int
quic_stream_reset
(
int64_t
stream_id
,
uint
64
_t
app_error_code
);
int
quic_extend_max_local_streams
();
int
quic_extend_max_local_streams
();
int
quic_tls_handshake
(
bool
initial
=
false
);
int
quic_tls_handshake
(
bool
initial
=
false
);
...
...
src/h2load_http3_session.cc
View file @
5b788f52
...
@@ -76,7 +76,7 @@ int64_t Http3Session::submit_request_internal() {
...
@@ -76,7 +76,7 @@ int64_t Http3Session::submit_request_internal() {
return
rv
;
return
rv
;
}
}
rv
=
nghttp3_conn_submit_request
(
conn_
,
stream_id
,
nullptr
,
rv
=
nghttp3_conn_submit_request
(
conn_
,
stream_id
,
reinterpret_cast
<
nghttp3_nv
*>
(
nva
.
data
()),
reinterpret_cast
<
nghttp3_nv
*>
(
nva
.
data
()),
nva
.
size
(),
nullptr
,
nullptr
);
nva
.
size
(),
nullptr
,
nullptr
);
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
...
@@ -105,18 +105,18 @@ size_t Http3Session::max_concurrent_streams() {
...
@@ -105,18 +105,18 @@ size_t Http3Session::max_concurrent_streams() {
}
}
namespace
{
namespace
{
int
stream_close
(
nghttp3_conn
*
conn
,
int64_t
stream_id
,
uint
16_t
error_code
,
int
stream_close
(
nghttp3_conn
*
conn
,
int64_t
stream_id
,
uint
64_t
app_
error_code
,
void
*
user_data
,
void
*
stream_user_data
)
{
void
*
user_data
,
void
*
stream_user_data
)
{
auto
s
=
static_cast
<
Http3Session
*>
(
user_data
);
auto
s
=
static_cast
<
Http3Session
*>
(
user_data
);
if
(
s
->
stream_close
(
stream_id
,
error_code
)
!=
0
)
{
if
(
s
->
stream_close
(
stream_id
,
app_
error_code
)
!=
0
)
{
return
NGHTTP3_ERR_CALLBACK_FAILURE
;
return
NGHTTP3_ERR_CALLBACK_FAILURE
;
}
}
return
0
;
return
0
;
}
}
}
// namespace
}
// namespace
int
Http3Session
::
stream_close
(
int64_t
stream_id
,
uint
16_t
error_code
)
{
int
Http3Session
::
stream_close
(
int64_t
stream_id
,
uint
64_t
app_
error_code
)
{
client_
->
on_stream_close
(
stream_id
,
error_code
==
NGHTTP3_HTTP_NO_ERROR
);
client_
->
on_stream_close
(
stream_id
,
app_
error_code
==
NGHTTP3_HTTP_NO_ERROR
);
return
0
;
return
0
;
}
}
...
@@ -186,19 +186,21 @@ void Http3Session::recv_header(int64_t stream_id, const nghttp3_vec *name,
...
@@ -186,19 +186,21 @@ void Http3Session::recv_header(int64_t stream_id, const nghttp3_vec *name,
}
}
namespace
{
namespace
{
int
send_stop_sending
(
nghttp3_conn
*
conn
,
int64_t
stream_id
,
void
*
user_data
,
int
send_stop_sending
(
nghttp3_conn
*
conn
,
int64_t
stream_id
,
uint64_t
app_error_code
,
void
*
user_data
,
void
*
stream_user_data
)
{
void
*
stream_user_data
)
{
auto
s
=
static_cast
<
Http3Session
*>
(
user_data
);
auto
s
=
static_cast
<
Http3Session
*>
(
user_data
);
if
(
s
->
send_stop_sending
(
stream_id
)
!=
0
)
{
if
(
s
->
send_stop_sending
(
stream_id
,
app_error_code
)
!=
0
)
{
return
NGHTTP3_ERR_CALLBACK_FAILURE
;
return
NGHTTP3_ERR_CALLBACK_FAILURE
;
}
}
return
0
;
return
0
;
}
}
}
// namespace
}
// namespace
int
Http3Session
::
send_stop_sending
(
int64_t
stream_id
)
{
int
Http3Session
::
send_stop_sending
(
int64_t
stream_id
,
uint64_t
app_error_code
)
{
auto
rv
=
ngtcp2_conn_shutdown_stream_read
(
client_
->
quic
.
conn
,
stream_id
,
auto
rv
=
ngtcp2_conn_shutdown_stream_read
(
client_
->
quic
.
conn
,
stream_id
,
NGHTTP3_HTTP_PUSH_REFUSED
);
app_error_code
);
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
std
::
cerr
<<
"ngtcp2_conn_shutdown_stream_read: "
<<
ngtcp2_strerror
(
rv
)
std
::
cerr
<<
"ngtcp2_conn_shutdown_stream_read: "
<<
ngtcp2_strerror
(
rv
)
<<
std
::
endl
;
<<
std
::
endl
;
...
@@ -207,8 +209,8 @@ int Http3Session::send_stop_sending(int64_t stream_id) {
...
@@ -207,8 +209,8 @@ int Http3Session::send_stop_sending(int64_t stream_id) {
return
0
;
return
0
;
}
}
int
Http3Session
::
close_stream
(
int64_t
stream_id
,
uint
16_t
error_code
)
{
int
Http3Session
::
close_stream
(
int64_t
stream_id
,
uint
64_t
app_
error_code
)
{
auto
rv
=
nghttp3_conn_close_stream
(
conn_
,
stream_id
,
error_code
);
auto
rv
=
nghttp3_conn_close_stream
(
conn_
,
stream_id
,
app_
error_code
);
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
return
-
1
;
return
-
1
;
}
}
...
...
src/h2load_http3_session.h
View file @
5b788f52
...
@@ -45,15 +45,15 @@ public:
...
@@ -45,15 +45,15 @@ public:
virtual
size_t
max_concurrent_streams
();
virtual
size_t
max_concurrent_streams
();
int
init_conn
();
int
init_conn
();
int
stream_close
(
int64_t
stream_id
,
uint
16_t
error_code
);
int
stream_close
(
int64_t
stream_id
,
uint
64_t
app_
error_code
);
void
recv_data
(
int64_t
stream_id
,
const
uint8_t
*
data
,
size_t
datalen
);
void
recv_data
(
int64_t
stream_id
,
const
uint8_t
*
data
,
size_t
datalen
);
void
consume
(
int64_t
stream_id
,
size_t
nconsumed
);
void
consume
(
int64_t
stream_id
,
size_t
nconsumed
);
void
begin_headers
(
int64_t
stream_id
);
void
begin_headers
(
int64_t
stream_id
);
void
recv_header
(
int64_t
stream_id
,
const
nghttp3_vec
*
name
,
void
recv_header
(
int64_t
stream_id
,
const
nghttp3_vec
*
name
,
const
nghttp3_vec
*
value
);
const
nghttp3_vec
*
value
);
int
send_stop_sending
(
int64_t
stream_id
);
int
send_stop_sending
(
int64_t
stream_id
,
uint64_t
app_error_code
);
int
close_stream
(
int64_t
stream_id
,
uint
16_t
error_code
);
int
close_stream
(
int64_t
stream_id
,
uint
64_t
app_
error_code
);
int
reset_stream
(
int64_t
stream_id
);
int
reset_stream
(
int64_t
stream_id
);
int
extend_max_local_streams
();
int
extend_max_local_streams
();
int64_t
submit_request_internal
();
int64_t
submit_request_internal
();
...
...
src/h2load_quic.cc
View file @
5b788f52
...
@@ -305,7 +305,7 @@ int Client::quic_recv_stream_data(int64_t stream_id, int fin,
...
@@ -305,7 +305,7 @@ int Client::quic_recv_stream_data(int64_t stream_id, int fin,
}
}
namespace
{
namespace
{
int
stream_close
(
ngtcp2_conn
*
conn
,
int64_t
stream_id
,
uint
16
_t
app_error_code
,
int
stream_close
(
ngtcp2_conn
*
conn
,
int64_t
stream_id
,
uint
64
_t
app_error_code
,
void
*
user_data
,
void
*
stream_user_data
)
{
void
*
user_data
,
void
*
stream_user_data
)
{
auto
c
=
static_cast
<
Client
*>
(
user_data
);
auto
c
=
static_cast
<
Client
*>
(
user_data
);
if
(
c
->
quic_stream_close
(
stream_id
,
app_error_code
)
!=
0
)
{
if
(
c
->
quic_stream_close
(
stream_id
,
app_error_code
)
!=
0
)
{
...
@@ -315,7 +315,7 @@ int stream_close(ngtcp2_conn *conn, int64_t stream_id, uint16_t app_error_code,
...
@@ -315,7 +315,7 @@ int stream_close(ngtcp2_conn *conn, int64_t stream_id, uint16_t app_error_code,
}
}
}
// namespace
}
// namespace
int
Client
::
quic_stream_close
(
int64_t
stream_id
,
uint
16
_t
app_error_code
)
{
int
Client
::
quic_stream_close
(
int64_t
stream_id
,
uint
64
_t
app_error_code
)
{
auto
s
=
static_cast
<
Http3Session
*>
(
session
.
get
());
auto
s
=
static_cast
<
Http3Session
*>
(
session
.
get
());
if
(
s
->
close_stream
(
stream_id
,
app_error_code
)
!=
0
)
{
if
(
s
->
close_stream
(
stream_id
,
app_error_code
)
!=
0
)
{
return
-
1
;
return
-
1
;
...
@@ -325,7 +325,7 @@ int Client::quic_stream_close(int64_t stream_id, uint16_t app_error_code) {
...
@@ -325,7 +325,7 @@ int Client::quic_stream_close(int64_t stream_id, uint16_t app_error_code) {
namespace
{
namespace
{
int
stream_reset
(
ngtcp2_conn
*
conn
,
int64_t
stream_id
,
uint64_t
final_size
,
int
stream_reset
(
ngtcp2_conn
*
conn
,
int64_t
stream_id
,
uint64_t
final_size
,
uint
16
_t
app_error_code
,
void
*
user_data
,
uint
64
_t
app_error_code
,
void
*
user_data
,
void
*
stream_user_data
)
{
void
*
stream_user_data
)
{
auto
c
=
static_cast
<
Client
*>
(
user_data
);
auto
c
=
static_cast
<
Client
*>
(
user_data
);
if
(
c
->
quic_stream_reset
(
stream_id
,
app_error_code
)
!=
0
)
{
if
(
c
->
quic_stream_reset
(
stream_id
,
app_error_code
)
!=
0
)
{
...
@@ -335,7 +335,7 @@ int stream_reset(ngtcp2_conn *conn, int64_t stream_id, uint64_t final_size,
...
@@ -335,7 +335,7 @@ int stream_reset(ngtcp2_conn *conn, int64_t stream_id, uint64_t final_size,
}
}
}
// namespace
}
// namespace
int
Client
::
quic_stream_reset
(
int64_t
stream_id
,
uint
16
_t
app_error_code
)
{
int
Client
::
quic_stream_reset
(
int64_t
stream_id
,
uint
64
_t
app_error_code
)
{
auto
s
=
static_cast
<
Http3Session
*>
(
session
.
get
());
auto
s
=
static_cast
<
Http3Session
*>
(
session
.
get
());
if
(
s
->
reset_stream
(
stream_id
)
!=
0
)
{
if
(
s
->
reset_stream
(
stream_id
)
!=
0
)
{
return
-
1
;
return
-
1
;
...
...
src/quic.h
View file @
5b788f52
...
@@ -88,11 +88,11 @@ enum class ErrorType {
...
@@ -88,11 +88,11 @@ enum class ErrorType {
};
};
struct
Error
{
struct
Error
{
Error
(
ErrorType
type
,
uint
16
_t
code
)
:
type
(
type
),
code
(
code
)
{}
Error
(
ErrorType
type
,
uint
64
_t
code
)
:
type
(
type
),
code
(
code
)
{}
Error
()
:
type
(
ErrorType
::
Transport
),
code
(
0
)
{}
Error
()
:
type
(
ErrorType
::
Transport
),
code
(
0
)
{}
ErrorType
type
;
ErrorType
type
;
uint
16
_t
code
;
uint
64
_t
code
;
};
};
Error
err_transport
(
int
liberr
);
Error
err_transport
(
int
liberr
);
...
...
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