Revert "Remove concurrency limit"

This reverts commit f1a4973601.

This iss actually mistakenly added due to incorrect test setup.
This commit is contained in:
klzgrad 2020-10-09 22:01:37 +08:00
parent c773f0ceb1
commit 689f16f0d7
2 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@
#include "net/tools/naive/naive_proxy.h"
#include <algorithm>
#include <utility>
#include "base/bind.h"
@ -34,7 +35,7 @@ NaiveProxy::NaiveProxy(std::unique_ptr<ServerSocket> listen_socket,
const NetworkTrafficAnnotationTag& traffic_annotation)
: listen_socket_(std::move(listen_socket)),
protocol_(protocol),
concurrency_(concurrency),
concurrency_(std::min(4, std::max(1, concurrency))),
resolver_(resolver),
session_(session),
net_log_(

View File

@ -289,7 +289,7 @@ bool ParseCommandLine(const CommandLine& cmdline, Params* params) {
if (!cmdline.concurrency.empty()) {
if (!base::StringToInt(cmdline.concurrency, &params->concurrency) ||
params->concurrency < 1) {
params->concurrency < 1 || params->concurrency > 4) {
std::cerr << "Invalid concurrency" << std::endl;
return false;
}