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
ad8be7d4
Commit
ad8be7d4
authored
Mar 25, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: parse_link_header takes StringRef
parent
07926cff
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
130 deletions
+123
-130
src/http2.cc
src/http2.cc
+3
-5
src/http2.h
src/http2.h
+5
-5
src/http2_test.cc
src/http2_test.cc
+114
-117
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+1
-3
No files found.
src/http2.cc
View file @
ad8be7d4
...
...
@@ -1171,12 +1171,10 @@ almost_done:
}
}
// namespace
std
::
vector
<
LinkHeader
>
parse_link_header
(
const
char
*
src
,
size_t
len
)
{
auto
first
=
src
;
auto
last
=
src
+
len
;
std
::
vector
<
LinkHeader
>
parse_link_header
(
const
StringRef
&
src
)
{
std
::
vector
<
LinkHeader
>
res
;
for
(
;
first
!=
last
;)
{
auto
rv
=
parse_next_link_header_once
(
first
,
last
);
for
(
auto
first
=
std
::
begin
(
src
);
first
!=
std
::
end
(
src
)
;)
{
auto
rv
=
parse_next_link_header_once
(
first
,
std
::
end
(
src
)
);
first
=
rv
.
second
;
auto
&
link
=
rv
.
first
;
if
(
!
link
.
uri
.
empty
())
{
...
...
src/http2.h
View file @
ad8be7d4
...
...
@@ -322,11 +322,11 @@ struct LinkHeader {
StringRef
uri
;
};
// Returns next URI-reference in Link header field value |src|
of
//
length |len|. If no URI-reference found after searching all input,
//
returned uri field is empty. This imply that empty URI-reference
//
is ignored during
parsing.
std
::
vector
<
LinkHeader
>
parse_link_header
(
const
char
*
src
,
size_t
len
);
// Returns next URI-reference in Link header field value |src|
. If no
//
URI-reference found after searching all input, returned uri field
//
is empty. This imply that empty URI-reference is ignored during
// parsing.
std
::
vector
<
LinkHeader
>
parse_link_header
(
const
StringRef
&
src
);
// Constructs path by combining base path |base_path| with another
// path |rel_path|. The base path and another path can have optional
...
...
src/http2_test.cc
View file @
ad8be7d4
This diff is collapsed.
Click to expand it.
src/shrpx_http2_upstream.cc
View file @
ad8be7d4
...
...
@@ -1782,9 +1782,7 @@ int Http2Upstream::prepare_push_promise(Downstream *downstream) {
if
(
kv
.
token
!=
http2
::
HD_LINK
)
{
continue
;
}
for
(
auto
&
link
:
http2
::
parse_link_header
(
kv
.
value
.
c_str
(),
kv
.
value
.
size
()))
{
for
(
auto
&
link
:
http2
::
parse_link_header
(
kv
.
value
))
{
StringRef
scheme
,
authority
,
path
;
rv
=
http2
::
construct_push_component
(
balloc
,
scheme
,
authority
,
path
,
...
...
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