]> www.vanbest.org Git - sasc-ng.git/commitdiff
cardclient: fix endless loop if client vanishes
authorleslie <unknown>
Wed, 19 Aug 2009 09:13:20 +0000 (17:13 +0800)
committerleslie <unknown>
Wed, 19 Aug 2009 09:13:20 +0000 (17:13 +0800)
systems/cardclient/cc.c

index d2315f5eed14781ab9134fcb7137ed6a805d1f80..d9fcafe8f46760b7afd6c3b2ee05689dd9025d2c 100644 (file)
@@ -201,7 +201,7 @@ cSystemCardClient::cSystemCardClient(void)
 
 bool cSystemCardClient::ProcessECM(const cEcmInfo *ecm, unsigned char *data)
 {
-  cCardClient *startCc=cc;
+  cCardClient *startCc=cc, *oldcc;
   do {
     if(cc) {
       cTimeMs start;
@@ -226,9 +226,10 @@ bool cSystemCardClient::ProcessECM(const cEcmInfo *ecm, unsigned char *data)
         }
       }
     if(!cc) PRINTF(L_CC_CORE,"cc-loop");
+    oldcc=cc;
     cc=staticCcl.FindBySysId(ecm->caId,cc);
     if(cc && cc!=startCc) PRINTF(L_CC_CORE,"now trying client %s (%s:%d)",cc->Name(),cc->hostname,cc->port);
-    } while(cc!=startCc);
+    } while(cc!=startCc && cc!=oldcc);
   return false;
 }