Permalink
Browse files

options: allow MessageBufferSize and Num(Expensive)RewriteThreads to …

…be 0

These options have documented meanings for 0, but on 2014-06-18 we added a check that they be >0.  Relax that restriction.

Fixes #1109
  • Loading branch information...
jeffkaufman authored and crowell committed Jul 16, 2015
1 parent b2e1bfa commit 16e9f43edf38c74057b3cd45ed96c4040c59d688
Showing with 6 additions and 2 deletions.
  1. +6 −2 net/instaweb/system/system_rewrite_driver_factory.cc
@@ -357,10 +357,14 @@ SystemRewriteDriverFactory::ParseAndSetOption1(StringPiece option,
return parsed_as_bool;
}

// Others take a positive integer.
// Others take an integer >= 0.
//
// Values of 0 have special meanings:
// Num(Expensive)RewriteThreads: autodetect (see AutoDetectThreadCounts())
// MessageBufferSize: disable the message buffer
int int_value = 0;
RewriteOptions::OptionSettingResult parsed_as_int =
(RewriteOptions::ParseFromString(arg, &int_value) && int_value > 0) ?
RewriteOptions::ParseFromString(arg, &int_value) ?
RewriteOptions::kOptionOk : RewriteOptions::kOptionValueInvalid;
if (StringCaseEqual(option, kNumRewriteThreads)) {
set_num_rewrite_threads(int_value);

0 comments on commit 16e9f43

Please sign in to comment.