author | andyq <andyq> | 2002-12-12 00:18:40 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-12-12 00:18:40 (UTC) |
commit | 1d044ba4d276240b60bc98d18365a80183960751 (patch) (side-by-side diff) | |
tree | 98f69f03bb7ff4a904c02322be6480c54b6a7e08 /noncore/settings/aqpkg/datamgr.cpp | |
parent | fe063bdf069cd33def6347777624798e4f3a7059 (diff) | |
download | opie-1d044ba4d276240b60bc98d18365a80183960751.zip opie-1d044ba4d276240b60bc98d18365a80183960751.tar.gz opie-1d044ba4d276240b60bc98d18365a80183960751.tar.bz2 |
Added proxy support
Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp index 96c28c0..3933a22 100644 --- a/noncore/settings/aqpkg/datamgr.cpp +++ b/noncore/settings/aqpkg/datamgr.cpp @@ -132,3 +132,3 @@ void DataManager :: loadServers() } - else if ( lineStr.startsWith( "option" ) ) + else if ( lineStr.startsWith( "option" ) || lineStr.startsWith( "#option" ) ) { @@ -138,5 +138,17 @@ void DataManager :: loadServers() if ( stricmp( type, "http_proxy" ) == 0 ) + { httpProxy = val; + if ( lineStr.startsWith( "#" ) ) + httpProxyEnabled = false; + else + httpProxyEnabled = true; + } if ( stricmp( type, "ftp_proxy" ) == 0 ) + { ftpProxy = val; + if ( lineStr.startsWith( "#" ) ) + ftpProxyEnabled = false; + else + ftpProxyEnabled = true; + } if ( stricmp( type, "proxy_username" ) == 0 ) @@ -220,14 +232,22 @@ void DataManager :: writeOutIpkgConf() + out << endl; out << "# Proxy Support" << endl; - out << "#" << endl; - if ( httpProxy == "" ) + if ( !httpProxyEnabled && httpProxy == "" ) out << "#option http_proxy http://proxy.tld:3128" << endl; else + { + if ( !httpProxyEnabled ) + out << "#"; out << "option http_proxy " << httpProxy << endl; + } - if ( ftpProxy == "" ) + if ( !ftpProxyEnabled && ftpProxy == "" ) out << "#option ftp_proxy http://proxy.tld:3128" << endl; else + { + if ( !ftpProxyEnabled ) + out << "#"; out << "option ftp_proxy " << ftpProxy << endl; + } if ( proxyUsername == "" ) |