Changeset 861c199 for protocols/jabber/jabber_util.c
- Timestamp:
- 2006-10-08T18:41:11Z (17 years ago)
- Branches:
- master
- Children:
- 6a1128d
- Parents:
- 038d17f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber_util.c
r038d17f r861c199 82 82 them when you receive the response. Use this BEFORE sending the packet so 83 83 it'll get an id= tag, and do NOT free() the packet after writing it! */ 84 void jabber_cache_add( struct gaim_connection *gc, struct xt_node *node )84 void jabber_cache_add( struct gaim_connection *gc, struct xt_node *node, jabber_cache_event func ) 85 85 { 86 86 struct jabber_data *jd = gc->proto_data; … … 92 92 93 93 entry->node = node; 94 entry->func = func; 94 95 g_hash_table_insert( jd->node_cache, xt_find_attr( node, "id" ), entry ); 95 }96 97 struct xt_node *jabber_cache_get( struct gaim_connection *gc, char *id )98 {99 struct jabber_data *jd = gc->proto_data;100 struct jabber_cache_entry *entry = g_hash_table_lookup( jd->node_cache, id );101 102 return entry ? entry->node : NULL;103 96 } 104 97 … … 113 106 gboolean jabber_cache_clean_entry( gpointer key, gpointer entry, gpointer nullpointer ); 114 107 108 /* This one should be called from time to time (from keepalive, in this case) 109 to make sure things don't stay in the node cache forever. By marking nodes 110 during the first run and deleting marked nodes during a next run, every 111 node should be available in the cache for at least a minute (assuming the 112 function is indeed called every minute). */ 115 113 void jabber_cache_clean( struct gaim_connection *gc ) 116 114 {
Note: See TracChangeset
for help on using the changeset viewer.