--- a/jingle-filetransfer/filetransfer.c Fri Aug 13 18:06:17 2010 +0200
+++ b/jingle-filetransfer/filetransfer.c Fri Aug 13 18:10:46 2010 +0200
@@ -334,14 +334,16 @@
gsize read;
GIOStatus status;
int count = 0;
- JingleSession *sess = session_find_by_sid(sid, from);
+ JingleSession *sess = session_find_by_sid(sc->sid, sc->from);
if (sess == NULL) {
scr_LogPrint(LPRINT_LOGNORM, "Jingle File Transfer: error before transfer");
// TODO: send error
return;
}
- SessionContent *sc2 = session_find_sessioncontent(sess, name);
+ SessionContent *sc2 = session_find_sessioncontent(sess, sc->name);
+
+ jft = (JingleFT*)sc2->description;
do {
count++;
@@ -362,7 +364,7 @@
if (status == G_IO_STATUS_NORMAL) {
g_checksum_update(jft->md5, (guchar*)buf, read);
// Call a handle in jingle who will call the trans
- handle_app_data(sid, from, name, buf, read);
+ handle_app_data(sc->sid, sc->from, sc->name, buf, read);
g_free(buf);
}
@@ -398,7 +400,7 @@
jft->md5 = g_checksum_new(G_CHECKSUM_MD5);
- sc->appfuncs->send(sc, data, size);
+ sc2->appfuncs->send(sc, size);
}
static void jingle_ft_init(void)
--- a/jingle/action-handlers.c Fri Aug 13 18:06:17 2010 +0200
+++ b/jingle/action-handlers.c Fri Aug 13 18:10:46 2010 +0200
@@ -341,7 +341,7 @@
JingleSession *sess;
JingleContent *jc;
SessionContent *sc;
- session_content *sc2;
+ session_content *sc2 = g_new0(session_content, 1);
GSList *el;
const gchar *from = lm_message_get_from(jn->message);
@@ -374,7 +374,10 @@
for (el = sess->content; el; el = el->next) {
sc = (SessionContent*)el->data;
// TODO size!
- sc2sc->appfuncs->start(sess->sid, (sess->origin == JINGLE_SESSION_INCOMING) ? sess->from : sess->to, sc->name, sc->description, 2048);
+ sc2->sid = sess->sid;
+ sc2->from = (sess->origin == JINGLE_SESSION_INCOMING) ? sess->from : sess->to;
+ sc2->name = sc->name;
+ sc->appfuncs->start(sc2, 2048);
}
}