v0.9.2
Added
discovery::probe_unicast(ip, timeout)— send a WS-DiscoveryProbe
directly to a single known IP via unicast. Useful for "is this device
still there" checks against a known address (e.g. user-added manual
entries) and for cross-subnet detection where multicast cannot reach.
Sends bothNetworkVideoTransmitterandDeviceprobes and
deduplicates the responses by endpoint UUID, matching the behaviour
ofprobe/probe_rounds.
Fixed
-
XML entity decoding in SOAP response text (GeoVision snapshot URIs).
XmlNode::parsenow handlesEvent::GeneralRef(quick-xml 0.39 emits
each&/</Aas a separate event) and accumulates
text runs across events rather than overwriting on eachEvent::Text.
GeoVision cameras return aGetSnapshotUriResponsewith URIs like
http://host/cgi?skey=X&action=update&Snapshot=Video1.Stream1
— valid, RFC-compliant XML escaping. The old parser dropped every
Event::GeneralRefand overwrote text on eachEvent::Text, so only
the fragment after the last&survived; the URI came out as
Snapshot=Video1.Stream1, which the camera's web server rejected
with 500. Decodes the five predefined named entities (amp,lt,
gt,quot,apos) plus numeric character references
(&#NN;/&#xHH;). Unknown entities are preserved verbatim as
&name;so no content is silently lost. Affects every ONVIF response
carrying&-escaped text —StreamUri,SnapshotUri,Scopes,
HostnameInformation, custom metadata — not just GeoVision. -
WS-Addressing namespace regression — restored ~80 missing devices.
build_probenow emits the legacy WS-Addressing 2004/08 namespace
withs:mustUnderstand="1"on theActionandToheaders and an
explicit<wsa:ReplyTo>pointing at the WS-Addressing anonymous URI.
The 0.9.0/0.9.1 probe used the modern 2005/08 namespace, which older
Chinese OEM camera firmwares (Hikvision, Uniview, Dahua-family) silently
reject — they ship with strict ONVIF 2008-era SOAP parsers that only
recognise the 2004/08 wsa namespace. On a real heterogeneous LAN this
regression cost roughly 80 of 195 devices. The new payload matches
byte-for-byte what ODM (via WCF'sUdpDiscoveryEndpoint(WSDiscoveryApril2005))
sends. WS-Discovery 1.1 / 2009 support — which would use the 2005/08
wsa namespace — is deferred until both probes can be sent in parallel. -
Reordered
Byeno longer flaps a live device offline.listen()
now parses the<wsd:AppSequence>SOAP header (InstanceId/
MessageNumber/ optionalSequenceId) and silently drops aBye
whose sequence is comparable to (sameInstanceIdandSequenceId
as) one we have already seen but with an equal-or-lower
MessageNumber. UDP multicast does not guarantee delivery order, so
on noisy LANs an old departure could arrive after a fresh presence
announcement and incorrectly remove a still-online device. Matches
ODM'sNvtDiscovery.fs::process_offlinebehaviour.Hellois never
filtered — at worst a stale Hello resurfaces a live device, which is
harmless. TheDiscoveryEventenum is unchanged: sequence handling
is fully internal. -
probe_roundscancellation. Per-NIC listener tasks are now
spawned viatokio::task::JoinSetinstead oftokio::spawn. When
the surrounding future is dropped (e.g. caller wraps the call in
tokio::select!and a timeout branch wins), every in-flight task is
aborted instead of leaking until its own timeout elapses. Public
API unchanged.
Changed
- Multicast TTL raised from 4 to 32 (
set_multicast_ttl_v4). The
previous value was tuned for a single LAN segment and silently lost
devices on enterprise networks where the camera subnet is reached
through one or two IGMP-routed hops (PIM/IGMP on a core switch). 32
is a middle ground between the original 4 and ODM's "VPN workaround"
TTL of 64 — large enough for typical campus topologies, small enough
to respect the spec's intent that WS-Discovery stays close to the
link.
Full changelog: https://github.com/smiti1642/oxvif/blob/master/CHANGELOG.md