|
|
|
@ -64,7 +64,7 @@ namespace pEp {
|
|
|
|
|
close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HTTPSDevice::open(string url)
|
|
|
|
|
void HTTPSDevice::open(string url, notifyRead_t notifyRead)
|
|
|
|
|
{
|
|
|
|
|
if (url == "") {
|
|
|
|
|
if (_url != "")
|
|
|
|
@ -122,10 +122,10 @@ namespace pEp {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (u.path != "")
|
|
|
|
|
get(u.path);
|
|
|
|
|
get(u.path, notifyRead);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HTTPSDevice::get(string path)
|
|
|
|
|
void HTTPSDevice::get(string path, notifyRead_t notifyRead)
|
|
|
|
|
{
|
|
|
|
|
if (path == "")
|
|
|
|
|
throw invalid_argument("path needed for GET");
|
|
|
|
@ -148,6 +148,11 @@ namespace pEp {
|
|
|
|
|
_parser.get().body().open(temp_file_path(), file_mode::write, ec);
|
|
|
|
|
|
|
|
|
|
boost::beast::flat_buffer b;
|
|
|
|
|
|
|
|
|
|
http::read_header(*_stream, b, _parser);
|
|
|
|
|
if (header()["Content-Length"] != "0" && notifyRead)
|
|
|
|
|
notifyRead();
|
|
|
|
|
|
|
|
|
|
http::read(*_stream, b, _parser);
|
|
|
|
|
|
|
|
|
|
auto cl = header()["Content-Disposition"];
|
|
|
|
|