Changeset 5352
- Timestamp:
- 06/03/11 13:56:08 (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-cccam.c
r5347 r5352 462 462 while (cl->cc && cc->mode != CCCAM_MODE_SHUTDOWN && cs_trylock(&cc->lockcmd)) { 463 463 cs_debug_mask(D_TRACE, "%s trylock recv waiting", getprefix()); 464 cs_sleepms( 50);464 cs_sleepms(fast_rnd()); 465 465 } 466 466 if (!cl->cc || cc->mode == CCCAM_MODE_SHUTDOWN) return -1; … … 533 533 while (cl->cc && cc->mode != CCCAM_MODE_SHUTDOWN && cs_trylock(&cc->lockcmd)) { //We need this because cc_cmd_send is called from cccshare 534 534 cs_debug_mask(D_TRACE, "%s trylock send waiting", getprefix()); 535 cs_sleepms( 50);535 cs_sleepms(fast_rnd()); 536 536 } 537 537 if (!cl->cc || cc->mode == CCCAM_MODE_SHUTDOWN) return -1; … … 1108 1108 while (cs_trylock(&cc->cards_busy)) { 1109 1109 cs_debug_mask(D_TRACE, "%s trylock send_ecm cards waiting", getprefix()); 1110 cs_sleepms( 50);1110 cs_sleepms(fast_rnd()); 1111 1111 } 1112 1112 //forward_origin: … … 1360 1360 while (cs_trylock(&cc->cards_busy)) { 1361 1361 cs_debug_mask(D_TRACE, "trylock send_emm cards waiting", getprefix()); 1362 cs_sleepms( 50);1362 cs_sleepms(fast_rnd()); 1363 1363 } 1364 1364 … … 1780 1780 while (cs_trylock(&cc->cards_busy)) { 1781 1781 cs_debug_mask(D_TRACE, "%s trylock MSG_SRV_DATA cards waiting", getprefix()); 1782 cs_sleepms( 50);1782 cs_sleepms(fast_rnd()); 1783 1783 } 1784 1784 cc_free_cardlist(cc->cards, FALSE); … … 1897 1897 while (cs_trylock(&cc->cards_busy)) { 1898 1898 cs_debug_mask(D_TRACE, "%s trylock MSG_NEW_CARD cards waiting", getprefix()); 1899 cs_sleepms( 50);1899 cs_sleepms(fast_rnd()); 1900 1900 } 1901 1901 … … 1965 1965 while (cs_trylock(&cc->cards_busy)) { 1966 1966 cs_debug_mask(D_TRACE, "%s trylock MSG_CARD_REMOVED cards waiting", getprefix()); 1967 cs_sleepms( 50);1967 cs_sleepms(fast_rnd()); 1968 1968 } 1969 1969 cc_card_removed(cl, b2i(4, buf + 4)); … … 2020 2020 while (cs_trylock(&cc->cards_busy)) { 2021 2021 cs_debug_mask(D_TRACE, "%s trylock MSG_CW_NOK cards waiting", getprefix()); 2022 cs_sleepms( 50);2022 cs_sleepms(fast_rnd()); 2023 2023 } 2024 2024 … … 2175 2175 while (cs_trylock(&cc->cards_busy)) { 2176 2176 cs_debug_mask(D_TRACE, "%s trylock MSG_CW_ECM cards waiting", getprefix()); 2177 cs_sleepms( 50);2177 cs_sleepms(fast_rnd()); 2178 2178 } 2179 2179 cc->recv_ecmtask = -1; … … 2921 2921 while (cs_trylock(&cc->cards_busy)) { 2922 2922 cs_debug_mask(D_TRACE, "%s trylock cc_cli_connect cards waiting", getprefix()); 2923 cs_sleepms( 50);2923 cs_sleepms(fast_rnd()); 2924 2924 } 2925 2925 -
trunk/module-cccshare.c
r5346 r5352 741 741 int32_t card_timed_out(struct cc_card *card) 742 742 { 743 int32_t res = (card-> timeout < time(NULL)); //card is older than 1h?743 int32_t res = (card->card_type != CT_REMOTECARD) && (card->timeout < time(NULL)); //local card is older than 1h? 744 744 if (res) 745 745 cs_debug_mask(D_TRACE, "card %08X timed out! refresh forced", card->id?card->id:card->origin_id); -
trunk/module-stat.c
r5339 r5352 457 457 else if (rc == 5) { //timeout 458 458 stat = get_add_stat(rdr, er, prid); 459 459 460 //catch suddenly occuring timeouts and block reader: 460 461 if ((int)(ctime-stat->last_received) < (int)(5*cfg.ctimeout) && 461 stat->rc == 0 && 462 stat->ecm_count > 0) { 463 stat->rc = 5; 462 stat->rc == 0 && stat->ecm_count == 0) { 463 stat->rc = 5; 464 464 //inc_fail(stat); //do not inc fail factor in this case 465 465 } 466 else if ((rdr->client->login+(int)(2*cfg.ctimeout/1000)) < ctime && rdr->client->pending < 5) { //reader is longer than 5s connected && not more then 5 pending ecms 467 stat->rc = 5; 468 inc_fail(stat); 466 //reader is longer than 5s connected && not more then 5 pending ecms: 467 else if ((rdr->client->login+(int)(2*cfg.ctimeout/1000)) < ctime && rdr->client->pending < 5 && 468 stat->rc == 0 && stat->ecm_count == 0) { 469 stat->rc = 5; 470 inc_fail(stat); 469 471 } 470 472 471 473 stat->last_received = ctime; 472 474 473 if (!cfg.lb_reopen_mode)474 stat->ecm_count /= 2;475 476 475 //add timeout to stat: 477 476 if (ecm_time<=0 || ecm_time > (int)cfg.ctimeout) -
trunk/oscam-garbage.c
r5333 r5352 37 37 while (cs_trylock(&garbage_lock[bucket])) { 38 38 cs_debug_mask(D_TRACE, "trylock add_garbage wait"); 39 cs_sleepms( 50);39 cs_sleepms(fast_rnd()); 40 40 } 41 41 … … 80 80 while (cs_trylock(&garbage_lock[i])) { 81 81 cs_debug_mask(D_TRACE, "trylock garbage_collector wait"); 82 cs_sleepms( 50);82 cs_sleepms(fast_rnd()); 83 83 } 84 84 now = time(NULL);
Note:
See TracChangeset
for help on using the changeset viewer.