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
c4368a94
Commit
c4368a94
authored
Oct 02, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Use StringRef for AltSvc fields
parent
fdc1eb52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
src/shrpx_config.cc
src/shrpx_config.cc
+4
-4
src/shrpx_config.h
src/shrpx_config.h
+1
-1
src/shrpx_https_upstream.cc
src/shrpx_https_upstream.cc
+2
-3
No files found.
src/shrpx_config.cc
View file @
c4368a94
...
...
@@ -2376,16 +2376,16 @@ int parse_config(Config *config, int optid, const StringRef &opt,
AltSvc
altsvc
{};
altsvc
.
protocol_id
=
tokens
[
0
].
str
(
);
altsvc
.
protocol_id
=
make_string_ref
(
config
->
balloc
,
tokens
[
0
]
);
altsvc
.
port
=
port
;
altsvc
.
service
=
tokens
[
1
].
str
(
);
altsvc
.
service
=
make_string_ref
(
config
->
balloc
,
tokens
[
1
]
);
if
(
tokens
.
size
()
>
2
)
{
altsvc
.
host
=
tokens
[
2
].
str
(
);
altsvc
.
host
=
make_string_ref
(
config
->
balloc
,
tokens
[
2
]
);
if
(
tokens
.
size
()
>
3
)
{
altsvc
.
origin
=
tokens
[
3
].
str
(
);
altsvc
.
origin
=
make_string_ref
(
config
->
balloc
,
tokens
[
3
]
);
}
}
...
...
src/shrpx_config.h
View file @
c4368a94
...
...
@@ -337,7 +337,7 @@ enum shrpx_forwarded_node_type {
};
struct
AltSvc
{
std
::
string
protocol_id
,
host
,
origin
,
service
;
StringRef
protocol_id
,
host
,
origin
,
service
;
uint16_t
port
;
};
...
...
src/shrpx_https_upstream.cc
View file @
c4368a94
...
...
@@ -962,10 +962,9 @@ std::unique_ptr<Downstream> HttpsUpstream::pop_downstream() {
namespace
{
void
write_altsvc
(
DefaultMemchunks
*
buf
,
BlockAllocator
&
balloc
,
const
AltSvc
&
altsvc
)
{
buf
->
append
(
util
::
percent_encode_token
(
balloc
,
StringRef
{
altsvc
.
protocol_id
}));
buf
->
append
(
util
::
percent_encode_token
(
balloc
,
altsvc
.
protocol_id
));
buf
->
append
(
"=
\"
"
);
buf
->
append
(
util
::
quote_string
(
balloc
,
StringRef
{
altsvc
.
host
}
));
buf
->
append
(
util
::
quote_string
(
balloc
,
altsvc
.
host
));
buf
->
append
(
':'
);
buf
->
append
(
altsvc
.
service
);
buf
->
append
(
'"'
);
...
...
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