http = pkgi_http_get(db_item->url, db_item->content, 0); if (!http) { pkgi_dialog_error(_("Could not send HTTP request")); return 0; } int64_t http_length; if (!pkgi_http_response_length(http, &http_length)) { pkgi_dialog_error(_("HTTP request failed")); return 0; } if (http_length < 0) { pkgi_dialog_error(_("HTTP response has unknown length")); return 0; } download_size = http_length; total_size = download_size;