| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "blimp/net/compressed_packet_reader.h" | 5 #include "blimp/net/compressed_packet_reader.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 decompressed->RemainingCapacity() - zlib_stream_.avail_out; | 86 decompressed->RemainingCapacity() - zlib_stream_.avail_out; |
| 87 | 87 |
| 88 // Verify that the decompressed output isn't bigger than the maximum allowable | 88 // Verify that the decompressed output isn't bigger than the maximum allowable |
| 89 // payload size, by checking if there are bytes waiting to be processed. | 89 // payload size, by checking if there are bytes waiting to be processed. |
| 90 if (zlib_stream_.avail_in > 0) { | 90 if (zlib_stream_.avail_in > 0) { |
| 91 DLOG(ERROR) | 91 DLOG(ERROR) |
| 92 << "Decompressed buffer size exceeds allowable limits; aborting."; | 92 << "Decompressed buffer size exceeds allowable limits; aborting."; |
| 93 return net::ERR_FILE_TOO_BIG; | 93 return net::ERR_FILE_TOO_BIG; |
| 94 } | 94 } |
| 95 | 95 |
| 96 if (connection_details_) { |
| 97 connection_details_->OnPacketReceived(size); |
| 98 } |
| 96 return decompressed_size; | 99 return decompressed_size; |
| 97 } | 100 } |
| 98 | 101 |
| 99 } // namespace blimp | 102 } // namespace blimp |
| OLD | NEW |