diff options
author | Determinant <[email protected]> | 2019-06-17 16:19:38 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-06-17 16:19:38 -0400 |
commit | a154cb399a6fcbd3d4fd19ab46aa2c107128d344 (patch) | |
tree | d95f57924cca6fa2235068c762550c161b1103a5 | |
parent | 01a5e352f11ee4c507f4304e4d41e069276164f0 (diff) |
...
-rw-r--r-- | include/salticidae/network.h | 1 | ||||
-rw-r--r-- | src/network.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/salticidae/network.h b/include/salticidae/network.h index 466272f..a09f8ac 100644 --- a/include/salticidae/network.h +++ b/include/salticidae/network.h @@ -1007,6 +1007,7 @@ const peernetwork_conn_t *peernetwork_get_peer_conn(const peernetwork_t *self, c msgnetwork_t *peernetwork_as_msgnetwork(peernetwork_t *self); peernetwork_t *msgnetwork_as_peernetwork_unsafe(msgnetwork_t *self); msgnetwork_conn_t *msgnetwork_conn_new_from_peernetwork_conn(const peernetwork_conn_t *conn); +peernetwork_conn_t *peernetwork_conn_new_from_msgnetwork_conn_unsafe(const msgnetwork_conn_t *conn); peernetwork_conn_t *peernetwork_conn_copy(const peernetwork_conn_t *self); void peernetwork_conn_free(const peernetwork_conn_t *self); void peernetwork_send_msg_by_move(peernetwork_t *self, msg_t * _moved_msg, const netaddr_t *paddr); diff --git a/src/network.cpp b/src/network.cpp index 8094ff2..938c105 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -201,6 +201,10 @@ msgnetwork_conn_t *msgnetwork_conn_new_from_peernetwork_conn(const peernetwork_c return new msgnetwork_conn_t(*conn); } +peernetwork_conn_t *peernetwork_conn_new_from_msgnetwork_conn_unsafe(const msgnetwork_conn_t *conn) { + return new peernetwork_conn_t(salticidae::static_pointer_cast<peernetwork_t::Conn>(*conn)); +} + peernetwork_conn_t *peernetwork_conn_copy(const peernetwork_conn_t *self) { return new peernetwork_conn_t(*self); } |