Changeset 4098
- Timestamp:
- 12/12/10 22:59:18 (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/globals.h
r4068 r4098 547 547 ushort idx; 548 548 ulong prid; 549 void *preferred_card;550 549 struct s_reader *selected_reader; 551 550 int matching_rdr[CS_MAXREADER]; -
trunk/module-cccam.c
r4097 r4098 412 412 if (cl->ecmtask[i].idx == ecm_idx && cl->ecmtask[i].rc == 101) 413 413 cl->ecmtask[i].rc = 100; //Mark unused 414 cl->ecmtask[i].preferred_card = NULL;415 414 } 416 415 } … … 1104 1103 1105 1104 pthread_mutex_lock(&cc->cards_busy); 1106 if (cur_er->preferred_card && 1107 ((struct cc_card*)cur_er->preferred_card)->origin_reader == rdr) { 1108 //card is defined by client, use this card! 1109 it = ll_iter_create(cc->cards); 1110 while ((card = ll_iter_next(it))) { 1111 if (same_card(card, cur_er->preferred_card)) { //Found this card! 1112 if (!is_sid_blocked(card, &cur_srvid)) { 1113 cs_debug_mask(D_TRACE, "%s found preferred card %d", getprefix(), card->id); 1114 break; 1115 } 1116 } 1117 } 1118 ll_iter_release(it); 1119 } 1120 else card = NULL; 1121 1122 if (!card) { 1123 //search cache: 1124 current_card = cc_find_current_card_by_srvid(cc, cur_er->caid, 1125 cur_er->prid, &cur_srvid); 1126 if (current_card) { 1127 if (!current_card->card || is_sid_blocked(current_card->card, 1128 &cur_srvid)) { 1129 cc_remove_current_card(cc, current_card); 1130 current_card = NULL; 1131 } 1132 } 1133 if (current_card) 1134 card = current_card->card; 1135 else 1136 card = NULL; 1137 } 1105 //search cache: 1106 current_card = cc_find_current_card_by_srvid(cc, cur_er->caid, 1107 cur_er->prid, &cur_srvid); 1108 if (current_card) { 1109 if (!current_card->card || is_sid_blocked(current_card->card, 1110 &cur_srvid)) { 1111 cc_remove_current_card(cc, current_card); 1112 current_card = NULL; 1113 } 1114 } 1115 if (current_card) 1116 card = current_card->card; 1117 else 1118 card = NULL; 1138 1119 1139 1120 //then check all other cards … … 2207 2188 er->idx = ++cc->server_ecm_idx; 2208 2189 2209 er->preferred_card = cc_get_card_by_id(server_card->id, cc->reported_carddatas);2210 2211 2190 cs_debug_mask( 2212 2191 D_TRACE, … … 3368 3347 3369 3348 cmi = 0; 3370 wait_for_keepalive = 0; 3349 wait_for_keepalive = 100; 3350 //some clients, e.g. mgcamd, does not support keepalive. So if not answered, keep connection 3371 3351 // check for client timeout, if timeout occurs try to send keepalive 3372 3352 while (cl->pfd) … … 3376 3356 cmi += 10; 3377 3357 if (cmi >= cfg->cmaxidle) { 3378 cmi = 0;3379 3358 if (cfg->cc_keep_connected) { 3380 if ( !wait_for_keepalive) {3359 if (wait_for_keepalive<3 || wait_for_keepalive == 100) { 3381 3360 if (cc_cmd_send(cl, NULL, 0, MSG_KEEPALIVE) < 0) 3382 3361 break; 3383 3362 cs_debug("cccam: keepalive"); 3384 3363 cc->answer_on_keepalive = time(NULL); 3385 wait_for_keepalive = 1;3364 wait_for_keepalive++; 3386 3365 } 3387 continue;3366 else if (wait_for_keepalive<100) break; 3388 3367 } else { 3389 3368 cs_debug_mask(D_TRACE, "%s keepalive after maxidle is reached", … … 3397 3376 else { //data is parsed! 3398 3377 cmi = 0; 3399 wait_for_keepalive = 0; 3378 if (i == MSG_KEEPALIVE) 3379 wait_for_keepalive = 0; 3400 3380 } 3401 3381 if (cc->mode != CCCAM_MODE_NORMAL || cl->dup) -
trunk/module-stat.c
r4069 r4098 318 318 if (er->matching_rdr[i]) { 319 319 int weight = rdr->lb_weight <= 0?100:rdr->lb_weight; 320 if (er->preferred_card && ((struct cc_card*)(er->preferred_card))->origin_reader==rdr)321 weight*=2;322 320 323 321 stat = get_stat(rdr, er->caid, er->prid, er->srvid);
Note:
See TracChangeset
for help on using the changeset viewer.