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
be1283e3
Commit
be1283e3
authored
Jul 27, 2018
by
Kip Warner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a lot of compiler warnings.
parent
957198b8
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
174 additions
and
92 deletions
+174
-92
CMakeLists.txt
CMakeLists.txt
+46
-0
include/pistache/async.h
include/pistache/async.h
+33
-33
include/pistache/common.h
include/pistache/common.h
+3
-0
include/pistache/cookie.h
include/pistache/cookie.h
+2
-2
include/pistache/description.h
include/pistache/description.h
+2
-2
include/pistache/flags.h
include/pistache/flags.h
+1
-1
include/pistache/http.h
include/pistache/http.h
+21
-18
include/pistache/iterator_adapter.h
include/pistache/iterator_adapter.h
+2
-2
include/pistache/mailbox.h
include/pistache/mailbox.h
+2
-2
include/pistache/optional.h
include/pistache/optional.h
+1
-1
include/pistache/os.h
include/pistache/os.h
+2
-2
include/pistache/reactor.h
include/pistache/reactor.h
+1
-1
include/pistache/router.h
include/pistache/router.h
+1
-1
include/pistache/stream.h
include/pistache/stream.h
+10
-10
include/pistache/transport.h
include/pistache/transport.h
+17
-17
include/pistache/version.h.in
include/pistache/version.h.in
+16
-0
libpistache.pc.in
libpistache.pc.in
+14
-0
No files found.
CMakeLists.txt
View file @
be1283e3
...
@@ -37,3 +37,49 @@ if (PISTACHE_BUILD_TESTS)
...
@@ -37,3 +37,49 @@ if (PISTACHE_BUILD_TESTS)
enable_testing
()
enable_testing
()
add_subdirectory
(
tests
)
add_subdirectory
(
tests
)
endif
()
endif
()
# Set version...
# Major and minor version...
set
(
VERSION_MAJOR 0
)
set
(
VERSION_MINOR 0
)
# Make available in a header file...
configure_file
(
"include/pistache/version.h.in"
"include/pistache/version.h"
@ONLY
)
# Install header...
install
(
FILES
${
CMAKE_BINARY_DIR
}
/include/pistache/version.h
DESTINATION
include/pistache/
)
# Configure the pkg-config metadata...
# Initialize the metadata variables to support remote builds...
set
(
prefix
${
CMAKE_INSTALL_PREFIX
}
)
set
(
exec_prefix
${
CMAKE_INSTALL_PREFIX
}
/bin
)
set
(
libdir
${
CMAKE_INSTALL_PREFIX
}
/lib
)
set
(
includedir
${
CMAKE_INSTALL_PREFIX
}
/include
)
set
(
version
${
VERSION_MAJOR
}
.
${
VERSION_MINOR
}
)
# Perform substitutions...
configure_file
(
"libpistache.pc.in"
"libpistache.pc"
@ONLY
)
# Install pkg-config metadata into standard location within the prefix...
install
(
FILES
${
CMAKE_BINARY_DIR
}
/libpistache.pc
DESTINATION
lib/pkgconfig/
)
include/pistache/async.h
View file @
be1283e3
...
@@ -136,8 +136,8 @@ namespace Async {
...
@@ -136,8 +136,8 @@ namespace Async {
namespace
Private
{
namespace
Private
{
struct
InternalRethrow
{
struct
InternalRethrow
{
InternalRethrow
(
std
::
exception_ptr
exc
)
InternalRethrow
(
std
::
exception_ptr
_
exc
)
:
exc
(
std
::
move
(
exc
))
:
exc
(
std
::
move
(
_
exc
))
{
}
{
}
std
::
exception_ptr
exc
;
std
::
exception_ptr
exc
;
...
@@ -166,9 +166,9 @@ namespace Async {
...
@@ -166,9 +166,9 @@ namespace Async {
};
};
struct
Core
{
struct
Core
{
Core
(
State
state
,
TypeId
id
)
Core
(
State
_state
,
TypeId
_
id
)
:
state
(
state
)
:
state
(
_
state
)
,
id
(
id
)
,
id
(
_
id
)
{
}
{
}
State
state
;
State
state
;
...
@@ -839,9 +839,9 @@ namespace Async {
...
@@ -839,9 +839,9 @@ namespace Async {
Deferred
(
Deferred
&&
other
)
=
default
;
Deferred
(
Deferred
&&
other
)
=
default
;
Deferred
&
operator
=
(
Deferred
&&
other
)
=
default
;
Deferred
&
operator
=
(
Deferred
&&
other
)
=
default
;
Deferred
(
Resolver
resolver
,
Rejection
reject
)
Deferred
(
Resolver
_resolver
,
Rejection
_
reject
)
:
resolver
(
std
::
move
(
resolver
))
:
resolver
(
std
::
move
(
_
resolver
))
,
rejection
(
std
::
move
(
reject
))
,
rejection
(
std
::
move
(
_
reject
))
{
}
{
}
template
<
typename
U
>
template
<
typename
U
>
...
@@ -888,9 +888,9 @@ namespace Async {
...
@@ -888,9 +888,9 @@ namespace Async {
Deferred
(
Deferred
&&
other
)
=
default
;
Deferred
(
Deferred
&&
other
)
=
default
;
Deferred
&
operator
=
(
Deferred
&&
other
)
=
default
;
Deferred
&
operator
=
(
Deferred
&&
other
)
=
default
;
Deferred
(
Resolver
resolver
,
Rejection
reject
)
Deferred
(
Resolver
_resolver
,
Rejection
_
reject
)
:
resolver
(
std
::
move
(
resolver
))
:
resolver
(
std
::
move
(
_
resolver
))
,
rejection
(
std
::
move
(
reject
))
,
rejection
(
std
::
move
(
_
reject
))
{
}
{
}
void
resolve
()
{
void
resolve
()
{
...
@@ -898,8 +898,8 @@ namespace Async {
...
@@ -898,8 +898,8 @@ namespace Async {
}
}
template
<
typename
Exc
>
template
<
typename
Exc
>
void
reject
(
Exc
exc
)
{
void
reject
(
Exc
_
exc
)
{
rejection
(
std
::
move
(
exc
));
rejection
(
std
::
move
(
_
exc
));
}
}
private:
private:
...
@@ -1138,12 +1138,12 @@ namespace Async {
...
@@ -1138,12 +1138,12 @@ namespace Async {
struct
All
{
struct
All
{
struct
Data
{
struct
Data
{
Data
(
const
size_t
total
,
Resolver
resolver
,
Rejection
rejection
)
Data
(
const
size_t
_total
,
Resolver
_resolver
,
Rejection
_
rejection
)
:
total
(
total
)
:
total
(
_
total
)
,
resolved
(
0
)
,
resolved
(
0
)
,
rejected
(
false
)
,
rejected
(
false
)
,
resolve
(
std
::
move
(
resolver
))
,
resolve
(
std
::
move
(
_
resolver
))
,
reject
(
std
::
move
(
rejection
))
,
reject
(
std
::
move
(
_
rejection
))
{
}
{
}
const
size_t
total
;
const
size_t
total
;
...
@@ -1245,8 +1245,8 @@ namespace Async {
...
@@ -1245,8 +1245,8 @@ namespace Async {
private:
private:
template
<
typename
T
,
size_t
Index
,
typename
Data
>
template
<
typename
T
,
size_t
Index
,
typename
Data
>
struct
WhenContinuation
{
struct
WhenContinuation
{
WhenContinuation
(
Data
data
)
WhenContinuation
(
Data
_
data
)
:
data
(
std
::
move
(
data
))
:
data
(
std
::
move
(
_
data
))
{
}
{
}
void
operator
()(
const
T
&
val
)
const
{
void
operator
()(
const
T
&
val
)
const
{
...
@@ -1258,8 +1258,8 @@ namespace Async {
...
@@ -1258,8 +1258,8 @@ namespace Async {
template
<
size_t
Index
,
typename
Data
>
template
<
size_t
Index
,
typename
Data
>
struct
WhenContinuation
<
void
,
Index
,
Data
>
{
struct
WhenContinuation
<
void
,
Index
,
Data
>
{
WhenContinuation
(
Data
data
)
WhenContinuation
(
Data
_
data
)
:
data
(
std
::
move
(
data
))
:
data
(
std
::
move
(
_
data
))
{
}
{
}
void
operator
()()
const
{
void
operator
()()
const
{
...
@@ -1341,9 +1341,9 @@ namespace Async {
...
@@ -1341,9 +1341,9 @@ namespace Async {
>
>
struct
WhenAllRange
{
struct
WhenAllRange
{
WhenAllRange
(
Resolver
resolve
,
Rejection
reject
)
WhenAllRange
(
Resolver
_resolve
,
Rejection
_
reject
)
:
resolve
(
std
::
move
(
resolve
))
:
resolve
(
std
::
move
(
_
resolve
))
,
reject
(
std
::
move
(
reject
))
,
reject
(
std
::
move
(
_
reject
))
{
}
{
}
template
<
typename
Iterator
>
template
<
typename
Iterator
>
...
@@ -1373,12 +1373,12 @@ namespace Async {
...
@@ -1373,12 +1373,12 @@ namespace Async {
private:
private:
struct
Data
{
struct
Data
{
Data
(
size_t
total
,
Resolver
resolver
,
Rejection
rejection
)
Data
(
size_t
_total
,
Resolver
_resolver
,
Rejection
_
rejection
)
:
total
(
total
)
:
total
(
_
total
)
,
resolved
(
0
)
,
resolved
(
0
)
,
rejected
(
false
)
,
rejected
(
false
)
,
resolve
(
std
::
move
(
resolver
))
,
resolve
(
std
::
move
(
_
resolver
))
,
reject
(
std
::
move
(
rejection
))
,
reject
(
std
::
move
(
_
rejection
))
{
}
{
}
const
size_t
total
;
const
size_t
total
;
...
@@ -1419,9 +1419,9 @@ namespace Async {
...
@@ -1419,9 +1419,9 @@ namespace Async {
typedef
std
::
shared_ptr
<
DataT
<
ValueType
>>
D
;
typedef
std
::
shared_ptr
<
DataT
<
ValueType
>>
D
;
WhenContinuation
(
const
D
&
data
,
size_t
index
)
WhenContinuation
(
const
D
&
_data
,
size_t
_
index
)
:
data
(
data
)
:
data
(
_
data
)
,
index
(
index
)
,
index
(
_
index
)
{
}
{
}
void
operator
()(
const
ValueType
&
val
)
const
{
void
operator
()(
const
ValueType
&
val
)
const
{
...
@@ -1444,8 +1444,8 @@ namespace Async {
...
@@ -1444,8 +1444,8 @@ namespace Async {
typedef
std
::
shared_ptr
<
DataT
<
void
>>
D
;
typedef
std
::
shared_ptr
<
DataT
<
void
>>
D
;
WhenContinuation
(
const
D
&
data
,
size_t
)
WhenContinuation
(
const
D
&
_
data
,
size_t
)
:
data
(
data
)
:
data
(
_
data
)
{
}
{
}
void
operator
()()
const
{
void
operator
()()
const
{
...
...
include/pistache/common.h
View file @
be1283e3
...
@@ -49,6 +49,9 @@
...
@@ -49,6 +49,9 @@
#define unreachable() __builtin_unreachable()
#define unreachable() __builtin_unreachable()
// Until we require C++17 compiler with [[maybe_unused]]
#define UNUSED(x) (void)(x);
namespace
Pistache
{
namespace
Pistache
{
namespace
Const
{
namespace
Const
{
...
...
include/pistache/cookie.h
View file @
be1283e3
...
@@ -44,8 +44,8 @@ public:
...
@@ -44,8 +44,8 @@ public:
typedef
std
::
unordered_map
<
std
::
string
,
Cookie
>
Storage
;
typedef
std
::
unordered_map
<
std
::
string
,
Cookie
>
Storage
;
struct
iterator
:
std
::
iterator
<
std
::
bidirectional_iterator_tag
,
Cookie
>
{
struct
iterator
:
std
::
iterator
<
std
::
bidirectional_iterator_tag
,
Cookie
>
{
iterator
(
const
Storage
::
const_iterator
&
iterator
)
iterator
(
const
Storage
::
const_iterator
&
_
iterator
)
:
it_
(
iterator
)
:
it_
(
_
iterator
)
{
}
{
}
Cookie
operator
*
()
const
{
Cookie
operator
*
()
const
{
...
...
include/pistache/description.h
View file @
be1283e3
...
@@ -379,8 +379,8 @@ public:
...
@@ -379,8 +379,8 @@ public:
Description
&
basePath
(
std
::
string
value
);
Description
&
basePath
(
std
::
string
value
);
template
<
typename
...
Schemes
>
template
<
typename
...
Schemes
>
Description
&
schemes
(
Schemes
...
schemes
)
{
Description
&
schemes
(
Schemes
...
_
schemes
)
{
Scheme
s
[
sizeof
...(
Schemes
)]
=
{
schemes
...
};
Scheme
s
[
sizeof
...(
Schemes
)]
=
{
_
schemes
...
};
std
::
copy
(
std
::
begin
(
s
),
std
::
end
(
s
),
std
::
back_inserter
(
schemes_
));
std
::
copy
(
std
::
begin
(
s
),
std
::
end
(
s
),
std
::
back_inserter
(
schemes_
));
return
*
this
;
return
*
this
;
}
}
...
...
include/pistache/flags.h
View file @
be1283e3
...
@@ -58,7 +58,7 @@ public:
...
@@ -58,7 +58,7 @@ public:
Flags
()
:
val
(
T
::
None
)
{
Flags
()
:
val
(
T
::
None
)
{
}
}
Flags
(
T
val
)
:
val
(
val
)
Flags
(
T
_val
)
:
val
(
_
val
)
{
{
}
}
...
...
include/pistache/http.h
View file @
be1283e3
...
@@ -230,19 +230,19 @@ public:
...
@@ -230,19 +230,19 @@ public:
private:
private:
Timeout
(
const
Timeout
&
other
)
Timeout
(
const
Timeout
&
other
)
:
transport
(
other
.
transport
)
:
handler
(
other
.
handler
)
,
handler
(
other
.
handler
)
,
request
(
other
.
request
)
,
request
(
other
.
request
)
,
transport
(
other
.
transport
)
,
armed
(
other
.
armed
)
,
armed
(
other
.
armed
)
,
timerFd
(
other
.
timerFd
)
,
timerFd
(
other
.
timerFd
)
{
}
{
}
Timeout
(
Tcp
::
Transport
*
transport
,
Timeout
(
Tcp
::
Transport
*
transport
_
,
Handler
*
handler
,
Handler
*
handler
_
,
Request
request
)
Request
request
_
)
:
transport
(
transport
)
:
handler
(
handler_
)
,
handler
(
handler
)
,
request
(
std
::
move
(
request_
)
)
,
request
(
std
::
move
(
request
)
)
,
transport
(
transport_
)
,
armed
(
false
)
,
armed
(
false
)
,
timerFd
(
-
1
)
,
timerFd
(
-
1
)
{
{
...
@@ -517,7 +517,8 @@ public:
...
@@ -517,7 +517,8 @@ public:
return
&
buf_
;
return
&
buf_
;
}
}
DynamicStreamBuf
*
rdbuf
(
DynamicStreamBuf
*
other
)
{
DynamicStreamBuf
*
rdbuf
([[
maybe_unused
]]
DynamicStreamBuf
*
other
)
{
UNUSED
(
other
)
throw
std
::
domain_error
(
"Unimplemented"
);
throw
std
::
domain_error
(
"Unimplemented"
);
}
}
...
@@ -613,9 +614,9 @@ namespace Private {
...
@@ -613,9 +614,9 @@ namespace Private {
};
};
struct
BodyStep
:
public
Step
{
struct
BodyStep
:
public
Step
{
BodyStep
(
Message
*
message
)
BodyStep
(
Message
*
message
_
)
:
Step
(
message
)
:
Step
(
message
_
)
,
chunk
(
message
)
,
chunk
(
message
_
)
,
bytesRead
(
0
)
,
bytesRead
(
0
)
{
}
{
}
...
@@ -625,8 +626,8 @@ namespace Private {
...
@@ -625,8 +626,8 @@ namespace Private {
struct
Chunk
{
struct
Chunk
{
enum
Result
{
Complete
,
Incomplete
,
Final
};
enum
Result
{
Complete
,
Incomplete
,
Final
};
Chunk
(
Message
*
message
)
Chunk
(
Message
*
message
_
)
:
message
(
message
)
:
message
(
message
_
)
,
bytesRead
(
0
)
,
bytesRead
(
0
)
,
size
(
-
1
)
,
size
(
-
1
)
{
}
{
}
...
@@ -653,15 +654,17 @@ namespace Private {
...
@@ -653,15 +654,17 @@ namespace Private {
struct
ParserBase
{
struct
ParserBase
{
ParserBase
()
ParserBase
()
:
cur
rentStep
(
0
)
:
cur
sor
(
&
buffer
)
,
cur
sor
(
&
buffer
)
,
cur
rentStep
(
0
)
{
{
}
}
ParserBase
(
const
char
*
data
,
size_t
len
)
ParserBase
(
const
char
*
data
,
size_t
len
)
:
cur
rentStep
(
0
)
:
cur
sor
(
&
buffer
)
,
cur
sor
(
&
buffer
)
,
cur
rentStep
(
0
)
{
{
UNUSED
(
data
)
UNUSED
(
len
)
}
}
ParserBase
(
const
ParserBase
&
other
)
=
delete
;
ParserBase
(
const
ParserBase
&
other
)
=
delete
;
...
...
include/pistache/iterator_adapter.h
View file @
be1283e3
...
@@ -14,8 +14,8 @@ struct FlatMapIteratorAdapter {
...
@@ -14,8 +14,8 @@ struct FlatMapIteratorAdapter {
typedef
typename
Map
::
mapped_type
Value
;
typedef
typename
Map
::
mapped_type
Value
;
typedef
typename
Map
::
const_iterator
const_iterator
;
typedef
typename
Map
::
const_iterator
const_iterator
;
FlatMapIteratorAdapter
(
const_iterator
it
)
FlatMapIteratorAdapter
(
const_iterator
_
it
)
:
it
(
it
)
:
it
(
_
it
)
{
}
{
}
FlatMapIteratorAdapter
operator
++
()
{
FlatMapIteratorAdapter
operator
++
()
{
...
...
include/pistache/mailbox.h
View file @
be1283e3
...
@@ -90,14 +90,14 @@ public:
...
@@ -90,14 +90,14 @@ public:
}
}
T
*
post
(
T
*
newData
)
{
T
*
post
(
T
*
newData
)
{
auto
*
ret
=
Mailbox
<
T
>::
post
(
newData
);
auto
*
_
ret
=
Mailbox
<
T
>::
post
(
newData
);
if
(
isBound
())
{
if
(
isBound
())
{
uint64_t
val
=
1
;
uint64_t
val
=
1
;
TRY
(
write
(
event_fd
,
&
val
,
sizeof
val
));
TRY
(
write
(
event_fd
,
&
val
,
sizeof
val
));
}
}
return
ret
;
return
_
ret
;
}
}
T
*
clear
()
{
T
*
clear
()
{
...
...
include/pistache/optional.h
View file @
be1283e3
...
@@ -227,7 +227,7 @@ public:
...
@@ -227,7 +227,7 @@ public:
private:
private:
T
*
const
const
Data
()
const
{
T
*
constData
()
const
{
return
const_cast
<
T
*
const
>
(
reinterpret_cast
<
const
T
*
const
>
(
bytes
));
return
const_cast
<
T
*
const
>
(
reinterpret_cast
<
const
T
*
const
>
(
bytes
));
}
}
...
...
include/pistache/os.h
View file @
be1283e3
...
@@ -87,8 +87,8 @@ inline constexpr bool operator==(Tag lhs, Tag rhs) {
...
@@ -87,8 +87,8 @@ inline constexpr bool operator==(Tag lhs, Tag rhs) {
}
}
struct
Event
{
struct
Event
{
explicit
Event
(
Tag
tag
)
:
explicit
Event
(
Tag
_
tag
)
:
tag
(
tag
)
tag
(
_
tag
)
{
}
{
}
Flags
<
NotifyOn
>
flags
;
Flags
<
NotifyOn
>
flags
;
...
...
include/pistache/reactor.h
View file @
be1283e3
...
@@ -204,7 +204,7 @@ public:
...
@@ -204,7 +204,7 @@ public:
};
};
virtual
void
onReady
(
const
FdSet
&
fds
)
=
0
;
virtual
void
onReady
(
const
FdSet
&
fds
)
=
0
;
virtual
void
registerPoller
(
Polling
::
Epoll
&
poller
)
{
}
virtual
void
registerPoller
(
Polling
::
Epoll
&
poller
)
{
UNUSED
(
poller
)
}
Reactor
*
reactor
()
const
{
Reactor
*
reactor
()
const
{
return
reactor_
;
return
reactor_
;
...
...
include/pistache/router.h
View file @
be1283e3
...
@@ -228,7 +228,7 @@ namespace Routes {
...
@@ -228,7 +228,7 @@ namespace Routes {
template
<
typename
...
Args
>
template
<
typename
...
Args
>
void
static_checks
()
{
void
static_checks
()
{
static_assert
(
sizeof
...(
Args
)
==
2
,
"Function should take 2 parameters"
);
static_assert
(
sizeof
...(
Args
)
==
2
,
"Function should take 2 parameters"
);
typedef
details
::
TypeList
<
Args
...
>
Arguments
;
//
typedef details::TypeList<Args...> Arguments;
// Disabled now as it
// Disabled now as it
// 1/ does not compile
// 1/ does not compile
// 2/ might not be relevant
// 2/ might not be relevant
...
...
include/pistache/stream.h
View file @
be1283e3
...
@@ -133,10 +133,10 @@ struct Buffer {
...
@@ -133,10 +133,10 @@ struct Buffer {
,
isOwned
(
false
)
,
isOwned
(
false
)
{
}
{
}
Buffer
(
const
char
*
const
data
,
size_t
len
,
bool
own
=
false
)
Buffer
(
const
char
*
const
_data
,
size_t
_len
,
bool
_
own
=
false
)
:
data
(
data
)
:
data
(
_
data
)
,
len
(
len
)
,
len
(
_
len
)
,
isOwned
(
own
)
,
isOwned
(
_
own
)
{
}
{
}
Buffer
detach
(
size_t
fromIndex
=
0
)
const
{
Buffer
detach
(
size_t
fromIndex
=
0
)
const
{
...
@@ -226,8 +226,8 @@ private:
...
@@ -226,8 +226,8 @@ private:
class
StreamCursor
{
class
StreamCursor
{
public:
public:
StreamCursor
(
StreamBuf
<
char
>*
buf
,
size_t
initialPos
=
0
)
StreamCursor
(
StreamBuf
<
char
>*
_
buf
,
size_t
initialPos
=
0
)
:
buf
(
buf
)
:
buf
(
_
buf
)
{
{
advance
(
initialPos
);
advance
(
initialPos
);
}
}
...
@@ -235,8 +235,8 @@ public:
...
@@ -235,8 +235,8 @@ public:
static
constexpr
int
Eof
=
-
1
;
static
constexpr
int
Eof
=
-
1
;
struct
Token
{
struct
Token
{
Token
(
StreamCursor
&
cursor
)
Token
(
StreamCursor
&
_
cursor
)
:
cursor
(
cursor
)
:
cursor
(
_
cursor
)
,
position
(
cursor
.
buf
->
position
())
,
position
(
cursor
.
buf
->
position
())
,
eback
(
cursor
.
buf
->
begptr
())
,
eback
(
cursor
.
buf
->
begptr
())
,
gptr
(
cursor
.
buf
->
curptr
())
,
gptr
(
cursor
.
buf
->
curptr
())
...
@@ -270,8 +270,8 @@ public:
...
@@ -270,8 +270,8 @@ public:
};
};
struct
Revert
{
struct
Revert
{
Revert
(
StreamCursor
&
cursor
)
Revert
(
StreamCursor
&
_
cursor
)
:
cursor
(
cursor
)
:
cursor
(
_
cursor
)
,
eback
(
cursor
.
buf
->
begptr
())
,
eback
(
cursor
.
buf
->
begptr
())
,
gptr
(
cursor
.
buf
->
curptr
())
,
gptr
(
cursor
.
buf
->
curptr
())
,
egptr
(
cursor
.
buf
->
endptr
())
,
egptr
(
cursor
.
buf
->
endptr
())
...
...
include/pistache/transport.h
View file @
be1283e3
...
@@ -88,16 +88,16 @@ private:
...
@@ -88,16 +88,16 @@ private:
enum
Type
{
Raw
,
File
};
enum
Type
{
Raw
,
File
};
explicit
BufferHolder
(
const
Buffer
&
buffer
,
off_t
offset
=
0
)
explicit
BufferHolder
(
const
Buffer
&
buffer
,
off_t
offset
=
0
)
:
type
(
Raw
)
:
u
(
buffer
)
,
u
(
buffer
)
,
type
(
Raw
)
{
{
offset_
=
offset
;
offset_
=
offset
;
size_
=
buffer
.
len
;
size_
=
buffer
.
len
;
}
}
explicit
BufferHolder
(
const
FileBuffer
&
buffer
,
off_t
offset
=
0
)
explicit
BufferHolder
(
const
FileBuffer
&
buffer
,
off_t
offset
=
0
)
:
type
(
File
)
:
u
(
buffer
.
fd
()
)
,
u
(
buffer
.
fd
()
)
,
type
(
File
)
{
{
offset_
=
offset
;
offset_
=
offset
;
size_
=
buffer
.
size
();
size_
=
buffer
.
size
();
...
@@ -147,7 +147,7 @@ private:
...
@@ -147,7 +147,7 @@ private:
Fd
fd
;
Fd
fd
;
U
(
Buffer
buffer
)
:
raw
(
buffer
)
{
}
U
(
Buffer
buffer
)
:
raw
(
buffer
)
{
}
U
(
Fd
fd
)
:
fd
(
fd
)
{
}
U
(
Fd
fd
_
)
:
fd
(
fd_
)
{
}
}
u
;
}
u
;
size_t
size_
=
0
;
size_t
size_
=
0
;
off_t
offset_
=
0
;
off_t
offset_
=
0
;
...
@@ -155,11 +155,11 @@ private:
...
@@ -155,11 +155,11 @@ private:
};
};
struct
WriteEntry
{
struct
WriteEntry
{
WriteEntry
(
Async
::
Deferred
<
ssize_t
>
deferred
,
WriteEntry
(
Async
::
Deferred
<
ssize_t
>
deferred
_
,
BufferHolder
buffer
,
int
flags
=
0
)
BufferHolder
buffer
_
,
int
flags_
=
0
)
:
deferred
(
std
::
move
(
deferred
))
:
deferred
(
std
::
move
(
deferred
_
))
,
buffer
(
std
::
move
(
buffer
))
,
buffer
(
std
::
move
(
buffer
_
))
,
flags
(
flags
)
,
flags
(
flags
_
)
,
peerFd
(
-
1
)
,
peerFd
(
-
1
)
{
}
{
}
...
@@ -170,11 +170,11 @@ private:
...
@@ -170,11 +170,11 @@ private:
};
};
struct
TimerEntry
{
struct
TimerEntry
{
TimerEntry
(
Fd
fd
,
std
::
chrono
::
milliseconds
value
,
TimerEntry
(
Fd
fd
_
,
std
::
chrono
::
milliseconds
value_
,
Async
::
Deferred
<
uint64_t
>
deferred
)
Async
::
Deferred
<
uint64_t
>
deferred
_
)
:
fd
(
fd
)
:
fd
(
fd
_
)
,
value
(
value
)
,
value
(
value
_
)
,
deferred
(
std
::
move
(
deferred
))
,
deferred
(
std
::
move
(
deferred
_
))
{
{
active
.
store
(
true
,
std
::
memory_order_relaxed
);
active
.
store
(
true
,
std
::
memory_order_relaxed
);
}
}
...
@@ -201,8 +201,8 @@ private:
...
@@ -201,8 +201,8 @@ private:
};
};
struct
PeerEntry
{
struct
PeerEntry
{
PeerEntry
(
std
::
shared_ptr
<
Peer
>
peer
)
PeerEntry
(
std
::
shared_ptr
<
Peer
>
peer
_
)
:
peer
(
std
::
move
(
peer
))
:
peer
(
std
::
move
(
peer
_
))
{
}
{
}
std
::
shared_ptr
<
Peer
>
peer
;
std
::
shared_ptr
<
Peer
>
peer
;
...
...
include/pistache/version.h.in
0 → 100644
View file @
be1283e3
/* version.h
Kip Warner, 29 May 2018
Version constants
*/
#pragma once
namespace Pistache {
namespace Version {
static constexpr int Major = @VERSION_MAJOR@;
static constexpr int Minor = @VERSION_MINOR@;
} // namespace Version
} // namespace Pistache
libpistache.pc.in
0 → 100644
View file @
be1283e3
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libpistache
URL: http://pistache.io/
Description: An elegant C++ REST framework.
Version: @version@
Requires:
Libs: -L'${libdir}/' -lpistache -lpthread
Libs.private:
Cflags: -I'${includedir}/'
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