[Pcsclite-cvs-commit] r2385 - trunk/PCSC/src

Ludovic Rousseau rousseau at alioth.debian.org
Mon Feb 5 14:55:01 CET 2007


Author: rousseau
Date: 2007-02-05 14:55:01 +0100 (Mon, 05 Feb 2007)
New Revision: 2385

Modified:
   trunk/PCSC/src/winscard.c
Log:
SCardReconnect(): call SYS_USleep() to "allow the status thread to
convey information" only if the application requests SCARD_RESET_CARD or
SCARD_UNPOWER_CARD.
We do not wait if the application requests SCARD_LEAVE_CARD.


Modified: trunk/PCSC/src/winscard.c
===================================================================
--- trunk/PCSC/src/winscard.c	2007-02-05 13:47:51 UTC (rev 2384)
+++ trunk/PCSC/src/winscard.c	2007-02-05 13:55:01 UTC (rev 2385)
@@ -507,6 +507,7 @@
 {
 	LONG rv;
 	PREADER_CONTEXT rContext = NULL;
+	int do_sleep = 1;
 
 	Log1(PCSC_LOG_DEBUG, "Attempting reconnect to token.");
 
@@ -668,6 +669,7 @@
 				break;
 		}
 
+		do_sleep = 1;
 	}
 	else
 		if (dwInitialization == SCARD_LEAVE_CARD)
@@ -675,6 +677,7 @@
 			/*
 			 * Do nothing
 			 */
+			do_sleep = 0;
 		}
 
 	/*******************************************
@@ -787,7 +790,8 @@
 	/*
 	 * Allow the status thread to convey information
 	 */
-	SYS_USleep(PCSCLITE_STATUS_POLL_RATE + 10);
+	if (do_sleep)
+		SYS_USleep(PCSCLITE_STATUS_POLL_RATE + 10);
 
 	return SCARD_S_SUCCESS;
 }




More information about the Pcsclite-cvs-commit mailing list