Changeset 5345 for trunk/module-cccshare.c
- Timestamp:
- 06/02/11 23:43:26 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-cccshare.c
r5304 r5345 537 537 card2->id = 0; 538 538 } 539 else 540 set_card_timeout(card2); 539 541 540 542 return card2; … … 615 617 } 616 618 617 618 619 /** 619 620 * Adds a new card to a cardlist. … … 641 642 } 642 643 } 644 643 645 if (!card2) { //Not found->add it: 644 646 if (free_card) { //Use this card … … 670 672 } 671 673 } 672 674 673 675 if (card2 && card2->hop > card->hop) { //hop is smaller, drop old card 674 676 ll_iter_remove(&it); … … 703 705 break; 704 706 } 707 705 708 if (card2 && card2->hop > card->hop) { //same card, if hop greater drop card 706 709 ll_iter_remove(&it); … … 730 733 } 731 734 735 int32_t card_timed_out(struct cc_card *card) 736 { 737 int32_t res = (card->timeout < time(NULL)); //card is older than 1h? 738 if (res) 739 cs_debug_mask(D_TRACE, "card %08X timed out! refresh forced", card->id?card->id:card->origin_id); 740 return res; 741 } 742 732 743 int32_t find_reported_card(struct cc_card *card1) 733 744 { … … 735 746 struct cc_card *card2; 736 747 while ((card2 = ll_iter_next(&it))) { 737 if (same_card(card1, card2) ) {748 if (same_card(card1, card2) && !card_timed_out(card2)) { 738 749 card1->id = card2->id; //Set old id !! 739 750 cc_free_card(card2);
Note:
See TracChangeset
for help on using the changeset viewer.