onvif-rs icon indicating copy to clipboard operation
onvif-rs copied to clipboard

Altered Clients::new() URL checks to use parsed URL.

Open ChironEvans opened this issue 2 years ago • 2 comments

Both the parsed url and the device management URL have the port stripped regardless of whether the input arg included one.

s.x_addr provided by the device includes a port on Uniview IPC devices, which leads to failed validation.

ChironEvans avatar Dec 13 '22 05:12 ChironEvans

I encountered an issue when attempting to connect to one of my IP Cameras made by Uniview.

Result:

thread 'main' panicked at 'called Result::unwrap() on an Err value: "advertised device mgmt uri http://192.168.3.23:80/onvif/device_service not expected http://192.168.3.23/onvif/device_service"', onvif\examples\camera.rs:458:45

What was happening was the unparsed URL was being compared to the Device Management URL Parsed URL: http://192.168.3.23/onvif/device_service Raw URL: http://192.168.3.23:80/onvif/device_service Device Management URL: http://192.168.3.23/onvif/device_service

Because the raw URL contained a port, the application panicked. This occurred whether my uri argument was uri=http://192.168.3.23:80 or uri=http://192.168.3.23.

Behavior after change: Camera example functionality returns device information.

ChironEvans avatar Dec 13 '22 05:12 ChironEvans

@ChironEvans Can you fix formatting and force-push the branch, please?

DmitrySamoylov avatar Dec 14 '22 08:12 DmitrySamoylov