Skip to content

Visca udp fixes#236

Merged
glikely merged 2 commits intomainfrom
visca-udp-fixes
May 26, 2025
Merged

Visca udp fixes#236
glikely merged 2 commits intomainfrom
visca-udp-fixes

Conversation

@glikely
Copy link
Owner

@glikely glikely commented May 26, 2025

Fix long delay before VISCA UDP devices start working because the code was waiting on a reverse hostname lookup that wasn't needed.

glikely added 2 commits May 26, 2025 17:26
Without this change, the debug macro may pick up a local variable in the
method instead of the member variable it is supposed to reference. Found
when adding ptz_debug statements to the PTZViscaOverIp::receive_datagram
method

Signed-off-by: Grant Likely <[email protected]>
If the host field is an IP address, then the call to lookupHost() will
delay for some time while it tries to do a reverse hostname lookup. This
isn't what is wanted, and lookupHost() doesn't need to be called to
parse an IP address field. Fix this by trying first to parse the host
field as an IP address, and only call lookupHost() if that fails (which
it will if the host field contains a hostname.

Signed-off-by: Grant Likely <[email protected]>
@glikely glikely merged commit 34a87d9 into main May 26, 2025
6 checks passed
@glikely glikely deleted the visca-udp-fixes branch May 27, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant