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
a0dd8918
Commit
a0dd8918
authored
Nov 04, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Don't mutate *_key_prev_ in add_header
parent
baa9b1ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+6
-8
No files found.
src/shrpx_downstream.cc
View file @
a0dd8918
...
@@ -350,10 +350,8 @@ void Downstream::crumble_request_cookie(std::vector<nghttp2_nv> &nva) {
...
@@ -350,10 +350,8 @@ void Downstream::crumble_request_cookie(std::vector<nghttp2_nv> &nva) {
}
}
namespace
{
namespace
{
void
add_header
(
bool
&
key_prev
,
size_t
&
sum
,
HeaderRefs
&
headers
,
void
add_header
(
size_t
&
sum
,
HeaderRefs
&
headers
,
const
StringRef
&
name
,
const
StringRef
&
name
,
const
StringRef
&
value
,
bool
no_index
,
const
StringRef
&
value
,
bool
no_index
,
int32_t
token
)
{
int32_t
token
)
{
key_prev
=
true
;
sum
+=
name
.
size
()
+
value
.
size
();
sum
+=
name
.
size
()
+
value
.
size
();
headers
.
emplace_back
(
name
,
value
,
no_index
,
token
);
headers
.
emplace_back
(
name
,
value
,
no_index
,
token
);
}
}
...
@@ -446,14 +444,14 @@ const HeaderRefs::value_type *FieldStore::header(const StringRef &name) const {
...
@@ -446,14 +444,14 @@ const HeaderRefs::value_type *FieldStore::header(const StringRef &name) const {
void
FieldStore
::
add_header_token
(
const
StringRef
&
name
,
const
StringRef
&
value
,
void
FieldStore
::
add_header_token
(
const
StringRef
&
name
,
const
StringRef
&
value
,
bool
no_index
,
int32_t
token
)
{
bool
no_index
,
int32_t
token
)
{
shrpx
::
add_header
(
header_key_prev_
,
buffer_size_
,
headers_
,
name
,
value
,
shrpx
::
add_header
(
buffer_size_
,
headers_
,
name
,
value
,
no_index
,
token
);
no_index
,
token
);
}
}
void
FieldStore
::
alloc_add_header_name
(
const
StringRef
&
name
)
{
void
FieldStore
::
alloc_add_header_name
(
const
StringRef
&
name
)
{
auto
name_ref
=
alloc_header_name
(
balloc_
,
name
);
auto
name_ref
=
alloc_header_name
(
balloc_
,
name
);
auto
token
=
http2
::
lookup_token
(
name_ref
);
auto
token
=
http2
::
lookup_token
(
name_ref
);
add_header_token
(
name_ref
,
StringRef
{},
false
,
token
);
add_header_token
(
name_ref
,
StringRef
{},
false
,
token
);
header_key_prev_
=
true
;
}
}
void
FieldStore
::
append_last_header_key
(
const
char
*
data
,
size_t
len
)
{
void
FieldStore
::
append_last_header_key
(
const
char
*
data
,
size_t
len
)
{
...
@@ -476,14 +474,14 @@ void FieldStore::add_trailer_token(const StringRef &name,
...
@@ -476,14 +474,14 @@ void FieldStore::add_trailer_token(const StringRef &name,
int32_t
token
)
{
int32_t
token
)
{
// Header size limit should be applied to all header and trailer
// Header size limit should be applied to all header and trailer
// fields combined.
// fields combined.
shrpx
::
add_header
(
trailer_key_prev_
,
buffer_size_
,
trailers_
,
name
,
value
,
shrpx
::
add_header
(
buffer_size_
,
trailers_
,
name
,
value
,
no_index
,
token
);
no_index
,
token
);
}
}
void
FieldStore
::
alloc_add_trailer_name
(
const
StringRef
&
name
)
{
void
FieldStore
::
alloc_add_trailer_name
(
const
StringRef
&
name
)
{
auto
name_ref
=
alloc_header_name
(
balloc_
,
name
);
auto
name_ref
=
alloc_header_name
(
balloc_
,
name
);
auto
token
=
http2
::
lookup_token
(
name_ref
);
auto
token
=
http2
::
lookup_token
(
name_ref
);
add_trailer_token
(
name_ref
,
StringRef
{},
false
,
token
);
add_trailer_token
(
name_ref
,
StringRef
{},
false
,
token
);
trailer_key_prev_
=
true
;
}
}
void
FieldStore
::
append_last_trailer_key
(
const
char
*
data
,
size_t
len
)
{
void
FieldStore
::
append_last_trailer_key
(
const
char
*
data
,
size_t
len
)
{
...
...
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