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

Unified Diff: net/filter/sdch_source_stream.cc

Issue 2446443002: Fix net::SdchSourceStream Passthrough bug (Closed)
Patch Set: mistake made during splitting off change Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/filter/sdch_source_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/filter/sdch_source_stream.cc
diff --git a/net/filter/sdch_source_stream.cc b/net/filter/sdch_source_stream.cc
index 954364e222e575bb9386a73b90500e4baee60997..972841cd47bc3e55052562fd0fcc6a7232d4bef4 100644
--- a/net/filter/sdch_source_stream.cc
+++ b/net/filter/sdch_source_stream.cc
@@ -142,18 +142,19 @@ int SdchSourceStream::FilterData(IOBuffer* output_buffer,
break;
}
case STATE_PASS_THROUGH: {
- if (buffered_output_.empty())
- break;
- int flushed = FlushBufferedOutput(output_buffer->data() + bytes_out,
- output_buffer_size - bytes_out,
- buffered_output_);
- buffered_output_.erase(0, flushed);
- bytes_out += flushed;
+ if (!buffered_output_.empty()) {
+ int flushed = FlushBufferedOutput(output_buffer->data() + bytes_out,
+ output_buffer_size - bytes_out,
+ buffered_output_);
+ buffered_output_.erase(0, flushed);
+ bytes_out += flushed;
+ }
if (!buffered_output_.empty())
break;
size_t to_copy =
std::min(output_buffer_size - bytes_out, input_data_size);
memcpy(output_buffer->data() + bytes_out, input_data, to_copy);
+ bytes_out += to_copy;
input_data += to_copy;
input_data_size -= to_copy;
break;
« no previous file with comments | « no previous file | net/filter/sdch_source_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698