From: Nathan W. <fac...@us...> - 2005-05-26 03:51:49
|
Update of /cvsroot/gaim/gaim/src/protocols/jabber In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16294/src/protocols/jabber Modified Files: si.c Log Message: this prevents a jabber ft crash (went into oldstatus a while ago) Index: si.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/si.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -p -r1.13 -r1.14 --- si.c 12 Mar 2005 01:10:35 -0000 1.13 +++ si.c 26 May 2005 03:51:40 -0000 1.14 @@ -681,7 +681,7 @@ void jabber_si_parse(JabberStream *js, x 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 @@ void jabber_si_parse(JabberStream *js, x 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 @@ void jabber_si_parse(JabberStream *js, x 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); |