From ecc39f4cafd58717c5697fb0be7a697a09f99e74 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 14 Oct 2018 15:57:26 +0100 Subject: [PATCH] More detailed ZIP decode errors; fix failure to download some certificates (#1379). --- src/lib/internet.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/internet.cc b/src/lib/internet.cc index 615ced789..d1843c460 100644 --- a/src/lib/internet.cc +++ b/src/lib/internet.cc @@ -34,6 +34,7 @@ using std::string; using std::list; +using std::cout; using boost::optional; using boost::function; using boost::algorithm::trim; @@ -52,7 +53,7 @@ get_from_url (string url, bool pasv, ScopedTemporary& temp) CURL* curl = curl_easy_init (); curl_easy_setopt (curl, CURLOPT_URL, url.c_str()); - FILE* f = temp.open ("w"); + FILE* f = temp.open ("wb"); curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, get_from_url_data); curl_easy_setopt (curl, CURLOPT_WRITEDATA, f); curl_easy_setopt (curl, CURLOPT_FTP_USE_EPSV, 0); @@ -120,9 +121,10 @@ get_from_zip_url (string url, string file, bool pasv, function