Change in pysim[master]: transport/pcsc: make sure reader is disconnected

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Sep 22 14:23:55 UTC 2021


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/25539 )


Change subject: transport/pcsc: make sure reader is disconnected
......................................................................

transport/pcsc: make sure reader is disconnected

Make sure that a reader is disconnected before connecting it. This will
efectively prevent resource leakage in the lower PCSC layers when the
reader is connected multiple times during bulk provisioning

Change-Id: I266e56f2330da25c680a76f4c0ca630a38e1f61b
---
M pySim/transport/pcsc.py
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/39/25539/1

diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py
index c16abac..147a6b7 100644
--- a/pySim/transport/pcsc.py
+++ b/pySim/transport/pcsc.py
@@ -56,6 +56,10 @@
 
 	def connect(self):
 		try:
+			# To avoid leakage of resources, make sure the reader
+			# is disconnected
+			self.disconnect()
+
 			# Explicitly select T=0 communication protocol
 			self._con.connect(CardConnection.T0_protocol)
 		except CardConnectionException:

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/25539
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I266e56f2330da25c680a76f4c0ca630a38e1f61b
Gerrit-Change-Number: 25539
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210922/98cc9805/attachment.htm>


More information about the gerrit-log mailing list