aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/mac/sender/uploader.mm15
-rw-r--r--src/common/mac/HTTPMultipartUpload.m5
2 files changed, 14 insertions, 6 deletions
diff --git a/src/client/mac/sender/uploader.mm b/src/client/mac/sender/uploader.mm
index b876b9e2..6d4be2d6 100644
--- a/src/client/mac/sender/uploader.mm
+++ b/src/client/mac/sender/uploader.mm
@@ -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];
}
diff --git a/src/common/mac/HTTPMultipartUpload.m b/src/common/mac/HTTPMultipartUpload.m
index 1316b8e0..4b008f5c 100644
--- a/src/common/mac/HTTPMultipartUpload.m
+++ b/src/common/mac/HTTPMultipartUpload.m
@@ -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"];