summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/datamgr.cpp
authorandyq <andyq>2002-12-12 00:18:40 (UTC)
committer andyq <andyq>2002-12-12 00:18:40 (UTC)
commit1d044ba4d276240b60bc98d18365a80183960751 (patch) (unidiff)
tree98f69f03bb7ff4a904c02322be6480c54b6a7e08 /noncore/settings/aqpkg/datamgr.cpp
parentfe063bdf069cd33def6347777624798e4f3a7059 (diff)
downloadopie-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.cpp28
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
@@ -130,15 +130,27 @@ void DataManager :: loadServers()
130 130
131 destList.push_back( d ); 131 destList.push_back( d );
132 } 132 }
133 else if ( lineStr.startsWith( "option" ) ) 133 else if ( lineStr.startsWith( "option" ) || lineStr.startsWith( "#option" ) )
134 { 134 {
135 char type[20]; 135 char type[20];
136 char val[100]; 136 char val[100];
137 sscanf( lineStr, "%*[^ ] %s %s", type, val ); 137 sscanf( lineStr, "%*[^ ] %s %s", type, val );
138 if ( stricmp( type, "http_proxy" ) == 0 ) 138 if ( stricmp( type, "http_proxy" ) == 0 )
139 {
139 httpProxy = val; 140 httpProxy = val;
141 if ( lineStr.startsWith( "#" ) )
142 httpProxyEnabled = false;
143 else
144 httpProxyEnabled = true;
145 }
140 if ( stricmp( type, "ftp_proxy" ) == 0 ) 146 if ( stricmp( type, "ftp_proxy" ) == 0 )
147 {
141 ftpProxy = val; 148 ftpProxy = val;
149 if ( lineStr.startsWith( "#" ) )
150 ftpProxyEnabled = false;
151 else
152 ftpProxyEnabled = true;
153 }
142 if ( stricmp( type, "proxy_username" ) == 0 ) 154 if ( stricmp( type, "proxy_username" ) == 0 )
143 proxyUsername = val; 155 proxyUsername = val;
144 if ( stricmp( type, "proxy_password" ) == 0 ) 156 if ( stricmp( type, "proxy_password" ) == 0 )
@@ -218,18 +230,26 @@ void DataManager :: writeOutIpkgConf()
218 it2++; 230 it2++;
219 } 231 }
220 232
233 out << endl;
221 out << "# Proxy Support" << endl; 234 out << "# Proxy Support" << endl;
222 out << "#" << endl;
223 235
224 if ( httpProxy == "" ) 236 if ( !httpProxyEnabled && httpProxy == "" )
225 out << "#option http_proxy http://proxy.tld:3128" << endl; 237 out << "#option http_proxy http://proxy.tld:3128" << endl;
226 else 238 else
239 {
240 if ( !httpProxyEnabled )
241 out << "#";
227 out << "option http_proxy " << httpProxy << endl; 242 out << "option http_proxy " << httpProxy << endl;
243 }
228 244
229 if ( ftpProxy == "" ) 245 if ( !ftpProxyEnabled && ftpProxy == "" )
230 out << "#option ftp_proxy http://proxy.tld:3128" << endl; 246 out << "#option ftp_proxy http://proxy.tld:3128" << endl;
231 else 247 else
248 {
249 if ( !ftpProxyEnabled )
250 out << "#";
232 out << "option ftp_proxy " << ftpProxy << endl; 251 out << "option ftp_proxy " << ftpProxy << endl;
252 }
233 if ( proxyUsername == "" ) 253 if ( proxyUsername == "" )
234 out << "#option proxy_username <username>" << endl; 254 out << "#option proxy_username <username>" << endl;
235 else 255 else