OSC: fix manual port setting to take effect on first incoming message
authorLen Ovens <len@ovenwerks.net>
Wed, 10 May 2017 21:13:47 +0000 (14:13 -0700)
committerLen Ovens <len@ovenwerks.net>
Wed, 10 May 2017 21:14:27 +0000 (14:14 -0700)
libs/surfaces/osc/osc.cc

index f6c89005b76bb4651bda18d098e427aa7bdf0e4b..d93e696a2adc456905c714cd07ed24b350bfd46a 100644 (file)
@@ -1401,6 +1401,12 @@ OSC::get_surface (lo_address addr)
 {
        string r_url;
        char * rurl;
+       if (address_only) {
+               string host = lo_address_get_hostname (addr);
+               int protocol = lo_address_get_protocol (addr);
+               addr = lo_address_new_with_proto (protocol, host.c_str(), remote_port.c_str());
+       }
+
        rurl = lo_address_get_url (addr);
        r_url = rurl;
        free (rurl);