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
aaf01773
Commit
aaf01773
authored
Mar 03, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Use str_size
parent
9afc0175
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
110 deletions
+111
-110
src/http2.cc
src/http2.cc
+5
-5
src/http2_test.cc
src/http2_test.cc
+106
-105
No files found.
src/http2.cc
View file @
aaf01773
...
...
@@ -926,10 +926,10 @@ parse_next_link_header_once(const char *first, const char *last) {
if
(
!
ign
)
{
// rel can take several relations using quoted form.
static
constexpr
char
PLP
[]
=
"rel=
\"
"
;
static
constexpr
size_t
PLPLEN
=
s
izeof
(
PLP
)
-
1
;
static
constexpr
size_t
PLPLEN
=
s
tr_size
(
PLP
)
;
static
constexpr
char
PLT
[]
=
"preload"
;
static
constexpr
size_t
PLTLEN
=
s
izeof
(
PLT
)
-
1
;
static
constexpr
size_t
PLTLEN
=
s
tr_size
(
PLT
)
;
if
(
first
+
PLPLEN
<
last
&&
*
(
first
+
PLPLEN
-
1
)
==
'"'
&&
std
::
equal
(
PLP
,
PLP
+
PLPLEN
,
first
,
util
::
CaseCmp
()))
{
// we have to search preload in whitespace separated list:
...
...
@@ -975,7 +975,7 @@ parse_next_link_header_once(const char *first, const char *last) {
// we are only interested in rel=preload parameter. Others are
// simply skipped.
static
constexpr
char
PL
[]
=
"rel=preload"
;
static
constexpr
size_t
PLLEN
=
s
izeof
(
PL
)
-
1
;
static
constexpr
size_t
PLLEN
=
s
tr_size
(
PL
)
;
if
(
first
+
PLLEN
==
last
)
{
if
(
std
::
equal
(
PL
,
PL
+
PLLEN
,
first
,
util
::
CaseCmp
()))
{
// ok = true;
...
...
@@ -1005,7 +1005,7 @@ parse_next_link_header_once(const char *first, const char *last) {
}
// we have to reject URI if we have nonempty anchor parameter.
static
constexpr
char
ANCHOR
[]
=
"anchor="
;
static
constexpr
size_t
ANCHORLEN
=
s
izeof
(
ANCHOR
)
-
1
;
static
constexpr
size_t
ANCHORLEN
=
s
tr_size
(
ANCHOR
)
;
if
(
!
ign
&&
!
check_link_param_empty
(
first
,
last
,
ANCHOR
,
ANCHORLEN
))
{
ign
=
true
;
}
...
...
@@ -1013,7 +1013,7 @@ parse_next_link_header_once(const char *first, const char *last) {
// reject URI if we have non-empty loadpolicy. This could be
// tightened up to just pick up "next" or "insert".
static
constexpr
char
LOADPOLICY
[]
=
"loadpolicy="
;
static
constexpr
size_t
LOADPOLICYLEN
=
s
izeof
(
LOADPOLICY
)
-
1
;
static
constexpr
size_t
LOADPOLICYLEN
=
s
tr_size
(
LOADPOLICY
)
;
if
(
!
ign
&&
!
check_link_param_empty
(
first
,
last
,
LOADPOLICY
,
LOADPOLICYLEN
))
{
ign
=
true
;
...
...
src/http2_test.cc
View file @
aaf01773
This diff is collapsed.
Click to expand it.
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