diff options
author | stuart.morgan <stuart.morgan@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-04-29 13:27:16 +0000 |
---|---|---|
committer | stuart.morgan <stuart.morgan@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-04-29 13:27:16 +0000 |
commit | 73afbc7302a8ee869f3fd777790d9f61f018092d (patch) | |
tree | 6ca43ffdcd5a6b393b5524f779ad3a1262e066e8 /src/client | |
parent | Code review issue 9002: Add paranoid logging to Inspector & Reporter (diff) | |
download | breakpad-73afbc7302a8ee869f3fd777790d9f61f018092d.tar.xz |
Mac framework fixes: Propagate server type from plist, and fix precedence of defaults vs. plist
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@334 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/mac/Framework/Breakpad.mm | 15 | ||||
-rw-r--r-- | src/client/mac/sender/crash_report_sender.m | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/client/mac/Framework/Breakpad.mm b/src/client/mac/Framework/Breakpad.mm index 22785c3c..0635e189 100644 --- a/src/client/mac/Framework/Breakpad.mm +++ b/src/client/mac/Framework/Breakpad.mm @@ -388,6 +388,10 @@ Breakpad::~Breakpad() { //============================================================================= bool Breakpad::ExtractParameters(NSDictionary *parameters) { NSUserDefaults *stdDefaults = [NSUserDefaults standardUserDefaults]; + NSString *skipConfirm = [stdDefaults stringForKey:@BREAKPAD_SKIP_CONFIRM]; + NSString *sendAndExit = [stdDefaults stringForKey:@BREAKPAD_SEND_AND_EXIT]; + + NSString *serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE]; NSString *display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY]; NSString *product = [parameters objectForKey:@BREAKPAD_PRODUCT]; NSString *version = [parameters objectForKey:@BREAKPAD_VERSION]; @@ -397,9 +401,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION]; NSString *reporterPathString = [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION]; - NSString *skipConfirm = [parameters objectForKey:@BREAKPAD_SKIP_CONFIRM]; NSString *timeout = [parameters objectForKey:@BREAKPAD_CONFIRM_TIMEOUT]; - NSString *sendAndExit = [parameters objectForKey:@BREAKPAD_SEND_AND_EXIT]; NSArray *logFilePaths = [parameters objectForKey:@BREAKPAD_LOGFILES]; NSString *logFileTailSize = [parameters objectForKey:@BREAKPAD_LOGFILE_UPLOAD_SIZE]; NSString *reportEmail = [parameters objectForKey:@BREAKPAD_EMAIL]; @@ -411,14 +413,12 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { [parameters objectForKey:@BREAKPAD_DUMP_DIRECTORY]; NSString *buildId = [parameters objectForKey:@BREAKPAD_BUILD_ID]; - - // If these two are not already set(skipConfirm and sendAndExit can - // come from user defaults and take priority) + // These may have been set above as user prefs, which take priority. if (!skipConfirm) { - skipConfirm = [stdDefaults stringForKey:@BREAKPAD_SKIP_CONFIRM]; + skipConfirm = [parameters objectForKey:@BREAKPAD_SKIP_CONFIRM]; } if (!sendAndExit) { - sendAndExit = [stdDefaults stringForKey:@BREAKPAD_SEND_AND_EXIT]; + sendAndExit = [parameters objectForKey:@BREAKPAD_SEND_AND_EXIT]; } if (!product) @@ -533,6 +533,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { SimpleStringDictionary &dictionary = *config_params_; + dictionary.SetKeyValue(BREAKPAD_SERVER_TYPE, [serverType UTF8String]); dictionary.SetKeyValue(BREAKPAD_PRODUCT_DISPLAY, [display UTF8String]); dictionary.SetKeyValue(BREAKPAD_PRODUCT, [product UTF8String]); dictionary.SetKeyValue(BREAKPAD_VERSION, [version UTF8String]); diff --git a/src/client/mac/sender/crash_report_sender.m b/src/client/mac/sender/crash_report_sender.m index cb0abb80..ebf31c20 100644 --- a/src/client/mac/sender/crash_report_sender.m +++ b/src/client/mac/sender/crash_report_sender.m @@ -627,7 +627,7 @@ doCommandBySelector:(SEL)commandSelector { } - (NSDictionary *)dictionaryForServerType:(NSString *)serverType { - if (serverType == nil) { + if (serverType == nil || [serverType length] == 0) { return [serverDictionary_ objectForKey:kDefaultServerType]; } return [serverDictionary_ objectForKey:serverType]; |