From b11bd185e3c656c08e3f3d57eb2ada15b7ac276d Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Mon, 20 Dec 2021 16:59:07 +0100 Subject: Fix #9756: Network command unpack proc was not generated in all cases. The case where the callback proc takes all command results but not any of the command parameters was not handled properly. --- src/network/network_command.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 05837f50c..d39618abf 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -136,7 +136,10 @@ constexpr UnpackNetworkCommandProc MakeUnpackNetworkCommandCallback() noexcept { /* Check if the callback matches with the command arguments. If not, don't generate an Unpack proc. */ using Tcallback = std::tuple_element_t; - if constexpr (std::is_same_v || std::is_same_v || std::is_same_v::CbArgs, typename CallbackArgsHelper::Args>) { + if constexpr (std::is_same_v || // Callback type is CommandCallback. + std::is_same_v || // Callback type is CommandCallbackData. + std::is_same_v::CbArgs, typename CallbackArgsHelper::Args> || // Callback proc takes all command return values and parameters. + (!std::is_void_v::RetTypes> && std::is_same_v::RetCallbackProc const>::Args, typename CallbackArgsHelper::Args>)) { // Callback return is more than CommandCost and the proc takes all return values. return &UnpackNetworkCommand; } else { return nullptr; -- cgit v1.2.3-70-g09d2