Fork for poking around in the original "client implementation for p≡p update server".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
downloadclient/test_noupdate.cc

30 lines
752 B

// this file is under GNU General Public License 3.0
// see LICENSE.txt
#include <iostream>
#include <assert.h>
#include "downloadclient.cc"
using namespace std;
using namespace pEp::UpdateClient;
int main()
{
cout << "trying to download...\n";
// test server only supports serials with leading 23 so this must fail
product p { "pEp for Something", "https://fdik.org/cgidownload?hash=66232323234242" };
try {
pEp::notifyRead_t notifyRead = [=]()->void{cout << "notify: read\n";exit(1);};
string filename = update(p, "public.der", notifyRead);
cout << "downloaded " << filename << "\n";
return 1;
}
catch (DownloadError&)
{
cout << "cannot download\n";
return 0;
}
}