Changeset 4801 for trunk/module-cccam.c
- Timestamp:
- 03/11/11 21:16:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-cccam.c
r4800 r4801 1420 1420 free_extended_ecm_idx(cc); 1421 1421 ll_destroy_data(cc->extended_ecm_idx); 1422 1423 pthread_mutex_unlock(&cc->lock);1424 pthread_mutex_destroy(&cc->lock);1425 1422 1426 1423 pthread_mutex_unlock(&cc->lockcmd); … … 2116 2113 2117 2114 case MSG_KEEPALIVE: 2118 cc->just_logged_in = 0;2119 2115 if (cl->typ != 'c') { 2120 2116 cs_debug_mask(D_READER, "cccam: keepalive ack"); 2121 2117 } else { 2122 2118 //Checking if last answer is one minute ago: 2123 if (cc-> answer_on_keepalive + 55 <= time(NULL)) {2119 if (cc->just_logged_in || cc->answer_on_keepalive + 55 <= time(NULL)) { 2124 2120 cc_cmd_send(cl, NULL, 0, MSG_KEEPALIVE); 2125 2121 cs_debug_mask(D_CLIENT, "cccam: keepalive"); … … 2127 2123 } 2128 2124 } 2125 cc->just_logged_in = 0; 2129 2126 break; 2130 2127 … … 2427 2424 int n; 2428 2425 uchar *cbuf; 2429 struct cc_data *cc = cl->cc;2430 2426 2431 2427 if (buf == NULL || l <= 0) … … 2433 2429 cbuf = cs_malloc(&cbuf, l, QUITERROR); 2434 2430 memcpy(cbuf, buf, l); // make a copy of buf 2435 2436 pthread_mutex_lock(&cc->lock);2437 2431 2438 2432 n = cc_msg_recv(cl, cbuf, l); // recv and decrypt msg … … 2453 2447 } 2454 2448 2455 pthread_mutex_unlock(&cc->lock);2456 2457 2449 NULLFREE(cbuf); 2458 2450 … … 2466 2458 2467 2459 void cc_init_cc(struct cc_data *cc) { 2468 pthread_mutex_init(&cc->lock, NULL); //No recursive lock2469 2460 pthread_mutex_init(&cc->lockcmd, NULL); //No recursive lock 2470 2461 pthread_mutex_init(&cc->ecm_busy, NULL); //No recusive lock … … 2627 2618 return -2; 2628 2619 } 2629 if (cl->dup) { //Dup login kills existing client!2620 /* if (cl->dup) { //Dup login kills existing client! 2630 2621 struct s_client *cls; 2631 2622 for (cls=first_client; cls; cls=cls->next) { … … 2635 2626 } 2636 2627 } 2637 } 2628 }*/ 2638 2629 if (cl->dup) { 2639 2630 cs_log("account '%s' duplicate login, disconnect!", usr); … … 2686 2677 2687 2678 cc->cccam220 = check_cccam_compat(cc); 2679 cc->just_logged_in = TRUE; 2680 cc->answer_on_keepalive = time(NULL); 2688 2681 2689 2682 //Wait for Partner detection (NOK1 with data) before reporting cards … … 2723 2716 if (cc_cmd_send(cl, NULL, 0, MSG_KEEPALIVE) < 0) 2724 2717 break; 2725 2726 2727 2718 cs_debug_mask(D_CLIENT, "cccam: keepalive"); 2719 cc->answer_on_keepalive = time(NULL); 2720 wait_for_keepalive++; 2728 2721 } 2729 2722 else if (wait_for_keepalive<100) break;
Note:
See TracChangeset
for help on using the changeset viewer.