Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
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
pistache
Commits
e623e353
Unverified
Commit
e623e353
authored
Mar 16, 2020
by
Igor [hyperxor]
Committed by
GitHub
Mar 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several minor fixes in router code (#735)
* Code improvements in router * Trigger CI
parent
97ab680b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
examples/rest_server.cc
examples/rest_server.cc
+5
-5
include/pistache/description.h
include/pistache/description.h
+1
-1
src/server/router.cc
src/server/router.cc
+1
-1
No files found.
examples/rest_server.cc
View file @
e623e353
...
...
@@ -33,7 +33,7 @@ void handleReady(const Rest::Request&, Http::ResponseWriter response) {
class
StatsEndpoint
{
public:
StatsEndpoint
(
Address
addr
)
explicit
StatsEndpoint
(
Address
addr
)
:
httpEndpoint
(
std
::
make_shared
<
Http
::
Endpoint
>
(
addr
))
{
}
...
...
@@ -112,7 +112,7 @@ private:
class
Metric
{
public:
Metric
(
std
::
string
name
,
int
initialValue
=
1
)
explicit
Metric
(
std
::
string
name
,
int
initialValue
=
1
)
:
name_
(
std
::
move
(
name
))
,
value_
(
initialValue
)
{
}
...
...
@@ -127,7 +127,7 @@ private:
return
value_
;
}
std
::
string
name
()
const
{
const
std
::
string
&
name
()
const
{
return
name_
;
}
private:
...
...
@@ -135,8 +135,8 @@ private:
int
value_
;
};
typedef
std
::
mutex
Lock
;
typedef
std
::
lock_guard
<
Lock
>
Guard
;
using
Lock
=
std
::
mutex
;
using
Guard
=
std
::
lock_guard
<
Lock
>
;
Lock
metricsLock
;
std
::
vector
<
Metric
>
metrics
;
...
...
include/pistache/description.h
View file @
e623e353
...
...
@@ -427,7 +427,7 @@ public:
std
::
string
rawBasePath
()
const
{
return
basePath_
;
}
std
::
vector
<
Scheme
>
rawSchemes
()
const
{
return
schemes_
;
}
Schema
::
ProduceConsume
rawPC
()
const
{
return
pc
;
}
Schema
::
PathGroup
rawPaths
()
const
{
return
paths_
;
}
const
Schema
::
PathGroup
&
rawPaths
()
const
{
return
paths_
;
}
private:
Schema
::
Info
info_
;
...
...
src/server/router.cc
View file @
e623e353
...
...
@@ -361,7 +361,7 @@ void Router::del(const std::string &resource, Route::Handler handler) {
}
void
Router
::
options
(
const
std
::
string
&
resource
,
Route
::
Handler
handler
)
{
addRoute
(
Http
::
Method
::
Options
,
resource
,
handler
);
addRoute
(
Http
::
Method
::
Options
,
resource
,
std
::
move
(
handler
)
);
}
void
Router
::
removeRoute
(
Http
::
Method
method
,
const
std
::
string
&
resource
)
{
...
...
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