Mercurial > pidgin.yaz
comparison src/protocols/oscar/ft.c @ 8982:a4fd6666bb83
[gaim-migrate @ 9757]
Some Direct IM fixes.
1. Let's send our correct ip. We were usually sending localhost, so the
other side would try to connect to localhost and immediately fail and so
say, hey! I can't connect to you! Connect to me instead!
2. Add some gaim_conversation_writes to keep the user more informed as
to what's going on.
This changes the libfaim API. libfaim users take note.
I removed the util get local ip function, and made the function
that used to use it take an ip as an argument instead, so that oscar.c
could just call gaim's function, which works better.
I also made it possible to specify a cookie to use, because I think I'll
need that later. Probably.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Thu, 20 May 2004 00:14:14 +0000 |
parents | 535449a13b07 |
children | 460d02fe03df |
comparison
equal
deleted
inserted
replaced
8981:e40f9afd420e | 8982:a4fd6666bb83 |
---|---|
438 } | 438 } |
439 | 439 |
440 /** | 440 /** |
441 * For those times when we want to open up the direct connection channel ourselves. | 441 * For those times when we want to open up the direct connection channel ourselves. |
442 * | 442 * |
443 * You'll want to set up some kind of watcher on this socket. | 443 * You'll want to set up some kind of watcher on this socket. |
444 * When the state changes, call aim_handlerendconnection with | 444 * When the state changes, call aim_handlerendconnection with |
445 * the connection returned by this. aim_handlerendconnection | 445 * the connection returned by this. aim_handlerendconnection |
446 * will accept the pending connection and stop listening. | 446 * will accept the pending connection and stop listening. |
447 * | 447 * |
448 * @param sess The session | 448 * @param sess The session |
449 * @param sn The screen name to connect to. | 449 * @param sn The screen name to connect to. |
450 * @return The new connection. | 450 * @return The new connection. |
451 */ | 451 */ |
452 faim_export aim_conn_t *aim_odc_initiate(aim_session_t *sess, const char *sn, int listenfd, fu16_t port) | 452 faim_export aim_conn_t *aim_odc_initiate(aim_session_t *sess, const char *sn, int listenfd, |
453 const fu8_t *localip, fu16_t port, const fu8_t *mycookie) | |
453 { | 454 { |
454 aim_conn_t *newconn; | 455 aim_conn_t *newconn; |
455 aim_msgcookie_t *cookie; | 456 aim_msgcookie_t *cookie; |
456 struct aim_odc_intdata *priv; | 457 struct aim_odc_intdata *priv; |
457 fu8_t localip[4]; | |
458 fu8_t ck[8]; | 458 fu8_t ck[8]; |
459 | 459 |
460 if (aim_util_getlocalip(localip) == -1) | 460 if (!localip) |
461 return NULL; | 461 return NULL; |
462 | 462 |
463 aim_im_sendch2_odcrequest(sess, ck, sn, localip, port); | 463 if (mycookie) { |
464 memcpy(ck, mycookie, 8); | |
465 aim_im_sendch2_odcrequest(sess, ck, TRUE, sn, localip, port); | |
466 } else | |
467 aim_im_sendch2_odcrequest(sess, ck, FALSE, sn, localip, port); | |
464 | 468 |
465 cookie = (aim_msgcookie_t *)calloc(1, sizeof(aim_msgcookie_t)); | 469 cookie = (aim_msgcookie_t *)calloc(1, sizeof(aim_msgcookie_t)); |
466 memcpy(cookie->cookie, ck, 8); | 470 memcpy(cookie->cookie, ck, 8); |
467 cookie->type = AIM_COOKIETYPE_OFTIM; | 471 cookie->type = AIM_COOKIETYPE_OFTIM; |
468 | 472 |