author | andyq <andyq> | 2002-11-20 21:20:13 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-20 21:20:13 (UTC) |
commit | 726a5ade50098f208f9169176ff1ca099d8f0852 (patch) (unidiff) | |
tree | d97fc08e447dd156b2db5c8ee4a7b6f8a87acecb /noncore/settings/aqpkg/datamgr.cpp | |
parent | 19cec7475afb19b9a3096a5e01a87ae80690ce21 (diff) | |
download | opie-726a5ade50098f208f9169176ff1ca099d8f0852.zip opie-726a5ade50098f208f9169176ff1ca099d8f0852.tar.gz opie-726a5ade50098f208f9169176ff1ca099d8f0852.tar.bz2 |
Now keeps proxy settings if set
Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp index 1420242..e7fb75a 100644 --- a/noncore/settings/aqpkg/datamgr.cpp +++ b/noncore/settings/aqpkg/datamgr.cpp | |||
@@ -104,3 +104,2 @@ void DataManager :: loadServers() | |||
104 | 104 | ||
105 | |||
106 | // Looks a little wierd but read up to the r of src (throwing it away), | 105 | // Looks a little wierd but read up to the r of src (throwing it away), |
@@ -135,2 +134,16 @@ void DataManager :: loadServers() | |||
135 | } | 134 | } |
135 | else if ( lineStr.startsWith( "option" ) ) | ||
136 | { | ||
137 | char type[20]; | ||
138 | char val[100]; | ||
139 | sscanf( lineStr, "%*[^ ] %s %s", type, val ); | ||
140 | if ( stricmp( type, "http_proxy" ) == 0 ) | ||
141 | httpProxy = val; | ||
142 | if ( stricmp( type, "ftp_proxy" ) == 0 ) | ||
143 | ftpProxy = val; | ||
144 | if ( stricmp( type, "proxy_username" ) == 0 ) | ||
145 | proxyUsername = val; | ||
146 | if ( stricmp( type, "proxy_password" ) == 0 ) | ||
147 | proxyPassword = val; | ||
148 | } | ||
136 | } | 149 | } |
@@ -139,2 +152,7 @@ void DataManager :: loadServers() | |||
139 | 152 | ||
153 | cout << "httpProxy = " << httpProxy << endl; | ||
154 | cout << "ftpProxy = " << ftpProxy << endl; | ||
155 | cout << "proxyUsername = " << proxyUsername << endl; | ||
156 | cout << "proxyPassword = " << proxyPassword << endl; | ||
157 | |||
140 | reloadServerData( ); | 158 | reloadServerData( ); |
@@ -209,2 +227,27 @@ void DataManager :: writeOutIpkgConf() | |||
209 | 227 | ||
228 | out << "# Proxy Support" << endl; | ||
229 | out << "#" << endl; | ||
230 | |||
231 | if ( httpProxy == "" ) | ||
232 | out << "#option http_proxy http://proxy.tld:3128" << endl; | ||
233 | else | ||
234 | out << "option http_proxy " << httpProxy << endl; | ||
235 | |||
236 | if ( ftpProxy == "" ) | ||
237 | out << "#option ftp_proxy http://proxy.tld:3128" << endl; | ||
238 | else | ||
239 | out << "option ftp_proxy " << ftpProxy << endl; | ||
240 | if ( proxyUsername == "" ) | ||
241 | out << "#option proxy_username <username>" << endl; | ||
242 | else | ||
243 | out << "option proxy_username " << proxyUsername << endl; | ||
244 | if ( proxyPassword == "" ) | ||
245 | out << "#option proxy_password <password>" << endl << endl; | ||
246 | else | ||
247 | out << "option proxy_password " << proxyPassword << endl<< endl; | ||
248 | |||
249 | out << "# Offline mode (for use in constructing flash images offline)" << endl; | ||
250 | out << "#option offline_root target" << endl; | ||
251 | |||
252 | |||
210 | out.close(); | 253 | out.close(); |