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
b21779e6
Commit
b21779e6
authored
Mar 15, 2017
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Use raw pointer for apis
parent
12a4e7c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
src/shrpx_api_downstream_connection.cc
src/shrpx_api_downstream_connection.cc
+18
-13
No files found.
src/shrpx_api_downstream_connection.cc
View file @
b21779e6
...
...
@@ -35,17 +35,22 @@ namespace shrpx {
namespace
{
// List of API endpoints
const
APIEndpoint
apis
[]
=
{
APIEndpoint
{
StringRef
::
from_lit
(
"/api/v1beta1/backendconfig"
),
true
,
(
1
<<
API_METHOD_POST
)
|
(
1
<<
API_METHOD_PUT
),
&
APIDownstreamConnection
::
handle_backendconfig
,
},
APIEndpoint
{
StringRef
::
from_lit
(
"/api/v1beta1/configrevision"
),
true
,
(
1
<<
API_METHOD_GET
),
&
APIDownstreamConnection
::
handle_configrevision
,
},
};
const
std
::
array
<
APIEndpoint
,
2
>
&
apis
()
{
static
const
auto
apis
=
new
std
::
array
<
APIEndpoint
,
2
>
{{
APIEndpoint
{
StringRef
::
from_lit
(
"/api/v1beta1/backendconfig"
),
true
,
(
1
<<
API_METHOD_POST
)
|
(
1
<<
API_METHOD_PUT
),
&
APIDownstreamConnection
::
handle_backendconfig
,
},
APIEndpoint
{
StringRef
::
from_lit
(
"/api/v1beta1/configrevision"
),
true
,
(
1
<<
API_METHOD_GET
),
&
APIDownstreamConnection
::
handle_configrevision
,
},
}};
return
*
apis
;
}
}
// namespace
namespace
{
...
...
@@ -160,7 +165,7 @@ const APIEndpoint *lookup_api(const StringRef &path) {
switch
(
path
[
25
])
{
case
'g'
:
if
(
util
::
streq_l
(
"/api/v1beta1/backendconfi"
,
std
::
begin
(
path
),
25
))
{
return
&
apis
[
0
];
return
&
apis
()
[
0
];
}
break
;
}
...
...
@@ -169,7 +174,7 @@ const APIEndpoint *lookup_api(const StringRef &path) {
switch
(
path
[
26
])
{
case
'n'
:
if
(
util
::
streq_l
(
"/api/v1beta1/configrevisio"
,
std
::
begin
(
path
),
26
))
{
return
&
apis
[
1
];
return
&
apis
()
[
1
];
}
break
;
}
...
...
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