* Add proxy username/password support
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 04:18:33 +0000 (04:18 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 04:18:33 +0000 (04:18 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@11 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

opkg_download.c

index 6859e92..e8bfce0 100644 (file)
@@ -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);