Changeset 5100 for trunk/module-cccam.c
- Timestamp:
- 04/27/11 21:31:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-cccam.c
r5098 r5100 1469 1469 struct cc_data *cc = cl->cc; 1470 1470 if (!cc) return; 1471 1472 cc->mode = CCCAM_MODE_SHUTDOWN; 1473 1474 while (pthread_mutex_trylock(&cc->lockcmd)) cs_sleepms(110); 1475 pthread_mutex_trylock(&cc->ecm_busy); 1476 pthread_mutex_trylock(&cc->cards_busy); 1477 1471 1478 cl->cc=NULL; 1472 1479 … … 1478 1485 ll_destroy_data(cc->extended_ecm_idx); 1479 1486 1480 if (!pthread_mutex_trylock(&cc->lockcmd)) 1481 pthread_mutex_unlock(&cc->lockcmd); 1487 pthread_mutex_unlock(&cc->lockcmd); 1482 1488 pthread_mutex_destroy(&cc->lockcmd); 1483 1489 1484 1490 cs_debug_mask(D_TRACE, "exit cccam2/3"); 1485 if (!pthread_mutex_trylock(&cc->ecm_busy)) 1486 pthread_mutex_unlock(&cc->ecm_busy); 1491 pthread_mutex_unlock(&cc->ecm_busy); 1487 1492 pthread_mutex_destroy(&cc->ecm_busy); 1488 1493 1489 if (!pthread_mutex_trylock(&cc->cards_busy)) 1490 pthread_mutex_unlock(&cc->cards_busy); 1494 pthread_mutex_unlock(&cc->cards_busy); 1491 1495 pthread_mutex_destroy(&cc->cards_busy); 1492 1496 … … 2662 2666 } 2663 2667 2668 cs_debug_mask(D_TRACE, "send ccc checksum"); 2669 2664 2670 send(cl->udp_fd, data, 16, 0); 2665 2671 … … 2676 2682 cc_crypt(&cc->block[DECRYPT], buf, 20, DECRYPT); 2677 2683 2684 cs_debug_mask(D_TRACE, "receive ccc checksum"); 2678 2685 if ((i = cc_recv_to(cl, buf, 20)) == 20) { 2679 2686 //cs_ddump_mask(D_CLIENT, buf, 20, "cccam: recv:"); … … 2700 2707 } else 2701 2708 return -2; 2709 cs_debug_mask(D_TRACE, "ccc username received %s", usr); 2702 2710 2703 2711 cl->crypted = 1; … … 2708 2716 if (cc_recv_to(cl, buf, 6) != 6) 2709 2717 return -2; 2718 2719 cs_debug_mask(D_TRACE, "ccc passwdhash received %s", usr); 2710 2720 2711 2721 account = cfg.account; … … 2759 2769 } 2760 2770 2771 cs_debug_mask(D_TRACE, "ccc user authenticated %s", usr); 2761 2772 2762 2773 if (!cc->prefix) { … … 2794 2805 cc_cmd_send(cl, NULL, 0, MSG_CLI_DATA); 2795 2806 2807 cs_debug_mask(D_TRACE, "ccc send srv_data %s", usr); 2796 2808 if (cc_send_srv_data(cl) < 0) 2797 2809 return -1; … … 2806 2818 if (i<=0 && i != -9) 2807 2819 return 0; //disconnected 2808 2820 2809 2821 if (cc->cccam220) 2810 2822 cs_debug_mask(D_CLIENT, "%s extended sid mode activated", getprefix()); … … 2812 2824 cs_debug_mask(D_CLIENT, "%s 2.1.x compatibility mode", getprefix()); 2813 2825 2826 cs_debug_mask(D_TRACE, "ccc send cards %s", usr); 2827 2814 2828 if (!cc_srv_report_cards(cl)) 2815 2829 return -1; … … 2821 2835 //some clients, e.g. mgcamd, does not support keepalive. So if not answered, keep connection 2822 2836 // check for client timeout, if timeout occurs try to send keepalive 2837 cs_debug_mask(D_TRACE, "ccc connected and waiting for data %s", usr); 2823 2838 while (cl->pfd && cl->udp_fd && cc->mode == CCCAM_MODE_NORMAL && !cl->dup) 2824 2839 { … … 2837 2852 //new timeout check: 2838 2853 if (time(NULL)-timeout > (time_t)cfg.cmaxidle) { 2854 cs_debug_mask(D_TRACE, "ccc idle %s", usr); 2839 2855 //cs_debug_mask(D_TRACE, "client timeout user %s idle=%d client max idle=%d", usr, cmi, cfg.cmaxidle); 2840 2856 if (cfg.cc_keep_connected || cl->account->ncd_keepalive) {
Note:
See TracChangeset
for help on using the changeset viewer.