Bits necessary to send the reports along with the minidumps.

Currently the log file and the minidump are uploaded in two consequent requests,
thus they get different report ids and it's hard to associate them to each
other.
This CL makes the crash uploader send the minidump and the log file together in
a single multipart request, so that they have the same report id and are
accessible from the same landing page.

Patch by Alexander Potapenko <glider@chromium.org>

Review URL: https://breakpad.appspot.com/387003/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@963 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
mark@chromium.org 2012-05-11 14:12:43 +00:00
parent daf16276b4
commit 05d61dfd83
2 changed files with 14 additions and 6 deletions

View file

@ -503,6 +503,11 @@ NSDictionary *readConfigurationData(const char *configFile) {
if (minidumpContents_) {
[upload addFileContents:minidumpContents_ name:@"upload_file_minidump"];
// If there is a log file, upload it together with the minidump.
if (logFileData_) {
[upload addFileContents:logFileData_ name:@"log"];
}
// Send it
NSError *error = nil;
NSData *data = [upload send:&error];
@ -543,12 +548,12 @@ NSDictionary *readConfigurationData(const char *configFile) {
reportID );
}
[result release];
} else {
// Minidump is missing -- upload just the log file.
if (logFileData_) {
[self uploadData:logFileData_ name:@"log"];
}
}
if (logFileData_) {
[self uploadData:logFileData_ name:@"log"];
}
[upload release];
}

View file

@ -67,7 +67,7 @@
NSString *fmt = @"--%@\r\nContent-Disposition: form-data; name=\"%@\"; "
"filename=\"minidump.dmp\"\r\nContent-Type: application/octet-stream\r\n\r\n";
NSString *pre = [NSString stringWithFormat:fmt, boundary_, escaped];
NSString *post = [NSString stringWithFormat:@"\r\n--%@--\r\n", boundary_];
NSString *post = [NSString stringWithFormat:@"\r\n--%@\r\n", boundary_];
[data appendData:[pre dataUsingEncoding:NSUTF8StringEncoding]];
[data appendData:contents];
@ -182,6 +182,9 @@
[postBody appendData:fileData];
}
NSString *epilogue = [NSString stringWithFormat:@"\r\n--%@--\r\n", boundary_];
[postBody appendData:[epilogue dataUsingEncoding:NSUTF8StringEncoding]];
[req setHTTPBody:postBody];
[req setHTTPMethod:@"POST"];