Changeset 537d9b9 for protocols/jabber/si.c
- Timestamp:
- 2016-11-20T08:40:36Z (8 years ago)
- Children:
- 3f44e43
- Parents:
- ba52ac5 (diff), 9f03c47 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/si.c
rba52ac5 r537d9b9 393 393 struct jabber_transfer *tf = NULL; 394 394 struct jabber_data *jd = ic->proto_data; 395 struct jabber_error *err; 395 396 396 397 if (!(tgt_jid = xt_find_attr(node, "from")) || 397 !(ini_jid = xt_find_attr(node, "to"))) { 398 !(ini_jid = xt_find_attr(node, "to")) || 399 !(iq_id = xt_find_attr(node, "id"))) { 398 400 imcb_log(ic, "Invalid SI response from=%s to=%s", tgt_jid, ini_jid); 401 return XT_HANDLED; 402 } 403 404 /* Let's see if we can find out what this bytestream should be for... */ 405 406 for (tflist = jd->filetransfers; tflist; tflist = g_slist_next(tflist)) { 407 struct jabber_transfer *tft = tflist->data; 408 if ((strcmp(tft->iq_id, iq_id) == 0)) { 409 tf = tft; 410 break; 411 } 412 } 413 414 if (!tf) { 415 imcb_log(ic, "WARNING: Received bytestream request from %s that doesn't match an SI request", ini_jid); 416 return XT_HANDLED; 417 } 418 419 err = jabber_error_parse(xt_find_node(node->children, "error"), XMLNS_STANZA_ERROR); 420 421 if (err) { 422 if (g_strcmp0(err->code, "forbidden") == 0) { 423 imcb_log(ic, "File %s: %s rejected the transfer", tf->ft->file_name, tgt_jid); 424 } else { 425 imcb_log(ic, "Error: Stream initiation request failed: %s (%s)", err->code, err->text); 426 } 427 imcb_file_canceled(ic, tf->ft, "Stream initiation request failed"); 428 jabber_error_free(err); 399 429 return XT_HANDLED; 400 430 } … … 409 439 * <value> 410 440 */ 411 if (!(tgt_jid = xt_find_attr(node, "from")) || 412 !(ini_jid = xt_find_attr(node, "to")) || 413 !(iq_id = xt_find_attr(node, "id")) || 414 !(c = xt_find_node(node->children, "si")) || 441 if (!(c = xt_find_node(node->children, "si")) || 415 442 !(cmp = xt_find_attr(c, "xmlns")) || 416 443 !(strcmp(cmp, XMLNS_SI) == 0) || … … 439 466 } 440 467 441 /* Let's see if we can find out what this bytestream should be for... */442 443 for (tflist = jd->filetransfers; tflist; tflist = g_slist_next(tflist)) {444 struct jabber_transfer *tft = tflist->data;445 if ((strcmp(tft->iq_id, iq_id) == 0)) {446 tf = tft;447 break;448 }449 }450 451 if (!tf) {452 imcb_log(ic, "WARNING: Received bytestream request from %s that doesn't match an SI request", ini_jid);453 return XT_HANDLED;454 }455 456 468 tf->ini_jid = g_strdup(ini_jid); 457 469 tf->tgt_jid = g_strdup(tgt_jid);
Note: See TracChangeset
for help on using the changeset viewer.