Changeset 882
- Timestamp:
- 12/17/09 09:02:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-cccam.c
r881 r882 223 223 224 224 int last_nok; 225 int processing;225 ECM_REQUEST *found; 226 226 227 227 unsigned long crc; … … 508 508 } 509 509 510 static int cc_get_nxt_ecm(){ 510 static int cc_get_nxt_ecm() 511 { 511 512 int n, i; 512 513 time_t t; 514 struct cc_data *cc = reader[ridx].cc; 513 515 514 516 t=time((time_t *)0); … … 523 525 if (ecmtask[i].rc >= 10) { // stil active and waiting 524 526 // search for the ecm with the lowest time, this should be the next to go 525 if ((!n || ecmtask[n].tps.time-ecmtask[i].tps.time < 0) ) n = i;527 if ((!n || ecmtask[n].tps.time-ecmtask[i].tps.time < 0) && &ecmtask[n] != cc->found) n = i; 526 528 } 527 529 } … … 672 674 } 673 675 */ 676 677 static int cc_abort_user_ecms(){ 678 int n, i; 679 time_t t;//, tls; 680 struct cc_data *cc = reader[ridx].cc; 681 682 t=time((time_t *)0); 683 for (i=1,n=1; i<CS_MAXPENDING; i++) 684 { 685 if ((t-ecmtask[i].tps.time > ((cfg->ctimeout + 500) / 1000) + 1) && 686 (ecmtask[i].rc>=10)) // drop timeouts 687 { 688 ecmtask[i].rc=0; 689 } 690 int td=abs(1000*(ecmtask[i].tps.time-cc->found->tps.time)+ecmtask[i].tps.millitm-cc->found->tps.millitm); 691 if (ecmtask[i].rc>=10 && ecmtask[i].cidx==cc->found->cidx && &ecmtask[i]!=cc->found){ 692 cs_log("aborting idx:%d caid:%04x client:%d timedelta:%d",ecmtask[i].idx,ecmtask[i].caid,ecmtask[i].cidx,td); 693 ecmtask[i].rc=0; 694 ecmtask[i].rcEx=7; 695 write_ecm_answer(fd_c2m, &ecmtask[i]); 696 } 697 } 698 return n; 699 700 } 674 701 675 702 static cc_msg_type_t cc_parse_msg(uint8 *buf, int l) … … 788 815 cc_crypt(&cc->block[DECRYPT], buf+4, l-4, ENCRYPT); // additional crypto step 789 816 pthread_mutex_unlock(&cc->ecm_busy); 817 cc_abort_user_ecms(); 790 818 cc_send_ecm(NULL, NULL); 791 819 ret = 0;
Note:
See TracChangeset
for help on using the changeset viewer.