From a154cb399a6fcbd3d4fd19ab46aa2c107128d344 Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 17 Jun 2019 16:19:38 -0400 Subject: ... --- include/salticidae/network.h | 1 + src/network.cpp | 4 ++++ 2 files changed, 5 insertions(+) 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(*conn)); +} + peernetwork_conn_t *peernetwork_conn_copy(const peernetwork_conn_t *self) { return new peernetwork_conn_t(*self); } -- cgit v1.2.3-70-g09d2