Skip to content

Commit 572a28b

Browse files
esevmartyanov
authored andcommitted
Only use a cached binding if the xaddr is the same
1 parent 42020e2 commit 572a28b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

onvif/client.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,11 @@ def create_onvif_service(self, name, port_type=None):
329329
name = name.lower()
330330
xaddr, wsdl_file, binding_name = self.get_definition(name, port_type)
331331

332-
# Don't re-create bindings
333-
if binding_name in self.services:
334-
return self.services[binding_name]
332+
# Don't re-create bindings if the xaddr remains the same.
333+
# The xaddr can change when a new PullPointSubscription is created.
334+
binding = self.services.get(binding_name)
335+
if binding and binding.xaddr == xaddr:
336+
return binding
335337

336338
service = ONVIFService(
337339
xaddr,

0 commit comments

Comments
 (0)