Index: handler/handler_main.cc |
diff --git a/handler/handler_main.cc b/handler/handler_main.cc |
index 19d0da7a8fb68726bc262a3292d07e1330bee974..f9716d4be0ac50632b298e212b05340628e2ad35 100644 |
--- a/handler/handler_main.cc |
+++ b/handler/handler_main.cc |
@@ -82,6 +82,7 @@ void Usage(const base::FilePath& me) { |
#endif // OS_MACOSX |
" --url=URL send crash reports to this Breakpad server URL,\n" |
" only if uploads are enabled for the database\n" |
+" --no-rate-limit don't rate limit crash uploads\n" |
Mark Mentovai
2016/01/06 15:52:41
Same here (although it means more stupid #ifdefs).
scottmg
2016/01/06 17:48:11
Done.
|
" --help display this help and exit\n" |
" --version output version information and exit\n", |
me.value().c_str()); |
@@ -134,6 +135,7 @@ int HandlerMain(int argc, char* argv[]) { |
kOptionPipeName, |
#endif // OS_MACOSX |
kOptionURL, |
+ kOptionNoRateLimit, |
Mark Mentovai
2016/01/06 15:52:41
and this and the option struct and the switch bloc
scottmg
2016/01/06 17:48:11
Done. Yuck.
|
// Standard options. |
kOptionHelp = -2, |
@@ -152,12 +154,14 @@ int HandlerMain(int argc, char* argv[]) { |
HANDLE handshake_handle; |
std::string pipe_name; |
#endif // OS_MACOSX |
+ bool rate_limit; |
} options = {}; |
#if defined(OS_MACOSX) |
options.handshake_fd = -1; |
#elif defined(OS_WIN) |
options.handshake_handle = INVALID_HANDLE_VALUE; |
#endif |
+ options.rate_limit = true; |
const option long_options[] = { |
{"annotation", required_argument, nullptr, kOptionAnnotation}, |
@@ -174,6 +178,7 @@ int HandlerMain(int argc, char* argv[]) { |
{"pipe-name", required_argument, nullptr, kOptionPipeName}, |
#endif // OS_MACOSX |
{"url", required_argument, nullptr, kOptionURL}, |
+ {"no-rate-limit", no_argument, nullptr, kOptionNoRateLimit}, |
{"help", no_argument, nullptr, kOptionHelp}, |
{"version", no_argument, nullptr, kOptionVersion}, |
{nullptr, 0, nullptr, 0}, |
@@ -240,6 +245,10 @@ int HandlerMain(int argc, char* argv[]) { |
options.url = optarg; |
break; |
} |
+ case kOptionNoRateLimit: { |
+ options.rate_limit = false; |
+ break; |
+ } |
case kOptionHelp: { |
Usage(me); |
return EXIT_SUCCESS; |
@@ -371,7 +380,8 @@ int HandlerMain(int argc, char* argv[]) { |
return EXIT_FAILURE; |
} |
- CrashReportUploadThread upload_thread(database.get(), options.url); |
+ CrashReportUploadThread upload_thread( |
+ database.get(), options.url, options.rate_limit); |
upload_thread.Start(); |
PruneCrashReportThread prune_thread(database.get(), |