diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 18:51:34 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 18:51:34 +0000 |
commit | 776e175577badb594cc9023f56b16480546c94ea (patch) | |
tree | d4159651d2165dd6bbfbdae51faa4ac77404f870 /net/websockets | |
parent | 62cf690a77564be902cf481803a9a7e3d52f7c55 (diff) | |
download | chromium_src-776e175577badb594cc9023f56b16480546c94ea.zip chromium_src-776e175577badb594cc9023f56b16480546c94ea.tar.gz chromium_src-776e175577badb594cc9023f56b16480546c94ea.tar.bz2 |
After further discussion, do not try to handle memory errors, but make assertions about allocation parameters stronger.
BUG=25826
TEST=none
Review URL: http://codereview.chromium.org/378037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets')
-rw-r--r-- | net/websockets/websocket_throttle.cc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/net/websockets/websocket_throttle.cc b/net/websockets/websocket_throttle.cc index 49bd923..db41248 100644 --- a/net/websockets/websocket_throttle.cc +++ b/net/websockets/websocket_throttle.cc @@ -85,16 +85,8 @@ class WebSocketThrottle::WebSocketState : public SocketStream::UserData { } buffer_ = new GrowableIOBuffer(); buffer_->SetCapacity(kBufferSize); - } else { - if (buffer_->RemainingCapacity() < len) { - if (!buffer_->SetCapacity(buffer_->capacity() + kBufferSize)) { - // TODO(ukai): Check more correctly. - // Seek to the last CR or LF and reduce memory usage. - LOG(ERROR) << "Too large headers? capacity=" << buffer_->capacity(); - handshake_finished_ = true; - return OK; - } - } + } else if (buffer_->RemainingCapacity() < len) { + buffer_->SetCapacity(buffer_->capacity() + kBufferSize); } memcpy(buffer_->data(), data, len); buffer_->set_offset(buffer_->offset() + len); |