Fixed TINC bug (cache usage)

Merged MS Lync with Skype (Microsoft renamed MS Lync in Skype for Business)
Renumbered Nintendo protocols in former MS Lync that was no longer used
Fix for #425
This commit is contained in:
Luca Deri
2017-07-27 00:18:15 +02:00
parent c15f2bda97
commit e6b594a626
14 changed files with 565 additions and 564 deletions
+3 -4
View File
@@ -130,9 +130,10 @@ cache_result cache_add(cache_t cache, void *item, uint32_t item_size) {
if((cache->map)[hash]) {
cache_entry_map hash_entry_map = cache->map[hash];
while(hash_entry_map) {
if(item_size == hash_entry_map->entry->item_size &&
!memcmp(hash_entry_map->entry->item, item, item_size)) {
!memcmp(hash_entry_map->entry->item, item, item_size)) {
break;
}
@@ -141,7 +142,6 @@ cache_result cache_add(cache_t cache, void *item, uint32_t item_size) {
if(hash_entry_map) {
cache_touch_entry(cache, hash_entry_map->entry);
return CACHE_NO_ERROR;
}
}
@@ -256,8 +256,7 @@ cache_result cache_remove(cache_t cache, void *item, uint32_t item_size) {
hash_entry_map = hash_entry_map->next;
}
if(hash_entry_map) {
if(hash_entry_map) {
if(hash_entry_map_prev) {
hash_entry_map_prev->next = hash_entry_map->next;
} else {