mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2025-12-29 02:35:31 +01:00
sym_upload: Show failure if symbol server gives redirect response
Add a "response_code" parameter to Linux's HTTPUpload::SendRequest() that, if non-NULL, will be set to the response code of the HTTP request. Using that, sym_upload will print a failure message on Linux if the response code is not 200. This is in line with the change made by http://breakpad.appspot.com/77001/ for the Mac version. BUG=google-breakpad:480, chromium-os:30032 TEST=Ran "sym_upload powertop.sym http://test.webdav.org/redir-tmp/" Ran "sym_upload powertop.sym http://clients2.google.com/cr/staging_symbol" Review URL: https://breakpad.appspot.com/388002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@968 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
4191cae361
commit
d6b6959e0e
4 changed files with 24 additions and 3 deletions
|
|
@ -71,6 +71,7 @@ static void Start(Options *options) {
|
|||
options->proxy_user_pwd,
|
||||
"",
|
||||
&response,
|
||||
NULL,
|
||||
&error);
|
||||
|
||||
if (success) {
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ static void Start(Options *options) {
|
|||
parameters["code_file"] = module_parts[4];
|
||||
parameters["debug_identifier"] = compacted_id;
|
||||
std::string response, error;
|
||||
long response_code;
|
||||
bool success = HTTPUpload::SendRequest(options->uploadURLStr,
|
||||
parameters,
|
||||
options->symbolsPath,
|
||||
|
|
@ -147,14 +148,21 @@ static void Start(Options *options) {
|
|||
options->proxy_user_pwd,
|
||||
"",
|
||||
&response,
|
||||
&response_code,
|
||||
&error);
|
||||
|
||||
if (success) {
|
||||
printf("Successfully sent the symbol file.\n");
|
||||
} else {
|
||||
if (!success) {
|
||||
printf("Failed to send symbol file: %s\n", error.c_str());
|
||||
printf("Response:\n");
|
||||
printf("%s\n", response.c_str());
|
||||
} else if (response_code == 0) {
|
||||
printf("Failed to send symbol file: No response code\n");
|
||||
} else if (response_code != 200) {
|
||||
printf("Failed to send symbol file: Response code %ld\n", response_code);
|
||||
printf("Response:\n");
|
||||
printf("%s\n", response.c_str());
|
||||
} else {
|
||||
printf("Successfully sent the symbol file.\n");
|
||||
}
|
||||
options->success = success;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue