Summary: | "Download Media" of podcast does not seem to apply proxy settings. | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | rumagent <rumagent> |
Component: | Podcast | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
rumagent
2006-09-13 20:58:07 UTC
It is amarok 1.4.3 by the way That's right, it'll ignore proxies. This bug seems to still exists in version 1.4.4. This is similar to bug:131137. PodcastFetcher is using qhttp which doesn't seem to have a proxy option built in. It looks like ktrm.cpp uses KProtocolManager::reparseConfiguration() to pick out the proxies from kcontrol, but you probably want to use KIO to pull down the podcasts. We used KIO, it was changed to qhttp for some reason I can't remember. I gotta check the logs. SVN commit 601084 by aoliveira: When downloading podcasts, proxy settings would be ignored. BUG: 134028 M +18 -4 playlistbrowseritem.cpp --- trunk/extragear/multimedia/amarok/src/playlistbrowseritem.cpp #601083:601084 @@ -2331,13 +2331,21 @@ PodcastFetcher::PodcastFetcher( QString url, const KURL &directory, int size ): m_url( QUrl( url )), - m_http( new QHttp( m_url.host() ) ), m_directory ( directory ), m_error( 0 ), m_size( size ) { m_redirected = false; + + QString proxy = Amarok::proxyForUrl( m_url ); + if ( proxy.isNull() ) + m_http = new QHttp( m_url.host() ); + else { + QUrl proxyUrl( proxy ); + m_http = new QHttp( proxyUrl.host(), proxyUrl.port() ); + } + connect( (m_http), SIGNAL( responseHeaderReceived ( const QHttpResponseHeader & ) ), this, SLOT( slotResponseReceived( const QHttpResponseHeader & ) ) ); connect( (m_http), SIGNAL( done( bool ) ), this, SLOT( slotDone( bool ) ) ); @@ -2379,8 +2387,14 @@ } m_file.setName( file.filePath() ); } - m_http->get( m_url.encodedPathAndQuery(), (&m_file) ); - // debug() << m_http->currentId() << " get( http://"<< m_url.host() << m_url.encodedPathAndQuery() << " )" << endl; + + // Qhttp::get() "conviniently" "corrects" the path in a way that wouldn't let it work + // work with proxies. So let's create the request manually. + QHttpRequestHeader request( "GET", m_url ); + request.setValue( "Host", m_url.host() + ":" + m_url.port() ); + request.setValue( "Connection", "Keep-Alive" ); + m_http->request( request, 0, (&m_file) ); + if( m_http->error() ) debug() << m_http->errorString() << endl; } @@ -2408,7 +2422,7 @@ void PodcastFetcher::slotResponseReceived( const QHttpResponseHeader & resp ) { -// debug() << m_http->currentId() << " RESPONCE, statuscode = " << resp.statusCode() << endl; +// debug() << m_http->currentId() << " RESPONCE, statuscode = " << resp.statusCode() << endl; if( resp.statusCode() == 302 || resp.statusCode() == 301 ) { if (resp.hasKey( "location" ) ) |