diff options
author | ulim <a.sporto+bee@gmail.com> | 2008-07-22 14:37:49 +0200 |
---|---|---|
committer | ulim <a.sporto+bee@gmail.com> | 2008-07-22 14:37:49 +0200 |
commit | 8a90001ab2cde971abc64b8d5e4174dc4c4b0ae2 (patch) | |
tree | 5f4b8fe94f20258ac2e62560cae96390d9bf6539 /protocols/jabber/si.c | |
parent | 9afeeface6363ea81c5f80a7274a691f18550a21 (diff) |
Added an account setting 'proxy'.
Note that this is only used for sending. The default <local>;<auto> means let
the receiver try a direct connection first and then the proxy discovered from
the server (if any). If you know you're firewalled you can remove the <local>.
If you want to provide your own proxy try something like
"<local>;JID,HOST,PORT". E.g.
"<local>;proxy.somewhere.org,123.123.123.123,7777".
Diffstat (limited to 'protocols/jabber/si.c')
-rw-r--r-- | protocols/jabber/si.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/protocols/jabber/si.c b/protocols/jabber/si.c index 3afa30ff..e7cb2a17 100644 --- a/protocols/jabber/si.c +++ b/protocols/jabber/si.c @@ -38,10 +38,10 @@ void jabber_si_free_transfer( file_transfer_t *ft) jd->filetransfers = g_slist_remove( jd->filetransfers, tf ); - if( tf->fd ) + if( tf->fd != -1 ) { close( tf->fd ); - tf->fd = 0; + tf->fd = -1; } if( tf->disco_timeout ) @@ -128,8 +128,8 @@ gboolean jabber_si_waitfor_disco( gpointer data, gint fd, b_input_condition cond tf->disco_timeout_fired++; if( tf->bud->features && jd->have_streamhosts==1 ) { - jabber_si_transfer_start( tf ); tf->disco_timeout = 0; + jabber_si_transfer_start( tf ); return FALSE; } @@ -138,13 +138,14 @@ gboolean jabber_si_waitfor_disco( gpointer data, gint fd, b_input_condition cond return TRUE; if( !tf->bud->features && jd->have_streamhosts!=1 ) - imcb_file_canceled( tf->ft, "Couldn't get buddy's features or the server's" ); + imcb_log( tf->ic, "Couldn't get buddy's features nor discover all services of the server" ); else if( !tf->bud->features ) - imcb_file_canceled( tf->ft, "Couldn't get buddy's features" ); + imcb_log( tf->ic, "Couldn't get buddy's features" ); else - imcb_file_canceled( tf->ft, "Couldn't get server's features" ); + imcb_log( tf->ic, "Couldn't discover some of the server's services" ); tf->disco_timeout = 0; + jabber_si_transfer_start( tf ); return FALSE; } @@ -172,6 +173,7 @@ void jabber_si_transfer_request( struct im_connection *ic, file_transfer_t *ft, tf->ic = ic; tf->ft = ft; + tf->fd = -1; tf->ft->data = tf; tf->ft->free = jabber_si_free_transfer; tf->ft->finished = jabber_si_finished; @@ -185,10 +187,13 @@ void jabber_si_transfer_request( struct im_connection *ic, file_transfer_t *ft, if( !tf->bud->features ) jabber_iq_query_features( ic, bud->full_jid ); - if( jd->have_streamhosts!=1 ) { + /* If <auto> is not set don't check for proxies */ + if( ( jd->have_streamhosts!=1 ) && ( jd->streamhosts==NULL ) && + ( strstr( set_getstr( &ic->acc->set, "proxy" ), "<auto>" ) != NULL ) ) { jd->have_streamhosts = 0; jabber_iq_query_server( ic, server, XMLNS_DISCO_ITEMS ); - } + } else if ( jd->streamhosts!=NULL ) + jd->have_streamhosts = 1; /* if we had to do a query, wait for the result. * Otherwise fire away. */ @@ -308,6 +313,7 @@ int jabber_si_handle_request( struct im_connection *ic, struct xt_node *node, st tf->sid = g_strdup( sid ); tf->ic = ic; tf->ft = ft; + tf->fd = -1; tf->ft->data = tf; tf->ft->accept = jabber_si_answer_request; tf->ft->free = jabber_si_free_transfer; |