Changeset 4007
- Timestamp:
- 11/27/10 13:09:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam.c
r4006 r4007 405 405 pthread_mutex_lock(&cwcache_lock); 406 406 struct s_ecm *ecmc; 407 if (cwcache->next != NULL) { //keep it at least on one entry big 408 for (ecmc=cwcache; ecmc->next->next ; ecmc=ecmc->next) ; //find last element 409 if (cwidx==ecmc->next) 410 cwidx = cwcache; 411 NULLFREE(ecmc->next); //free last element 407 if (cwidx->next) { 408 if (cwidx->next->next) { 409 ecmc=cwidx->next->next; 410 NULLFREE(cwidx->next); 411 cwidx->next=ecmc; 412 } else 413 NULLFREE(cwidx->next); 414 } else { 415 ecmc=cwcache->next; 416 NULLFREE(cwcache); 417 cwcache=ecmc; 412 418 } 413 419 pthread_mutex_unlock(&cwcache_lock); … … 624 630 ecmc->next = malloc(sizeof(struct s_ecm)); 625 631 if (ecmc->next) 626 memset(ecmc , 0, sizeof(struct s_ecm));632 memset(ecmc->next, 0, sizeof(struct s_ecm)); 627 633 pthread_mutex_unlock(&cwcache_lock); 628 634 … … 631 637 ecmc->next = malloc(sizeof(struct s_ecm)); 632 638 if (ecmc->next) 633 memset(ecmc , 0, sizeof(struct s_ecm));639 memset(ecmc->next, 0, sizeof(struct s_ecm)); 634 640 } else { 635 641 cs_log("max connections reached -> reject client %s", cs_inet_ntoa(ip));
Note:
See TracChangeset
for help on using the changeset viewer.