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
61579ad2
Commit
61579ad2
authored
Feb 20, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Use StringRef for shrpx::add_header
parent
9678daa4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+6
-5
No files found.
src/shrpx_downstream.cc
View file @
61579ad2
...
@@ -329,11 +329,12 @@ void Downstream::crumble_request_cookie(std::vector<nghttp2_nv> &nva) {
...
@@ -329,11 +329,12 @@ void Downstream::crumble_request_cookie(std::vector<nghttp2_nv> &nva) {
}
}
namespace
{
namespace
{
void
add_header
(
bool
&
key_prev
,
size_t
&
sum
,
Headers
&
headers
,
std
::
string
name
,
void
add_header
(
bool
&
key_prev
,
size_t
&
sum
,
Headers
&
headers
,
std
::
string
value
,
bool
no_index
,
int16_t
token
)
{
const
StringRef
&
name
,
const
StringRef
&
value
,
bool
no_index
,
int16_t
token
)
{
key_prev
=
true
;
key_prev
=
true
;
sum
+=
name
.
size
()
+
value
.
size
();
sum
+=
name
.
size
()
+
value
.
size
();
headers
.
emplace_back
(
std
::
move
(
name
),
std
::
move
(
value
),
no_index
,
token
);
headers
.
emplace_back
(
name
.
str
(),
value
.
str
(
),
no_index
,
token
);
}
}
}
// namespace
}
// namespace
...
@@ -417,7 +418,7 @@ void FieldStore::add_header_lower(const StringRef &name, const StringRef &value,
...
@@ -417,7 +418,7 @@ void FieldStore::add_header_lower(const StringRef &name, const StringRef &value,
util
::
inp_strlower
(
low_name
);
util
::
inp_strlower
(
low_name
);
auto
token
=
http2
::
lookup_token
(
low_name
);
auto
token
=
http2
::
lookup_token
(
low_name
);
shrpx
::
add_header
(
header_key_prev_
,
buffer_size_
,
headers_
,
shrpx
::
add_header
(
header_key_prev_
,
buffer_size_
,
headers_
,
std
::
move
(
low_name
),
value
.
str
()
,
no_index
,
token
);
StringRef
{
low_name
},
value
,
no_index
,
token
);
}
}
void
FieldStore
::
add_header_token
(
const
StringRef
&
name
,
const
StringRef
&
value
,
void
FieldStore
::
add_header_token
(
const
StringRef
&
name
,
const
StringRef
&
value
,
...
@@ -443,7 +444,7 @@ void FieldStore::add_trailer_lower(const StringRef &name,
...
@@ -443,7 +444,7 @@ void FieldStore::add_trailer_lower(const StringRef &name,
util
::
inp_strlower
(
low_name
);
util
::
inp_strlower
(
low_name
);
auto
token
=
http2
::
lookup_token
(
low_name
);
auto
token
=
http2
::
lookup_token
(
low_name
);
shrpx
::
add_header
(
trailer_key_prev_
,
buffer_size_
,
trailers_
,
shrpx
::
add_header
(
trailer_key_prev_
,
buffer_size_
,
trailers_
,
std
::
move
(
low_name
),
value
.
str
()
,
no_index
,
token
);
StringRef
{
low_name
},
value
,
no_index
,
token
);
}
}
void
FieldStore
::
add_trailer_token
(
const
StringRef
&
name
,
void
FieldStore
::
add_trailer_token
(
const
StringRef
&
name
,
...
...
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