[go: nahoru, domu]

Speed up sanitizing headers received from HTTP proxies.

The old code repeatedly re-parsed headers for each header
to be retained, which is a very CPU intensive operation.
In practice, this shouldn't have mattered much. At worst, a
malicious proxy or MitM could DoS the CPU.

This code removes all the redundant parsing, and just removes
all the old headers in a single pass, at the cost of a bit more
code, and worse performance in the average case.  In the extreme
case the fuzzer detected, the new code is about 1,000 times
faster.

BUG=666878

Review-Url: https://codereview.chromium.org/2643023003
Cr-Commit-Position: refs/heads/master@{#445432}
4 files changed