diff options
author | blundell@chromium.org <blundell@chromium.org> | 2014-09-01 11:02:57 +0000 |
---|---|---|
committer | blundell@chromium.org <blundell@chromium.org> | 2014-09-01 11:02:57 +0000 |
commit | 1335417f9feefd20e5b0e4b1e18e9010edb87043 (patch) | |
tree | 0296d7d860021ec4d7f6dae5d5a58c259038c4b5 /src/common/mac | |
parent | Support for multiple upload files in CrashReportSender/HTTPUpload (diff) | |
download | breakpad-1335417f9feefd20e5b0e4b1e18e9010edb87043.tar.xz |
Adding possibility for client to upload the file
This CL adds three features that will allow the client to upload the report
file.
Three main modifications are made :
- Allow upload url to have a file:// scheme, and write the HTTP request to file
in that case
- Split the request in two parts in case of a file:// scheme, the request
time and the response time. A new API [handleNetworkResponse] is added.
- Give the opportunity to the client to get the configuration NSDictionary
to be able to recreate the breakpad context at response time.
Patch by Olivier Robin <olivierrobin@chromium.org>
Review URL: https://breakpad.appspot.com/2764002/
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1368 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/mac')
-rw-r--r-- | src/common/mac/HTTPMultipartUpload.m | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/common/mac/HTTPMultipartUpload.m b/src/common/mac/HTTPMultipartUpload.m index 76f38f8a..bd88cffa 100644 --- a/src/common/mac/HTTPMultipartUpload.m +++ b/src/common/mac/HTTPMultipartUpload.m @@ -143,7 +143,7 @@ //============================================================================= - (NSData *)send:(NSError **)error { - NSMutableURLRequest *req = + NSMutableURLRequest *req = [[NSMutableURLRequest alloc] initWithURL:url_ cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0 ]; @@ -190,12 +190,16 @@ [response_ release]; response_ = nil; - - NSData *data = [NSURLConnection sendSynchronousRequest:req - returningResponse:&response_ - error:error]; - [response_ retain]; + NSData *data; + if ([[req URL] isFileURL]) { + [[req HTTPBody] writeToURL:[req URL] options:0 error:error]; + } else { + data = [NSURLConnection sendSynchronousRequest:req + returningResponse:&response_ + error:error]; + [response_ retain]; + } [req release]; return data; |