Changeset 12461 for trunk/qt/session.cc


Ignore:
Timestamp:
May 27, 2011, 1:36:53 PM (11 years ago)
Author:
jordan
Message:

(trunk) #3817 remove OS proxy integration from the GTK+ client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/session.cc

    r12360 r12461  
    308308}
    309309
    310 static void
    311 curlConfigFunc( tr_session * session UNUSED, void * vcurl, const char * destination, void * unused UNUSED )
    312 {
    313     CURL * easy = vcurl;
    314     const QUrl url( destination );
    315     const QNetworkProxyQuery query( url );
    316     QList<QNetworkProxy> proxyList = QNetworkProxyFactory :: systemProxyForQuery( query );
    317 
    318     foreach( QNetworkProxy proxy, proxyList )
    319     {
    320         long type = -1;
    321 
    322         switch( proxy.type( ) ) {
    323             case QNetworkProxy::HttpProxy: type = CURLPROXY_HTTP; break;
    324             case QNetworkProxy::Socks5Proxy: type = CURLPROXY_SOCKS5; break;
    325             default: break;
    326         }
    327 
    328         if( type != -1 ) {
    329             curl_easy_setopt( easy, CURLOPT_PROXY, proxy.hostName().toUtf8().data() );
    330             curl_easy_setopt( easy, CURLOPT_PROXYPORT, long(proxy.port()) );
    331             curl_easy_setopt( easy, CURLOPT_PROXYTYPE, type );
    332             const QString user = proxy.user();
    333             const QString pass = proxy.password();
    334             if( !user.isEmpty() && !pass.isEmpty() )
    335                 curl_easy_setopt( easy, CURLOPT_PROXYUSERPWD, (user+":"+pass).toUtf8().data() );
    336             return;
    337         }
    338     }
    339 }
    340 
    341310void
    342311Session :: start( )
     
    362331        tr_sessionLoadSettings( &settings, myConfigDir.toUtf8().constData(), "qt" );
    363332        mySession = tr_sessionInit( "qt", myConfigDir.toUtf8().constData(), true, &settings );
    364         tr_sessionSetWebConfigFunc( mySession, curlConfigFunc, NULL );
    365333        tr_bencFree( &settings );
    366334
Note: See TracChangeset for help on using the changeset viewer.