Make symupload v2 api respect --timeout flag

Change-Id: I763f45aa395a56e9c3285544e7755a1e5a85dbe4
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3422007
Reviewed-by: Nelson Billing <nbilling@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Zequan Wu 2022-01-27 16:52:13 -08:00 committed by Nelson Billing
parent f6974b15ef
commit d55a5f3dca
3 changed files with 16 additions and 10 deletions

View file

@ -12,6 +12,7 @@ namespace google_breakpad {
bool SymbolCollectorClient::CreateUploadUrl(
wstring& api_url,
wstring& api_key,
int* timeout_ms,
UploadUrlResponse *uploadUrlResponse) {
wstring url = api_url +
L"/v1/uploads:create"
@ -23,7 +24,7 @@ namespace google_breakpad {
url,
L"",
L"",
NULL,
timeout_ms,
&response,
&response_code)) {
wprintf(L"Failed to create upload url.\n");
@ -66,6 +67,7 @@ namespace google_breakpad {
CompleteUploadResult SymbolCollectorClient::CompleteUpload(
wstring& api_url,
wstring& api_key,
int* timeout_ms,
const wstring& upload_key,
const wstring& debug_file,
const wstring& debug_id) {
@ -84,7 +86,7 @@ namespace google_breakpad {
url,
body,
L"application/json",
NULL,
timeout_ms,
&response,
&response_code)) {
wprintf(L"Failed to complete upload.\n");
@ -116,6 +118,7 @@ namespace google_breakpad {
SymbolStatus SymbolCollectorClient::CheckSymbolStatus(
wstring& api_url,
wstring& api_key,
int* timeout_ms,
const wstring& debug_file,
const wstring& debug_id) {
wstring response;
@ -126,7 +129,7 @@ namespace google_breakpad {
if (!HTTPUpload::SendGetRequest(
url,
NULL,
timeout_ms,
&response,
&response_code)) {
wprintf(L"Failed to check symbol status.\n");

View file

@ -64,6 +64,7 @@ namespace google_breakpad {
static bool CreateUploadUrl(
wstring& api_url,
wstring& api_key,
int* timeout_ms,
UploadUrlResponse *uploadUrlResponse);
// Notify the API that symbol file upload is finished and its contents
@ -71,6 +72,7 @@ namespace google_breakpad {
static CompleteUploadResult CompleteUpload(
wstring& api_url,
wstring& api_key,
int* timeout_ms,
const wstring& upload_key,
const wstring& debug_file,
const wstring& debug_id);
@ -80,6 +82,7 @@ namespace google_breakpad {
static SymbolStatus CheckSymbolStatus(
wstring& api_url,
wstring& api_key,
int* timeout_ms,
const wstring& debug_file,
const wstring& debug_id);
};