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
d4a67a68
Commit
d4a67a68
authored
Jun 07, 2020
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile with latest ngtcp2
parent
7d87221a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
15 deletions
+20
-15
src/h2load.h
src/h2load.h
+2
-2
src/h2load_http3_session.cc
src/h2load_http3_session.cc
+4
-4
src/h2load_http3_session.h
src/h2load_http3_session.h
+2
-2
src/h2load_quic.cc
src/h2load_quic.cc
+12
-7
No files found.
src/h2load.h
View file @
d4a67a68
...
...
@@ -458,8 +458,8 @@ struct Client {
int
quic_recv_crypto_data
(
ngtcp2_crypto_level
crypto_level
,
const
uint8_t
*
data
,
size_t
datalen
);
int
quic_handshake_completed
();
int
quic_recv_stream_data
(
int64_t
stream_id
,
int
fin
,
const
uint8_t
*
data
,
size_t
datalen
);
int
quic_recv_stream_data
(
uint32_t
flags
,
int64_t
stream_id
,
const
uint8_t
*
data
,
size_t
datalen
);
int
quic_acked_stream_data_offset
(
int64_t
stream_id
,
size_t
datalen
);
int
quic_stream_close
(
int64_t
stream_id
,
uint64_t
app_error_code
);
int
quic_stream_reset
(
int64_t
stream_id
,
uint64_t
app_error_code
);
...
...
src/h2load_http3_session.cc
View file @
d4a67a68
...
...
@@ -343,10 +343,10 @@ int Http3Session::init_conn() {
return
0
;
}
ssize_t
Http3Session
::
read_stream
(
int64_t
stream_id
,
const
uint8_t
*
data
,
size_t
datalen
,
int
fi
n
)
{
auto
nconsumed
=
nghttp3_conn_read_stream
(
conn_
,
stream_id
,
data
,
datalen
,
fin
);
ssize_t
Http3Session
::
read_stream
(
uint32_t
flags
,
int64_t
stream_id
,
const
uint8_t
*
data
,
size_t
datale
n
)
{
auto
nconsumed
=
nghttp3_conn_read_stream
(
conn_
,
stream_id
,
data
,
datalen
,
flags
&
NGTCP2_STREAM_DATA_FLAG_FIN
);
if
(
nconsumed
<
0
)
{
std
::
cerr
<<
"nghttp3_conn_read_stream: "
<<
nghttp3_strerror
(
nconsumed
)
<<
std
::
endl
;
...
...
src/h2load_http3_session.h
View file @
d4a67a68
...
...
@@ -58,8 +58,8 @@ public:
int
extend_max_local_streams
();
int64_t
submit_request_internal
();
ssize_t
read_stream
(
int64_t
stream_id
,
const
uint8_t
*
data
,
size_t
datalen
,
int
fi
n
);
ssize_t
read_stream
(
uint32_t
flags
,
int64_t
stream_id
,
const
uint8_t
*
data
,
size_t
datale
n
);
ssize_t
write_stream
(
int64_t
&
stream_id
,
int
&
fin
,
nghttp3_vec
*
vec
,
size_t
veccnt
);
int
block_stream
(
int64_t
stream_id
);
...
...
src/h2load_quic.cc
View file @
d4a67a68
...
...
@@ -71,11 +71,11 @@ int handshake_completed(ngtcp2_conn *conn, void *user_data) {
int
Client
::
quic_handshake_completed
()
{
return
connection_made
();
}
namespace
{
int
recv_stream_data
(
ngtcp2_conn
*
conn
,
int64_t
stream_id
,
int
fin
,
int
recv_stream_data
(
ngtcp2_conn
*
conn
,
uint32_t
flags
,
int64_t
stream_id
,
uint64_t
offset
,
const
uint8_t
*
data
,
size_t
datalen
,
void
*
user_data
,
void
*
stream_user_data
)
{
auto
c
=
static_cast
<
Client
*>
(
user_data
);
if
(
c
->
quic_recv_stream_data
(
stream_id
,
fin
,
data
,
datalen
)
!=
0
)
{
if
(
c
->
quic_recv_stream_data
(
flags
,
stream_id
,
data
,
datalen
)
!=
0
)
{
// TODO Better to do this gracefully rather than
// NGTCP2_ERR_CALLBACK_FAILURE. Perhaps, call
// ngtcp2_conn_write_application_close() ?
...
...
@@ -85,14 +85,14 @@ int recv_stream_data(ngtcp2_conn *conn, int64_t stream_id, int fin,
}
}
// namespace
int
Client
::
quic_recv_stream_data
(
int64_t
stream_id
,
int
fin
,
int
Client
::
quic_recv_stream_data
(
uint32_t
flags
,
int64_t
stream_id
,
const
uint8_t
*
data
,
size_t
datalen
)
{
if
(
worker
->
current_phase
==
Phase
::
MAIN_DURATION
)
{
worker
->
stats
.
bytes_total
+=
datalen
;
}
auto
s
=
static_cast
<
Http3Session
*>
(
session
.
get
());
auto
nconsumed
=
s
->
read_stream
(
stream_id
,
data
,
datalen
,
fi
n
);
auto
nconsumed
=
s
->
read_stream
(
flags
,
stream_id
,
data
,
datale
n
);
if
(
nconsumed
==
-
1
)
{
return
-
1
;
}
...
...
@@ -570,10 +570,15 @@ int Client::write_quic() {
auto
v
=
vec
.
data
();
auto
vcnt
=
static_cast
<
size_t
>
(
sveccnt
);
uint32_t
flags
=
NGTCP2_WRITE_STREAM_FLAG_MORE
;
if
(
fin
)
{
flags
|=
NGTCP2_WRITE_STREAM_FLAG_FIN
;
}
auto
nwrite
=
ngtcp2_conn_writev_stream
(
quic
.
conn
,
&
ps
.
path
,
buf
.
data
(),
quic
.
max_pktlen
,
&
ndatalen
,
NGTCP2_WRITE_STREAM_FLAG_MORE
,
stream_id
,
fin
,
reinterpret_cast
<
const
ngtcp2_vec
*>
(
v
),
vcnt
,
timestamp
(
worker
->
loop
));
quic
.
conn
,
&
ps
.
path
,
buf
.
data
(),
quic
.
max_pktlen
,
&
ndatalen
,
flags
,
stream_id
,
reinterpret_cast
<
const
ngtcp2_vec
*>
(
v
),
vcnt
,
timestamp
(
worker
->
loop
));
if
(
nwrite
<
0
)
{
switch
(
nwrite
)
{
case
NGTCP2_ERR_STREAM_DATA_BLOCKED
:
...
...
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