Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
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 28, 2015
1 parent b2e1bfa commit 16e9f43
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions net/instaweb/system/system_rewrite_driver_factory.cc
Expand Up @@ -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);
Expand Down

0 comments on commit 16e9f43

Please sign in to comment.