Changeset 7962
- Timestamp:
- 12/11/12 17:16:20 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-reader.c
r7961 r7962 51 51 void casc_check_dcw(struct s_reader * reader, int32_t idx, int32_t rc, uchar *cw) 52 52 { 53 //int32_t i, pending=0;54 //time_t t = time(NULL);53 int32_t i, pending=0; 54 time_t t = time(NULL); 55 55 ECM_REQUEST *ecm; 56 56 struct s_client *cl = reader->client; … … 58 58 if(!cl) return; 59 59 60 ecm = &cl->ecmtask[idx]; 61 62 char ecmd5[17*3]; 63 cs_hexdump(0, ecm->ecmd5, 16, ecmd5, sizeof(ecmd5)); 64 cs_debug_mask(D_TRACE, "received cw from %s task %d idx %d ecm hash=%s", 65 reader->label, idx, ecm->idx, ecmd5); 66 67 if (ecm->parent) { 68 if (rc) 69 write_ecm_answer(reader, ecm->parent, E_FOUND, 0, cw, NULL); 70 else 71 write_ecm_answer(reader, ecm->parent, E_NOTFOUND, 0, NULL, NULL); 72 ecm->parent = NULL; 73 ecm->idx = 0; 74 ecm->rc = 0; 75 } 76 else 77 cs_log("invalid ecm idx received! reader %s idx %d",reader->label, idx); 78 79 // for (i = 0; i < cfg.max_pending; i++) { 80 // ecm = &cl->ecmtask[i]; 81 // if ((ecm->rc>=10) && ecm->caid == cl->ecmtask[idx].caid && (!memcmp(ecm->ecmd5, cl->ecmtask[idx].ecmd5, CS_ECMSTORESIZE))) { 82 // if (ecm->parent) { 83 // if (rc) { 84 // //write_ecm_answer(reader, ecm->parent, (i==idx) ? E_FOUND : E_CACHE2, 0, cw, NULL); //Cache2 now generated by distribute_ecm 85 // write_ecm_answer(reader, ecm->parent, E_FOUND, 0, cw, NULL); 86 // } else { 87 // write_ecm_answer(reader, ecm->parent, E_NOTFOUND, 0 , NULL, NULL); 88 // } 89 // } 90 // ecm->idx=0; 91 // ecm->rc=0; 92 // } 93 // 94 // if (ecm->rc>=10 && (t-(uint32_t)ecm->tps.time > ((cfg.ctimeout + 500) / 1000) + 1)) { // drop timeouts 95 // ecm->rc=0; 96 // send_reader_stat(reader, ecm, NULL, E_TIMEOUT); 97 // } 98 // 99 // if (ecm->rc >= 10) 100 // pending++; 101 // } 102 // cl->pending=pending; 60 for (i = 0; i < cfg.max_pending; i++) { 61 ecm = &cl->ecmtask[i]; 62 if ((ecm->rc>=10) && ecm->caid == cl->ecmtask[idx].caid && (!memcmp(ecm->ecmd5, cl->ecmtask[idx].ecmd5, CS_ECMSTORESIZE))) { 63 if (ecm->parent) { 64 if (rc) { 65 //write_ecm_answer(reader, ecm->parent, (i==idx) ? E_FOUND : E_CACHE2, 0, cw, NULL); //Cache2 now generated by distribute_ecm 66 write_ecm_answer(reader, ecm->parent, E_FOUND, 0, cw, NULL); 67 } else { 68 write_ecm_answer(reader, ecm->parent, E_NOTFOUND, 0 , NULL, NULL); 69 } 70 } 71 ecm->idx=0; 72 ecm->rc=0; 73 } 74 75 if (ecm->rc>=10 && (t-(uint32_t)ecm->tps.time > ((cfg.ctimeout + 500) / 1000) + 1)) { // drop timeouts 76 ecm->rc=0; 77 send_reader_stat(reader, ecm, NULL, E_TIMEOUT); 78 } 79 80 if (ecm->rc >= 10) 81 pending++; 82 } 83 cl->pending=pending; 103 84 } 104 85
Note:
See TracChangeset
for help on using the changeset viewer.