Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 16e9f43

Browse files
jeffkaufmancrowell
authored andcommitted
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
1 parent b2e1bfa commit 16e9f43

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

net/instaweb/system/system_rewrite_driver_factory.cc

+6-2
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,14 @@ SystemRewriteDriverFactory::ParseAndSetOption1(StringPiece option,
357357
return parsed_as_bool;
358358
}
359359

360-
// Others take a positive integer.
360+
// Others take an integer >= 0.
361+
//
362+
// Values of 0 have special meanings:
363+
// Num(Expensive)RewriteThreads: autodetect (see AutoDetectThreadCounts())
364+
// MessageBufferSize: disable the message buffer
361365
int int_value = 0;
362366
RewriteOptions::OptionSettingResult parsed_as_int =
363-
(RewriteOptions::ParseFromString(arg, &int_value) && int_value > 0) ?
367+
RewriteOptions::ParseFromString(arg, &int_value) ?
364368
RewriteOptions::kOptionOk : RewriteOptions::kOptionValueInvalid;
365369
if (StringCaseEqual(option, kNumRewriteThreads)) {
366370
set_num_rewrite_threads(int_value);

0 commit comments

Comments
 (0)