Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
2d7b0eae
Commit
2d7b0eae
authored
Feb 17, 2020
by
dosuperuser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor refactoring
parent
bee96d84
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
21 deletions
+19
-21
libcaf_core/caf/local_actor.hpp
libcaf_core/caf/local_actor.hpp
+2
-2
libcaf_core/src/detail/parse.cpp
libcaf_core/src/detail/parse.cpp
+1
-1
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+2
-2
libcaf_core/src/message.cpp
libcaf_core/src/message.cpp
+0
-2
libcaf_core/src/stream_manager.cpp
libcaf_core/src/stream_manager.cpp
+1
-1
libcaf_core/test/serial_reply.cpp
libcaf_core/test/serial_reply.cpp
+1
-1
libcaf_io/src/io/network/ip_endpoint.cpp
libcaf_io/src/io/network/ip_endpoint.cpp
+1
-1
libcaf_openssl/src/openssl/manager.cpp
libcaf_openssl/src/openssl/manager.cpp
+5
-5
libcaf_openssl/src/openssl/session.cpp
libcaf_openssl/src/openssl/session.cpp
+6
-6
No files found.
libcaf_core/caf/local_actor.hpp
View file @
2d7b0eae
...
...
@@ -340,12 +340,12 @@ public:
/// Serializes the state of this actor to `sink`. This function is
/// only called if this actor has set the `is_serializable` flag.
/// The default implementation throws a `std::logic_error`.
virtual
error
save_state
(
serializer
&
sink
,
unsigned
int
version
);
virtual
error
save_state
(
serializer
&
sink
,
unsigned
int
version
)
const
;
/// Deserializes the state of this actor from `source`. This function is
/// only called if this actor has set the `is_serializable` flag.
/// The default implementation throws a `std::logic_error`.
virtual
error
load_state
(
deserializer
&
source
,
unsigned
int
version
);
virtual
error
load_state
(
deserializer
&
source
,
unsigned
int
version
)
const
;
/// Returns the currently defined fail state. If this reason is not
/// `none` then the actor will terminate with this error after executing
...
...
libcaf_core/src/detail/parse.cpp
View file @
2d7b0eae
...
...
@@ -54,7 +54,7 @@ struct literal {
};
void
parse
(
string_parser_state
&
ps
,
literal
&
x
)
{
CAF_ASSERT
(
x
.
str
.
size
()
>
0
);
CAF_ASSERT
(
!
x
.
str
.
empty
()
);
if
(
ps
.
current
()
!=
x
.
str
[
0
])
{
ps
.
code
=
pec
::
unexpected_character
;
return
;
...
...
libcaf_core/src/local_actor.cpp
View file @
2d7b0eae
...
...
@@ -108,11 +108,11 @@ const char* local_actor::name() const {
return
"actor"
;
}
error
local_actor
::
save_state
(
serializer
&
,
const
unsigned
int
)
{
error
local_actor
::
save_state
(
serializer
&
,
const
unsigned
int
)
const
{
CAF_RAISE_ERROR
(
"local_actor::serialize called"
);
}
error
local_actor
::
load_state
(
deserializer
&
,
const
unsigned
int
)
{
error
local_actor
::
load_state
(
deserializer
&
,
const
unsigned
int
)
const
{
CAF_RAISE_ERROR
(
"local_actor::deserialize called"
);
}
...
...
libcaf_core/src/message.cpp
View file @
2d7b0eae
...
...
@@ -18,8 +18,6 @@
#include "caf/message.hpp"
#include <iostream>
#include <utility>
#include <utility>
#include "caf/actor_system.hpp"
...
...
libcaf_core/src/stream_manager.cpp
View file @
2d7b0eae
...
...
@@ -215,7 +215,7 @@ void stream_manager::register_input_path(inbound_path* ptr) {
void
stream_manager
::
deregister_input_path
(
inbound_path
*
ptr
)
noexcept
{
CAF_ASSERT
(
ptr
!=
nullptr
);
CAF_LOG_TRACE
(
CAF_ARG2
(
"path"
,
*
ptr
));
CAF_ASSERT
(
inbound_paths_
.
size
()
>
0
);
CAF_ASSERT
(
!
inbound_paths_
.
empty
()
);
using
std
::
swap
;
if
(
ptr
!=
inbound_paths_
.
back
())
{
auto
i
=
std
::
find
(
inbound_paths_
.
begin
(),
inbound_paths_
.
end
(),
ptr
);
...
...
libcaf_core/test/serial_reply.cpp
View file @
2d7b0eae
...
...
@@ -74,5 +74,5 @@ CAF_TEST(test_serial_reply) {
[
&
](
const
error
&
err
)
{
CAF_ERROR
(
"Error: "
<<
self
->
system
().
render
(
err
));
});
CAF_REQUIRE
(
self
->
mailbox
().
size
()
==
0
);
CAF_REQUIRE
(
self
->
mailbox
().
empty
()
);
}
libcaf_io/src/io/network/ip_endpoint.cpp
View file @
2d7b0eae
...
...
@@ -243,7 +243,7 @@ error_code<sec> save_endpoint(ip_endpoint& ep, uint32_t& f, std::string& h,
l
=
*
ep
.
length
();
}
else
{
f
=
0
;
h
=
""
;
h
.
clear
()
;
p
=
0
;
l
=
0
;
}
...
...
libcaf_openssl/src/openssl/manager.cpp
View file @
2d7b0eae
...
...
@@ -116,9 +116,9 @@ void manager::init(actor_system_config&) {
SSL_library_init
();
SSL_load_error_strings
();
if
(
authentication_enabled
())
{
if
(
system
().
config
().
openssl_certificate
.
size
()
==
0
)
if
(
system
().
config
().
openssl_certificate
.
empty
()
)
CAF_RAISE_ERROR
(
"No certificate configured for SSL endpoint"
);
if
(
system
().
config
().
openssl_key
.
size
()
==
0
)
if
(
system
().
config
().
openssl_key
.
empty
()
)
CAF_RAISE_ERROR
(
"No private key configured for SSL endpoint"
);
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
...
...
@@ -145,9 +145,9 @@ void* manager::subtype_ptr() {
bool
manager
::
authentication_enabled
()
{
auto
&
cfg
=
system
().
config
();
return
cfg
.
openssl_certificate
.
size
()
>
0
||
cfg
.
openssl_key
.
size
()
>
0
||
cfg
.
openssl_passphrase
.
size
()
>
0
||
cfg
.
openssl_capath
.
size
()
>
0
||
cfg
.
openssl_cafile
.
size
()
>
0
;
return
!
cfg
.
openssl_certificate
.
empty
()
||
!
cfg
.
openssl_key
.
empty
()
||
!
cfg
.
openssl_passphrase
.
empty
()
||
!
cfg
.
openssl_capath
.
empty
()
||
!
cfg
.
openssl_cafile
.
empty
()
;
}
actor_system
::
module
*
manager
::
make
(
actor_system
&
sys
,
detail
::
type_list
<>
)
{
...
...
libcaf_openssl/src/openssl/session.cpp
View file @
2d7b0eae
...
...
@@ -215,25 +215,25 @@ SSL_CTX* session::create_ssl_context() {
if
(
sys_
.
openssl_manager
().
authentication_enabled
())
{
// Require valid certificates on both sides.
auto
&
cfg
=
sys_
.
config
();
if
(
cfg
.
openssl_certificate
.
size
()
>
0
if
(
!
cfg
.
openssl_certificate
.
empty
()
&&
SSL_CTX_use_certificate_chain_file
(
ctx
,
cfg
.
openssl_certificate
.
c_str
())
!=
1
)
CAF_RAISE_ERROR
(
"cannot load certificate"
);
if
(
cfg
.
openssl_passphrase
.
size
()
>
0
)
{
if
(
!
cfg
.
openssl_passphrase
.
empty
()
)
{
openssl_passphrase_
=
cfg
.
openssl_passphrase
;
SSL_CTX_set_default_passwd_cb
(
ctx
,
pem_passwd_cb
);
SSL_CTX_set_default_passwd_cb_userdata
(
ctx
,
this
);
}
if
(
cfg
.
openssl_key
.
size
()
>
0
if
(
!
cfg
.
openssl_key
.
empty
()
&&
SSL_CTX_use_PrivateKey_file
(
ctx
,
cfg
.
openssl_key
.
c_str
(),
SSL_FILETYPE_PEM
)
!=
1
)
CAF_RAISE_ERROR
(
"cannot load private key"
);
auto
cafile
=
(
cfg
.
openssl_cafile
.
size
()
>
0
?
cfg
.
openssl_cafile
.
c_str
()
:
nullptr
);
=
(
!
cfg
.
openssl_cafile
.
empty
()
?
cfg
.
openssl_cafile
.
c_str
()
:
nullptr
);
auto
capath
=
(
cfg
.
openssl_capath
.
size
()
>
0
?
cfg
.
openssl_capath
.
c_str
()
:
nullptr
);
=
(
!
cfg
.
openssl_capath
.
empty
()
?
cfg
.
openssl_capath
.
c_str
()
:
nullptr
);
if
(
cafile
||
capath
)
{
if
(
SSL_CTX_load_verify_locations
(
ctx
,
cafile
,
capath
)
!=
1
)
CAF_RAISE_ERROR
(
"cannot load trusted CA certificates"
);
...
...
@@ -270,7 +270,7 @@ SSL_CTX* session::create_ssl_context() {
std
::
string
session
::
get_ssl_error
()
{
std
::
string
msg
=
""
;
while
(
auto
err
=
ERR_get_error
())
{
if
(
msg
.
size
()
>
0
)
if
(
!
msg
.
empty
()
)
msg
+=
" "
;
char
buf
[
256
];
ERR_error_string_n
(
err
,
buf
,
sizeof
(
buf
));
...
...
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