Changeset dfa41a4 for protocols/jabber/jabber_util.c
- Timestamp:
- 2006-10-20T19:12:14Z (18 years ago)
- Branches:
- master
- Children:
- 3b3cd693
- Parents:
- f920d9e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber_util.c
rf920d9e rdfa41a4 24 24 #include "jabber.h" 25 25 26 static int next_id = 1;26 static unsigned int next_id = 1; 27 27 28 28 char *set_eval_priority( set_t *set, char *value ) … … 83 83 xt_add_attr( node, "to", to ); 84 84 85 /* IQ packets should always have an ID, so let's generate one. It 86 might get overwritten by jabber_cache_add() if this packet has 87 to be saved until we receive a response. Cached packets get 88 slightly different IDs so we can recognize them. */ 89 if( strcmp( name, "iq" ) == 0 ) 90 { 91 char *id = g_strdup_printf( "%s%05x", JABBER_PACKET_ID, ( next_id++ ) & 0xfffff ); 92 xt_add_attr( node, "id", id ); 93 g_free( id ); 94 } 95 85 96 return node; 86 97 } … … 116 127 } 117 128 118 /* Cache a node/ epacket for later use. Mainly useful for IQ packets if you need129 /* Cache a node/packet for later use. Mainly useful for IQ packets if you need 119 130 them when you receive the response. Use this BEFORE sending the packet so 120 it'll get a nid= tag, and do NOT free() the packet after writing it! */131 it'll get a new id= tag, and do NOT free() the packet after writing it! */ 121 132 void jabber_cache_add( struct gaim_connection *gc, struct xt_node *node, jabber_cache_event func ) 122 133 { 123 134 struct jabber_data *jd = gc->proto_data; 124 char *id = g_strdup_printf( " BeeX%04x", next_id++);135 char *id = g_strdup_printf( "%s%05x", JABBER_CACHED_ID, ( next_id++ ) & 0xfffff ); 125 136 struct jabber_cache_entry *entry = g_new0( struct jabber_cache_entry, 1 ); 126 137
Note: See TracChangeset
for help on using the changeset viewer.