Last active
December 13, 2023 14:00
-
-
Save guilt/dd35c569eece916a02dfece9cf15594b to your computer and use it in GitHub Desktop.
Allows KDE3 to actually use Socks Proxy correctly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- kdelibs-3.5.7/kioslave/http/http.cc 2007-05-14 13:22:34.000000000 +0530 | |
+++ kdelibs-3.5.7/kioslave/http/http.cc 2007-08-03 03:44:27.000000000 +0530 | |
@@ -2048,13 +2048,19 @@ | |
kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpOpenConnection" << endl; | |
setBlockConnection( true ); | |
- // kio_http uses its own proxying: | |
- KSocks::self()->disableSocks(); | |
if ( m_state.doProxy ) | |
{ | |
+ | |
QString proxy_host = m_proxyURL.host(); | |
int proxy_port = m_proxyURL.port(); | |
+ bool socks_disabled=false; | |
+ | |
+ // kio_http uses its own proxying: | |
+ if( KSocks::self()->usingSocks() && KSocks::self()->hasSocks() ) { | |
+ socks_disabled=true; | |
+ KSocks::self()->disableSocks(); | |
+ } | |
kdDebug(7113) << "(" << m_pid << ") Connecting to proxy server: " | |
<< proxy_host << ", port: " << proxy_port << endl; | |
@@ -2065,6 +2071,11 @@ | |
if ( !connectToHost(proxy_host, proxy_port, false) ) | |
{ | |
+ | |
+ // might as well re-enable it: | |
+ if(socks_disabled) | |
+ KSocks::self()->enableSocks(); | |
+ | |
if (userAborted()) { | |
error(ERR_NO_CONTENT, ""); | |
return false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment