Changeset 4eb4c0f for protocols/jabber/jabber_util.c
- Timestamp:
- 2008-02-16T17:15:31Z (17 years ago)
- Branches:
- master
- Children:
- fd9fa52
- Parents:
- 8961950 (diff), ca60550 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber_util.c
r8961950 r4eb4c0f 142 142 entry->node = node; 143 143 entry->func = func; 144 entry->saved_at = time( NULL ); 144 145 g_hash_table_insert( jd->node_cache, xt_find_attr( node, "id" ), entry ); 145 146 } … … 163 164 { 164 165 struct jabber_data *jd = ic->proto_data; 165 166 g_hash_table_foreach_remove( jd->node_cache, jabber_cache_clean_entry, NULL ); 167 } 168 169 gboolean jabber_cache_clean_entry( gpointer key, gpointer entry_, gpointer nullpointer ) 166 time_t threshold = time( NULL ) - JABBER_CACHE_MAX_AGE; 167 168 g_hash_table_foreach_remove( jd->node_cache, jabber_cache_clean_entry, &threshold ); 169 } 170 171 gboolean jabber_cache_clean_entry( gpointer key, gpointer entry_, gpointer threshold_ ) 170 172 { 171 173 struct jabber_cache_entry *entry = entry_; 172 struct xt_node *node = entry->node; 173 174 if( node->flags & XT_SEEN ) 175 return TRUE; 176 else 177 { 178 node->flags |= XT_SEEN; 179 return FALSE; 180 } 174 time_t *threshold = threshold_; 175 176 return entry->saved_at < *threshold; 181 177 } 182 178
Note: See TracChangeset
for help on using the changeset viewer.