libpurple/protocols/jabber/si.c

changeset 31735
6285e4a52844
parent 31680
d3902c687705
child 31739
88b0a203e2e0
equal deleted inserted replaced
31734:cec02d1d1c13 31735:6285e4a52844
963 963
964 static void 964 static void
965 jabber_si_xfer_bytestreams_send_init(PurpleXfer *xfer) 965 jabber_si_xfer_bytestreams_send_init(PurpleXfer *xfer)
966 { 966 {
967 JabberSIXfer *jsx; 967 JabberSIXfer *jsx;
968 PurpleProxyType proxy_type;
968 969
969 purple_xfer_ref(xfer); 970 purple_xfer_ref(xfer);
970 971
971 jsx = xfer->data; 972 jsx = xfer->data;
972 973
973 /* TODO: Should there be an option to not use the local host as a ft proxy? 974 /* TODO: This should probably be done with an account option instead of
974 * (to prevent revealing IP address, etc.) */ 975 * piggy-backing on the TOR proxy type. */
975 jsx->listen_data = purple_network_listen_range(0, 0, SOCK_STREAM, 976 proxy_type = purple_proxy_info_get_type(
977 purple_proxy_get_setup(purple_connection_get_account(jsx->js->gc)));
978 if (proxy_type == PURPLE_PROXY_TOR) {
979 purple_debug_info("jabber", "Skipping attempting local streamhost.\n");
980 jsx->listen_data = NULL;
981 } else
982 jsx->listen_data = purple_network_listen_range(0, 0, SOCK_STREAM,
976 jabber_si_xfer_bytestreams_listen_cb, xfer); 983 jabber_si_xfer_bytestreams_listen_cb, xfer);
984
977 if (jsx->listen_data == NULL) { 985 if (jsx->listen_data == NULL) {
978 /* We couldn't open a local port. Perhaps we can use a proxy. */ 986 /* We couldn't open a local port. Perhaps we can use a proxy. */
979 jabber_si_xfer_bytestreams_listen_cb(-1, xfer); 987 jabber_si_xfer_bytestreams_listen_cb(-1, xfer);
980 } 988 }
981 989

mercurial