comparison src/protocols/oscar/tlv.c @ 6101:e4a5085fb870

[gaim-migrate @ 6560] This should fix some icon uploading looping. Sean, the problem was that, when adding the md5 sum to ssi, the code was checking if it existed by looking for an item named "0", but it was actually adding an item named "1." So for accounts with no icon info yet, Gaim would end up getting in a loop and spiraling into oblivion, only far less dramatic. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 12 Jul 2003 19:08:19 +0000
parents 858979ab3867
children 4375bf2d9020
comparison
equal deleted inserted replaced
6100:5823ed7e2583 6101:e4a5085fb870
260 } 260 }
261 261
262 return new; 262 return new;
263 } 263 }
264 264
265 /*
266 * Compare two TLV lists for equality. This probably is not the most
267 * efficient way to do this.
268 *
269 * @param one One of the TLV chains to compare.
270 * @param two The other TLV chain to compare.
271 * @preturn Retrun 0 if the lists are the same, return 1 if they are different.
272 */
273 faim_internal int aim_tlvlist_cmp(aim_tlvlist_t *one, aim_tlvlist_t *two)
274 {
275 aim_bstream_t bs1, bs2;
276
277 if (aim_sizetlvchain(&one) != aim_sizetlvchain(&two))
278 return 1;
279
280 aim_bstream_init(&bs1, ((fu8_t *)malloc(aim_sizetlvchain(&one)*sizeof(fu8_t))), aim_sizetlvchain(&one));
281 aim_bstream_init(&bs2, ((fu8_t *)malloc(aim_sizetlvchain(&two)*sizeof(fu8_t))), aim_sizetlvchain(&two));
282
283 aim_writetlvchain(&bs1, &one);
284 aim_writetlvchain(&bs2, &two);
285
286 if (memcmp(bs1.data, bs2.data, bs1.len)) {
287 free(bs1.data);
288 free(bs2.data);
289 return 1;
290 }
291
292 free(bs1.data);
293 free(bs2.data);
294
295 return 0;
296 }
297
265 /** 298 /**
266 * aim_freetlvchain - Free a TLV chain structure 299 * aim_freetlvchain - Free a TLV chain structure
267 * @list: Chain to be freed 300 * @list: Chain to be freed
268 * 301 *
269 * Walks the list of TLVs in the passed TLV chain and 302 * Walks the list of TLVs in the passed TLV chain and