Changeset 5080 for trunk/oscam-reader.c
- Timestamp:
- 04/26/11 00:13:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-reader.c
r5075 r5080 39 39 { 40 40 int32_t i, pending=0; 41 time_t t = time(NULL); 42 ECM_REQUEST *ecm; 41 43 struct s_client *cl = reader->client; 44 42 45 for (i=0; i<CS_MAXPENDING; i++) 43 46 { 44 if ((cl->ecmtask[i].rc>=10) && 45 (!memcmp(cl->ecmtask[i].ecmd5, cl->ecmtask[idx].ecmd5, CS_ECMSTORESIZE))) 47 ecm = &cl->ecmtask[i]; 48 if ((ecm->rc>=10) && 49 (!memcmp(ecm->ecmd5, cl->ecmtask[idx].ecmd5, CS_ECMSTORESIZE))) 46 50 { 47 51 if (rc) 48 52 { 49 cl->ecmtask[i].rc=(i==idx) ? 1 : 2;50 memcpy( cl->ecmtask[i].cw, cw, 16);53 ecm->rc=(i==idx) ? 1 : 2; 54 memcpy(ecm->cw, cw, 16); 51 55 } 52 56 else 53 cl->ecmtask[i].rc=0; 54 write_ecm_answer(reader, &cl->ecmtask[i]); 55 cl->ecmtask[i].idx=0; 56 } 57 if (cl->ecmtask[i].rc >= E_99) 57 ecm->rc=0; 58 write_ecm_answer(reader, ecm); 59 ecm->idx=0; 60 } 61 62 if (ecm->rc>=10 && (t-(uint32_t)ecm->tps.time > ((cfg.ctimeout + 500) / 1000) + 1)) // drop timeouts 63 { 64 ecm->rc=0; 65 send_reader_stat(reader, ecm, E_TIMEOUT); 66 } 67 68 if (ecm->rc >= 10) 58 69 pending++; 59 70 } … … 410 421 { 411 422 ecm = &cl->ecmtask[i]; 412 if ((t-(uint32_t)ecm->tps.time > ((cfg.ctimeout + 500) / 1000) + 1) && 413 (ecm->rc>=10)) // drop timeouts 414 { 415 ecm->rc=0; 416 send_reader_stat(reader, ecm, E_TIMEOUT); 417 } 423 if ((ecm->rc>=10) && (t-(uint32_t)ecm->tps.time > ((cfg.ctimeout + 500) / 1000) + 1)) // drop timeouts 424 { 425 ecm->rc=0; 426 send_reader_stat(reader, ecm, E_TIMEOUT); 427 } 418 428 if (n<0 && (ecm->rc<10)) // free slot found 419 429 n=i; … … 423 433 sflag=0; 424 434 425 if (ecm->rc >= E_99)435 if (ecm->rc >=10) 426 436 pending++; 427 437 }
Note:
See TracChangeset
for help on using the changeset viewer.