comparison src/protocols/oscar/oscar.c @ 4634:d19872836812

[gaim-migrate @ 4941] This will let you set up different proxy settings for different accounts. Mainly useful to the corporate users that need to connect to an internal jabber server, and still want to connect to "external" stuff through a proxy, or something along those lines. I'm sure someone will come up with another use for it. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 02 Mar 2003 18:48:02 +0000
parents ebae85185165
children 94635db7c6af
comparison
equal deleted inserted replaced
4633:812148fb2e2f 4634:d19872836812
381 if (xfer->remote_ip && xfer->remote_port) { 381 if (xfer->remote_ip && xfer->remote_port) {
382 xfer_data->conn = aim_newconn(od->sess, AIM_CONN_TYPE_RENDEZVOUS, NULL); 382 xfer_data->conn = aim_newconn(od->sess, AIM_CONN_TYPE_RENDEZVOUS, NULL);
383 if (xfer_data->conn) { 383 if (xfer_data->conn) {
384 xfer_data->conn->subtype = AIM_CONN_SUBTYPE_OFT_SENDFILE; 384 xfer_data->conn->subtype = AIM_CONN_SUBTYPE_OFT_SENDFILE;
385 aim_conn_addhandler(od->sess, xfer_data->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_PROMPT, oscar_sendfile_prompt, 0); 385 aim_conn_addhandler(od->sess, xfer_data->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_PROMPT, oscar_sendfile_prompt, 0);
386 xfer_data->conn->fd = xfer->fd = proxy_connect(xfer->remote_ip, xfer->remote_port, oscar_sendfile_connected, xfer); 386 xfer_data->conn->fd = xfer->fd = proxy_connect(gc->account, xfer->remote_ip, xfer->remote_port, oscar_sendfile_connected, xfer);
387 if (xfer->fd == -1) { 387 if (xfer->fd == -1) {
388 do_error_dialog(_("File Transfer Aborted"), _("Unable to establish file descriptor."), GAIM_ERROR); 388 do_error_dialog(_("File Transfer Aborted"), _("Unable to establish file descriptor."), GAIM_ERROR);
389 /* gaim_xfer_cancel? */ 389 /* gaim_xfer_cancel? */
390 } 390 }
391 } else { 391 } else {
849 849
850 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); 850 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);
851 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); 851 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0);
852 852
853 conn->status |= AIM_CONN_STATUS_INPROGRESS; 853 conn->status |= AIM_CONN_STATUS_INPROGRESS;
854 if (proxy_connect(account->proto_opt[USEROPT_AUTH][0] ? 854 if (proxy_connect(account, account->proto_opt[USEROPT_AUTH][0] ?
855 account->proto_opt[USEROPT_AUTH] : FAIM_LOGIN_SERVER, 855 account->proto_opt[USEROPT_AUTH] : FAIM_LOGIN_SERVER,
856 account->proto_opt[USEROPT_AUTHPORT][0] ? 856 account->proto_opt[USEROPT_AUTHPORT][0] ?
857 atoi(account->proto_opt[USEROPT_AUTHPORT]) : FAIM_LOGIN_PORT, 857 atoi(account->proto_opt[USEROPT_AUTHPORT]) : FAIM_LOGIN_PORT,
858 oscar_login_connect, gc) < 0) { 858 oscar_login_connect, gc) < 0) {
859 hide_login_progress(gc, _("Couldn't connect to host")); 859 hide_login_progress(gc, _("Couldn't connect to host"));
1120 break; 1120 break;
1121 } 1121 }
1122 } 1122 }
1123 host = g_strndup(info->bosip, i); 1123 host = g_strndup(info->bosip, i);
1124 bosconn->status |= AIM_CONN_STATUS_INPROGRESS; 1124 bosconn->status |= AIM_CONN_STATUS_INPROGRESS;
1125 rc = proxy_connect(host, port, oscar_bos_connect, gc); 1125 rc = proxy_connect(gc->account, host, port, oscar_bos_connect, gc);
1126 g_free(host); 1126 g_free(host);
1127 if (rc < 0) { 1127 if (rc < 0) {
1128 hide_login_progress(gc, _("Could Not Connect")); 1128 hide_login_progress(gc, _("Could Not Connect"));
1129 od->killme = TRUE; 1129 od->killme = TRUE;
1130 return 0; 1130 return 0;
1268 1268
1269 pos->offset = offset; 1269 pos->offset = offset;
1270 pos->len = len; 1270 pos->len = len;
1271 pos->modname = modname ? g_strdup(modname) : NULL; 1271 pos->modname = modname ? g_strdup(modname) : NULL;
1272 1272
1273 if (proxy_connect("gaim.sourceforge.net", 80, straight_to_hell, pos) != 0) { 1273 if (proxy_connect(pos->gc->account, "gaim.sourceforge.net", 80, straight_to_hell, pos) != 0) {
1274 char buf[256]; 1274 char buf[256];
1275 if (pos->modname) 1275 if (pos->modname)
1276 g_free(pos->modname); 1276 g_free(pos->modname);
1277 g_free(pos); 1277 g_free(pos);
1278 g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. You may want to use TOC until " 1278 g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. You may want to use TOC until "
1507 aim_conn_addhandler(sess, tstconn, 0x0007, 0x0003, gaim_info_change, 0); 1507 aim_conn_addhandler(sess, tstconn, 0x0007, 0x0003, gaim_info_change, 0);
1508 aim_conn_addhandler(sess, tstconn, 0x0007, 0x0005, gaim_info_change, 0); 1508 aim_conn_addhandler(sess, tstconn, 0x0007, 0x0005, gaim_info_change, 0);
1509 aim_conn_addhandler(sess, tstconn, 0x0007, 0x0007, gaim_account_confirm, 0); 1509 aim_conn_addhandler(sess, tstconn, 0x0007, 0x0007, gaim_account_confirm, 0);
1510 1510
1511 tstconn->status |= AIM_CONN_STATUS_INPROGRESS; 1511 tstconn->status |= AIM_CONN_STATUS_INPROGRESS;
1512 if (proxy_connect(host, port, oscar_auth_connect, gc) != 0) { 1512 if (proxy_connect(account, host, port, oscar_auth_connect, gc) != 0) {
1513 aim_conn_kill(sess, &tstconn); 1513 aim_conn_kill(sess, &tstconn);
1514 debug_printf("unable to reconnect with authorizer\n"); 1514 debug_printf("unable to reconnect with authorizer\n");
1515 g_free(host); 1515 g_free(host);
1516 return 1; 1516 return 1;
1517 } 1517 }
1526 return 1; 1526 return 1;
1527 } 1527 }
1528 aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_chatnav, 0); 1528 aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_chatnav, 0);
1529 1529
1530 tstconn->status |= AIM_CONN_STATUS_INPROGRESS; 1530 tstconn->status |= AIM_CONN_STATUS_INPROGRESS;
1531 if (proxy_connect(host, port, oscar_chatnav_connect, gc) != 0) { 1531 if (proxy_connect(account, host, port, oscar_chatnav_connect, gc) != 0) {
1532 aim_conn_kill(sess, &tstconn); 1532 aim_conn_kill(sess, &tstconn);
1533 debug_printf("unable to connect to chatnav server\n"); 1533 debug_printf("unable to connect to chatnav server\n");
1534 g_free(host); 1534 g_free(host);
1535 return 1; 1535 return 1;
1536 } 1536 }
1555 ccon->fd = -1; 1555 ccon->fd = -1;
1556 ccon->name = g_strdup(redir->chat.room); 1556 ccon->name = g_strdup(redir->chat.room);
1557 ccon->exchange = redir->chat.exchange; 1557 ccon->exchange = redir->chat.exchange;
1558 ccon->instance = redir->chat.instance; 1558 ccon->instance = redir->chat.instance;
1559 ccon->show = extract_name(redir->chat.room); 1559 ccon->show = extract_name(redir->chat.room);
1560 1560
1561 ccon->conn->status |= AIM_CONN_STATUS_INPROGRESS; 1561 ccon->conn->status |= AIM_CONN_STATUS_INPROGRESS;
1562 if (proxy_connect(host, port, oscar_chat_connect, ccon) != 0) { 1562 if (proxy_connect(account, host, port, oscar_chat_connect, ccon) != 0) {
1563 aim_conn_kill(sess, &tstconn); 1563 aim_conn_kill(sess, &tstconn);
1564 debug_printf("unable to connect to chat server\n"); 1564 debug_printf("unable to connect to chat server\n");
1565 g_free(host); 1565 g_free(host);
1566 g_free(ccon->show); 1566 g_free(ccon->show);
1567 g_free(ccon->name); 1567 g_free(ccon->name);
1579 return 1; 1579 return 1;
1580 } 1580 }
1581 aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_email, 0); 1581 aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_email, 0);
1582 1582
1583 tstconn->status |= AIM_CONN_STATUS_INPROGRESS; 1583 tstconn->status |= AIM_CONN_STATUS_INPROGRESS;
1584 if (proxy_connect(host, port, oscar_email_connect, gc) != 0) { 1584 if (proxy_connect(account, host, port, oscar_email_connect, gc) != 0) {
1585 aim_conn_kill(sess, &tstconn); 1585 aim_conn_kill(sess, &tstconn);
1586 debug_printf("unable to connect to email server\n"); 1586 debug_printf("unable to connect to email server\n");
1587 g_free(host); 1587 g_free(host);
1588 return 1; 1588 return 1;
1589 } 1589 }
1933 break; 1933 break;
1934 } 1934 }
1935 } 1935 }
1936 host = g_strndup(d->ip, i); 1936 host = g_strndup(d->ip, i);
1937 dim->conn->status |= AIM_CONN_STATUS_INPROGRESS; 1937 dim->conn->status |= AIM_CONN_STATUS_INPROGRESS;
1938 rc = proxy_connect(host, port, oscar_odc_callback, dim); 1938 rc = proxy_connect(gc->account, host, port, oscar_odc_callback, dim);
1939 g_free(host); 1939 g_free(host);
1940 if (rc < 0) { 1940 if (rc < 0) {
1941 aim_conn_kill(od->sess, &dim->conn); 1941 aim_conn_kill(od->sess, &dim->conn);
1942 g_free(dim); 1942 g_free(dim);
1943 cancel_direct_im(d); 1943 cancel_direct_im(d);