Remove rest of mallocs from message_bridge_client
Use a pool for the client too. Docs for interleaving for SCTP type 1
say that there can be at most 1 partial message being delivered to
userspace at a time from all streams for an association, so 2 messages
in the queue is good enough.
Change-Id: I0b1bd579b92ac540a72b8849d7933a56ff611355
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/network/sctp_client.h b/aos/network/sctp_client.h
index 1ba32ff..1a0a907 100644
--- a/aos/network/sctp_client.h
+++ b/aos/network/sctp_client.h
@@ -48,11 +48,16 @@
void LogSctpStatus(sctp_assoc_t assoc_id);
void SetMaxSize(size_t max_size) { sctp_.SetMaxSize(max_size); }
+ void SetPoolSize(size_t pool_size) { sctp_.SetPoolSize(pool_size); }
void SetAssociationId(sctp_assoc_t sac_assoc_id) {
sac_assoc_id_ = sac_assoc_id;
}
+ void FreeMessage(aos::unique_c_ptr<Message> &&message) {
+ sctp_.FreeMessage(std::move(message));
+ }
+
private:
struct sockaddr_storage sockaddr_remote_;
struct sockaddr_storage sockaddr_local_;