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
d7581525
Commit
d7581525
authored
Apr 27, 2017
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Update TLSv1.3 TLS record overhead
parent
385068eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
src/shrpx_connection.cc
src/shrpx_connection.cc
+16
-5
No files found.
src/shrpx_connection.cc
View file @
d7581525
...
...
@@ -801,11 +801,22 @@ int Connection::get_tcp_hint(TCPHint *hint) const {
:
0
;
// http://www.slideshare.net/kazuho/programming-tcp-for-responsiveness
// TODO 29 (5 (header) + 8 (explicit nonce) + 16 (tag)) is TLS
// overhead for AES-GCM. For CHACHA20_POLY1305, it is 21 since it
// does not need 8 bytes explicit nonce.
//
// TODO 29 (5 + 8 + 16) is TLS overhead for AES-GCM. For
// CHACHA20_POLY1305, it is 21 since it does not need 8 bytes
// explicit nonce.
auto
writable_size
=
(
avail_packets
+
2
)
*
(
tcp_info
.
tcpi_snd_mss
-
29
);
// For TLSv1.3, AES-GCM and CHACHA20_POLY1305 overhead are now 22
// bytes (5 (header) + 1 (ContentType) + 16 (tag)).
size_t
tls_overhead
;
if
(
SSL_version
(
tls
.
ssl
)
==
TLS1_3_VERSION
)
{
tls_overhead
=
22
;
}
else
{
tls_overhead
=
29
;
}
auto
writable_size
=
(
avail_packets
+
2
)
*
(
tcp_info
.
tcpi_snd_mss
-
tls_overhead
);
if
(
writable_size
>
16
_k
)
{
writable_size
=
writable_size
&
~
(
16
_k
-
1
);
}
else
{
...
...
@@ -813,7 +824,7 @@ int Connection::get_tcp_hint(TCPHint *hint) const {
LOG
(
INFO
)
<<
"writable_size is too small: "
<<
writable_size
;
}
// TODO is this required?
writable_size
=
std
::
max
(
writable_size
,
static_cast
<
uint32
_t
>
(
536
*
2
));
writable_size
=
std
::
max
(
writable_size
,
static_cast
<
size
_t
>
(
536
*
2
));
}
// if (LOG_ENABLED(INFO)) {
...
...
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