From a07fa26bfeb3fa2d5e23e3716b37225c2be48511 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Fri, 17 Feb 2023 23:40:12 -0500 Subject: [PATCH] fix: Pass BlitUserSymbol by val to cpp This is a csharp/cpp interop method. The csharp delegate, which is passed to and eventually invoked from cpp, accepts this param by value already, but for some reason the corresponding cpp delegate accepts that same param by ref. While working to enable the api server build on Linux, I discovered this delegate was receiving bogus data from cpp. The problem went away when I changed the cpp delegate param to be passed by value, rather than ref. --- src/lib/md/MDConsumerInterop.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/md/MDConsumerInterop.cpp b/src/lib/md/MDConsumerInterop.cpp index 230325a91..f3b0e78b2 100644 --- a/src/lib/md/MDConsumerInterop.cpp +++ b/src/lib/md/MDConsumerInterop.cpp @@ -167,7 +167,7 @@ CAPI int md_consumer_read_rfqs( // // Relay control CAPI void add_relay_symbol( - md::RelayControl *prelay, BlitUserSymbol &symbol, uint32_t flags) { + md::RelayControl *prelay, BlitUserSymbol symbol, uint32_t flags) { co2::SecurityChannel channel; channel.set_symbol(symbol.symbol); channel.set_exchange(symbol.exchange); @@ -190,7 +190,7 @@ CAPI void set_relay_token( md::set_relay_token(prelay, std::string(token, token_size)); } -typedef void (*usersymbol_cb)(BlitUserSymbol &symbol); +typedef void (*usersymbol_cb)(BlitUserSymbol symbol); CAPI void md_consumer_get_system_md_symbols(usersymbol_cb cb) { std::set system_symbols; get_system_md_symbols(