Browse Source

fix TCP unregister systematically fails

pull/1898/head
Houston4444 4 months ago
parent
commit
8753640d6c
2 changed files with 11 additions and 2 deletions
  1. +3
    -2
      source/backend/engine/CarlaEngineOscHandlers.cpp
  2. +8
    -0
      source/utils/CarlaOscUtils.hpp

+ 3
- 2
source/backend/engine/CarlaEngineOscHandlers.cpp View File

@@ -245,6 +245,7 @@ int CarlaEngineOsc::handleMsgRegister(const bool isTCP,

oscData.owner = carla_strdup_safe(host);
oscData.path = carla_strdup_free(lo_url_get_path(url));
oscData.url = carla_strdup_safe(url);
oscData.target = target;

char* const targeturl = lo_address_get_url(target);
@@ -299,14 +300,14 @@ int CarlaEngineOsc::handleMsgUnregister(const bool isTCP,

const char* const url = &argv[0]->s;

if (std::strcmp(oscData.owner, url) == 0)
if (std::strcmp(oscData.url, url) == 0)
{
carla_stdout("OSC client %s unregistered", url);
oscData.clear();
return 0;
}

carla_stderr("OSC backend unregister failed, current owner %s does not match requested %s", oscData.owner, url);
carla_stderr("OSC backend unregister failed, current owner %s does not match requested %s", oscData.url, url);
return 0;
}



+ 8
- 0
source/utils/CarlaOscUtils.hpp View File

@@ -32,12 +32,14 @@
struct CarlaOscData {
const char* owner;
const char* path;
const char* url;
lo_address source;
lo_address target;

CarlaOscData() noexcept
: owner(nullptr),
path(nullptr),
url(nullptr),
source(nullptr),
target(nullptr) {}

@@ -60,6 +62,12 @@ struct CarlaOscData {
path = nullptr;
}

if (url != nullptr)
{
delete[] url;
url = nullptr;
}

if (source != nullptr)
{
try {


Loading…
Cancel
Save