# HG changeset patch # User Nathan Walp # Date 1117079500 0 # Node ID 45598096d197e47806032745fd79cda462fe887d # Parent 6320ea98b28dc3d515c668e616b928ec3a5e5553 [gaim-migrate @ 12729] this prevents a jabber ft crash (went into oldstatus a while ago) committer: Tailor Script diff -r 6320ea98b28d -r 45598096d197 src/protocols/jabber/si.c --- a/src/protocols/jabber/si.c Thu May 26 03:29:07 2005 +0000 +++ b/src/protocols/jabber/si.c Thu May 26 03:51:40 2005 +0000 @@ -681,7 +681,7 @@ JabberSIXfer *jsx; GaimXfer *xfer; xmlnode *si, *file, *feature, *x, *field, *option, *value; - const char *stream_id, *filename, *filesize_c, *profile; + const char *stream_id, *filename, *filesize_c, *profile, *from; size_t filesize = 0; if(!(si = xmlnode_get_child(packet, "si"))) @@ -709,6 +709,15 @@ if(!(x = xmlnode_get_child_with_namespace(feature, "x", "jabber:x:data"))) return; + if(!(from = xmlnode_get_attrib(packet, "from"))) + return; + + /* if they've already sent us this file transfer with the same damn id + * then we're gonna ignore it, until I think of something better to do + * with it */ + if((xfer = jabber_si_xfer_find(js, stream_id, from))) + return; + jsx = g_new0(JabberSIXfer, 1); for(field = xmlnode_get_child(x, "field"); field; field = xmlnode_get_next_twin(field)) { @@ -742,8 +751,7 @@ jsx->stream_id = g_strdup(stream_id); jsx->iq_id = g_strdup(xmlnode_get_attrib(packet, "id")); - xfer = gaim_xfer_new(js->gc->account, GAIM_XFER_RECEIVE, - xmlnode_get_attrib(packet, "from")); + xfer = gaim_xfer_new(js->gc->account, GAIM_XFER_RECEIVE, from); xfer->data = jsx; gaim_xfer_set_filename(xfer, filename);