Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Issue 2604233002: Fix bug in deflate code. (Closed)

Created:
3 years, 11 months ago by mmenke
Modified:
3 years, 11 months ago
Reviewers:
xunjieli
CC:
chromium-reviews, cbentzel+watch_chromium.org, Randy Smith (Not in Mondays)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix bug in deflate code. For historical reasons, deflate-encoded streams may or may not have zlib headers. In the case zlib headers appear to be missing, we add the headers and then re-send the data we've received to zlib. If we discovered this problem on a read other than the first zlib body read, however, we would only re-send the result of the most recent read, rather than the entire body, resulting in an error. This CL adds some buffering of the body data until we're (somewhat) confident the original stream had a zlib header. Since there's no gaurantee that streams with and without zlib headers are actually distinguishable from each other, this doesn't resolve all potential issues, but should at least fix some cases. BUG=677001 Committed: https://crrev.com/e66c81aea915be21bb56cb458f5efe8703aea78e Cr-Commit-Position: refs/heads/master@{#441197}

Patch Set 1 #

Patch Set 2 : Cleanups #

Total comments: 24

Patch Set 3 : Fix leak #

Total comments: 2

Patch Set 4 : Response to comments #

Patch Set 5 : Missed one #

Total comments: 2

Patch Set 6 : Revert bypassing replay state #

Unified diffs Side-by-side diffs Delta from patch set Stats (+281 lines, -100 lines) Patch
M net/filter/gzip_source_stream.h View 1 2 3 4 chunks +17 lines, -5 lines 0 comments Download
M net/filter/gzip_source_stream.cc View 1 2 3 4 5 8 chunks +90 lines, -21 lines 0 comments Download
M net/filter/gzip_source_stream_unittest.cc View 1 2 3 13 chunks +139 lines, -69 lines 0 comments Download
M net/filter/mock_source_stream.h View 2 chunks +13 lines, -0 lines 0 comments Download
M net/filter/mock_source_stream.cc View 1 2 3 4 2 chunks +22 lines, -5 lines 0 comments Download

Messages

Total messages: 25 (16 generated)
mmenke
[xunjieli]: PTAL. While I'm not too enamored of this approach, other ways to handle mixing ...
3 years, 11 months ago (2016-12-29 22:39:31 UTC) #2
xunjieli
LGTM with nits. Thanks for looking into the deflate hack. I agree that the recursive ...
3 years, 11 months ago (2017-01-03 16:21:18 UTC) #11
mmenke
Thanks for the feedback, great catches! https://codereview.chromium.org/2604233002/diff/20001/net/filter/gzip_source_stream.cc File net/filter/gzip_source_stream.cc (right): https://codereview.chromium.org/2604233002/diff/20001/net/filter/gzip_source_stream.cc#newcode30 net/filter/gzip_source_stream.cc:30: const int kMaxZlibHeaderSniffBytes ...
3 years, 11 months ago (2017-01-03 18:25:42 UTC) #13
xunjieli
https://codereview.chromium.org/2604233002/diff/20001/net/filter/gzip_source_stream.cc File net/filter/gzip_source_stream.cc (right): https://codereview.chromium.org/2604233002/diff/20001/net/filter/gzip_source_stream.cc#newcode30 net/filter/gzip_source_stream.cc:30: const int kMaxZlibHeaderSniffBytes = 1000; On 2017/01/03 18:25:41, mmenke ...
3 years, 11 months ago (2017-01-03 18:52:03 UTC) #15
mmenke
https://codereview.chromium.org/2604233002/diff/80001/net/filter/gzip_source_stream.cc File net/filter/gzip_source_stream.cc (right): https://codereview.chromium.org/2604233002/diff/80001/net/filter/gzip_source_stream.cc#newcode156 net/filter/gzip_source_stream.cc:156: if (!replay_data_.empty()) { On 2017/01/03 18:52:03, xunjieli wrote: > ...
3 years, 11 months ago (2017-01-03 19:06:34 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2604233002/100001
3 years, 11 months ago (2017-01-03 19:07:00 UTC) #19
xunjieli
On 2017/01/03 19:06:34, mmenke wrote: > https://codereview.chromium.org/2604233002/diff/80001/net/filter/gzip_source_stream.cc > File net/filter/gzip_source_stream.cc (right): > > https://codereview.chromium.org/2604233002/diff/80001/net/filter/gzip_source_stream.cc#newcode156 > ...
3 years, 11 months ago (2017-01-03 19:14:50 UTC) #20
commit-bot: I haz the power
Committed patchset #6 (id:100001)
3 years, 11 months ago (2017-01-03 20:08:31 UTC) #23
commit-bot: I haz the power
3 years, 11 months ago (2017-01-03 20:10:24 UTC) #25
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/e66c81aea915be21bb56cb458f5efe8703aea78e
Cr-Commit-Position: refs/heads/master@{#441197}

Powered by Google App Engine
This is Rietveld 408576698