diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-14 23:18:33 (EST) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-14 23:18:33 (EST) |
commit | b0e53cdb7e61368e2c00bf533b7e4ab2f19ab573 (patch) | |
tree | 926e8ded5b3ba9498669df1f982f4be059f358ce | |
parent | b695d5b6e048f6b46e70b47f20072b91168159fc (diff) |
* Add proxy username/password support
git-svn-id: http://opkg.googlecode.com/svn/trunk@11 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r-- | opkg_download.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/opkg_download.c b/opkg_download.c index 6859e92..e8bfce0 100644 --- a/opkg_download.c +++ b/opkg_download.c @@ -144,6 +144,14 @@ int opkg_download(opkg_conf_t *conf, const char *src, const char *dest_file_name curl_easy_setopt (curl, CURLOPT_WRITEDATA, file); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); curl_easy_setopt (curl, CURLOPT_PROGRESSFUNCTION, curl_progress_func); + if (conf->http_proxy || conf->ftp_proxy) + { + char *userpwd; + sprintf_alloc (&userpwd, "%s:%s", conf->proxy_user, + conf->proxy_passwd); + curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, userpwd); + free (userpwd); + } res = curl_easy_perform (curl); curl_easy_cleanup (curl); fclose (file); |