From 123ca24b4d3921f0ba1a7ee7df4dc5bc02a99d17 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 27 Nov 2015 18:43:30 +0000 Subject: Some Doremi certs are on the FTP site as *.dcicerts.zip, some as *.certs.zip; also add better error reporting when downloads fail (#763). --- ChangeLog | 4 ++++ src/wx/doremi_certificate_panel.cc | 27 ++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b7526b8a4..a3aa8810c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-11-27 Carl Hetherington + + * Fix download of some Doremi certificates (#763). + 2015-11-27 c.hetherington * Updated de_DE translation from Carsten Kurz. diff --git a/src/wx/doremi_certificate_panel.cc b/src/wx/doremi_certificate_panel.cc index 8b54d1c37..aaebb7390 100644 --- a/src/wx/doremi_certificate_panel.cc +++ b/src/wx/doremi_certificate_panel.cc @@ -26,10 +26,12 @@ #include "lib/internet.h" #include #include +#include #include using std::string; using std::cout; +using std::list; using boost::function; using boost::optional; @@ -67,6 +69,8 @@ DoremiCertificatePanel::finish_download (string serial, wxStaticText* message) { /* Try dcp2000, imb and ims prefixes (see mantis #375) */ + list errors; + optional error = get_from_zip_url ( String::compose ( "ftp://service:t3chn1c1an@ftp.doremilabs.com/Certificates/%1xxx/dcp2000-%2.dcicerts.zip", @@ -77,6 +81,19 @@ DoremiCertificatePanel::finish_download (string serial, wxStaticText* message) ); if (error) { + errors.push_back (error.get ()); + error = get_from_zip_url ( + String::compose ( + "ftp://service:t3chn1c1an@ftp.doremilabs.com/Certificates/%1xxx/dcp2000-%2.certs.zip", + serial.substr(0, 3), serial + ), + String::compose ("dcp2000-%1.cert.sha256.pem", serial), + boost::bind (&DownloadCertificatePanel::load, this, _1) + ); + } + + if (error) { + errors.push_back (error.get ()); error = get_from_zip_url ( String::compose ( "ftp://service:t3chn1c1an@ftp.doremilabs.com/Certificates/%1xxx/imb-%2.dcicerts.zip", @@ -88,6 +105,7 @@ DoremiCertificatePanel::finish_download (string serial, wxStaticText* message) } if (error) { + errors.push_back (error.get ()); error = get_from_zip_url ( String::compose ( "ftp://service:t3chn1c1an@ftp.doremilabs.com/Certificates/%1xxx/ims-%2.dcicerts.zip", @@ -99,8 +117,15 @@ DoremiCertificatePanel::finish_download (string serial, wxStaticText* message) } if (error) { + errors.push_back (error.get ()); message->SetLabel (wxT ("")); - error_dialog (this, std_to_wx (error.get ())); + + SafeStringStream s; + BOOST_FOREACH (string e, errors) { + s << e << "\n"; + } + + error_dialog (this, std_to_wx (s.str ())); } else { message->SetLabel (_("Certificate downloaded")); _dialog->setup_sensitivity (); -- cgit v1.2.3