From owner-p4-projects@FreeBSD.ORG Fri Nov 18 14:19:17 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9B2CF16A421; Fri, 18 Nov 2005 14:19:16 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 71D7216A41F for ; Fri, 18 Nov 2005 14:19:16 +0000 (GMT) (envelope-from soc-bushman@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C0D643D4C for ; Fri, 18 Nov 2005 14:19:16 +0000 (GMT) (envelope-from soc-bushman@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jAIEJF4I003708 for ; Fri, 18 Nov 2005 14:19:15 GMT (envelope-from soc-bushman@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jAIEJFFP003705 for perforce@freebsd.org; Fri, 18 Nov 2005 14:19:15 GMT (envelope-from soc-bushman@freebsd.org) Date: Fri, 18 Nov 2005 14:19:15 GMT Message-Id: <200511181419.jAIEJFFP003705@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-bushman@freebsd.org using -f From: soc-bushman To: Perforce Change Reviews Cc: Subject: PERFORCE change 86906 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2005 14:19:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=86906 Change 86906 by soc-bushman@soc-bushman_stinger on 2005/11/18 14:18:51 huge bugfix in the caching library and some minor bugfixes Affected files ... .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/Makefile#8 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/Makefile#13 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agent.c#5 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agent.h#5 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/Makefile.inc#8 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/group.c#5 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/group.h#5 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/hosts.c#8 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/hosts.h#8 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/passwd.c#8 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/passwd.h#8 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/services.c#8 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/services.h#8 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cached.8#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cached.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cached.conf#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cached.conf.5#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cachelib.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cachelib.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cacheplcs.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cacheplcs.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/config.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/config.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/debug.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/debug.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/hashtable.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/log.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/log.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/mp_rs_query.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/mp_rs_query.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/mp_ws_query.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/mp_ws_query.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/parser.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/parser.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/protocol.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/protocol.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/query.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/query.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/singletons.c#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/singletons.h#12 edit .. //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/startup/cached#7 edit Differences ... ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/Makefile#8 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/Makefile#13 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agent.c#5 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agent.h#5 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/Makefile.inc#8 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/group.c#5 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/group.h#5 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/hosts.c#8 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/hosts.h#8 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/passwd.c#8 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/passwd.h#8 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/services.c#8 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/agents/services.h#8 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cached.8#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cached.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cached.conf#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cached.conf.5#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cachelib.c#12 (text+ko) ==== @@ -381,6 +381,7 @@ item = policy->get_first_item_func(policy); while ((item != NULL) && (continue_func(entry, item) == 1)) { next_item = policy->get_next_item_func(policy, item); + TRACE_PTR(next_item); connected_item = item->connected_item; policy->remove_item_func(policy, item); @@ -389,20 +390,30 @@ ht_key.key = item->key; ht_key.key_size = item->key_size; + TRACE_POINT(); hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &entry->items, &ht_key); assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&entry->items)); - + + TRACE_POINT(); ht_item = HASHTABLE_GET_ENTRY(&(entry->items), hash); - ht_item_data = HASHTABLE_ENTRY_FIND(cache_ht_, ht_item, &ht_key); + TRACE_POINT(); + ht_item_data = HASHTABLE_ENTRY_FIND(cache_ht_, ht_item, + &ht_key); assert(ht_item_data != NULL); - HASHTABLE_ENTRY_REMOVE(cache_ht_, ht_item, ht_item_data); + TRACE_POINT(); + TRACE_POINT(); + TRACE_PTR(ht_item_data->key); + TRACE_INT(ht_item_data->key_size); free(ht_item_data->key); + TRACE_POINT(); free(ht_item_data->value); - free(ht_item_data); + TRACE_POINT(); + HASHTABLE_ENTRY_REMOVE(cache_ht_, ht_item, ht_item_data); --entry->items_size; + TRACE_POINT(); policy->destroy_item_func(item); if (connected_item != NULL) { @@ -743,9 +754,9 @@ find_res->fifo_policy_item->creation_time.tv_sec > common_entry->common_params.max_lifetime.tv_sec) { - HASHTABLE_ENTRY_REMOVE(cache_ht_, item, find_res); free(find_res->key); free(find_res->value); + HASHTABLE_ENTRY_REMOVE(cache_ht_, item, find_res); connected_item = find_res->fifo_policy_item->connected_item; @@ -1208,11 +1219,10 @@ common_entry->policies[0], item); + free(ht_item_data->key); + free(ht_item_data->value); HASHTABLE_ENTRY_REMOVE(cache_ht_, ht_item, ht_item_data); - free(ht_item_data->key); - free(ht_item_data->value); - free(ht_item_data); --common_entry->items_size; common_entry->policies[0]->destroy_item_func( ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cachelib.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cacheplcs.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/cacheplcs.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/config.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/config.h#12 (text+ko) ==== @@ -40,16 +40,16 @@ #define DEFAULT_COMMON_ENTRY_TIMEOUT 10 #define DEFAULT_MP_ENTRY_TIMEOUT 60 -#define DEFAULT_CACHE_HT_SIZE 257 +#define DEFAULT_CACHE_HT_SIZE 1 //257 #define INITIAL_ENTRIES_CAPACITY 8 #define DEFAULT_SOCKET_PATH "/var/run/cached" #define DEFAULT_PIDFILE_PATH "/var/run/cached.pid" -#define DEFAULT_POSITIVE_ELEMENTS_SIZE (2048) +#define DEFAULT_POSITIVE_ELEMENTS_SIZE 1//(2048) #define DEFAULT_POSITIVE_LIFETIME (60 * 60 * 12) -#define DEFAULT_NEGATIVE_ELEMENTS_SIZE (512) +#define DEFAULT_NEGATIVE_ELEMENTS_SIZE 1//(512) #define DEFAULT_NEGATIVE_LIFETIME (60 * 60) #define DEFAULT_MULTIPART_ELEMENTS_SIZE (1024 * 8) ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/debug.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/debug.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/hashtable.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/log.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/log.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/mp_rs_query.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/mp_rs_query.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/mp_ws_query.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/mp_ws_query.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/parser.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/parser.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/protocol.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/protocol.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/query.c#12 (text+ko) ==== @@ -940,7 +940,6 @@ { struct cache_transform_request *transform_request; struct cache_transform_response *transform_response; - struct configuration_entry *config_entry; size_t i, size; TRACE_IN(on_transform_request_process); @@ -976,7 +975,7 @@ goto fin; } - clear_config_entry_part(config_entry, + clear_config_entry_part(qstate->config_entry, qstate->eid_str, qstate->eid_str_length); } break; ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/query.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/singletons.c#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/cached/singletons.h#12 (text+ko) ==== ==== //depot/projects/soc2005/nsswitch_cached/release/cached-0.2/startup/cached#7 (text+ko) ====