From 0920251cc2c173ce824064df8360f9af8dcdfcce Mon Sep 17 00:00:00 2001 From: "ukai@chromium.org" Date: Tue, 20 Sep 2011 10:07:22 +0000 Subject: Fix crash bug at net::WebSocketJob::OnSentData. According to crash dump, I suspect it is crashed at current_buffer_->DidConsume() where current_buffer_ is NULL. If current_buffer_ is NULL, WebSocketJob doesn't think there are writing data and nothing to do, so this CL changes to just return from net::WebSocketJob::OnSentData in this case. Also checks if amount_sent is negative or zero and return if it is so. BUG=91591 TEST=none Review URL: http://codereview.chromium.org/7923004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101942 0039d316-1c4b-4281-b951-d872f2087c98 --- net/socket_stream/socket_stream.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/socket_stream/socket_stream.cc') diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc index 159779a..8ea686a 100644 --- a/net/socket_stream/socket_stream.cc +++ b/net/socket_stream/socket_stream.cc @@ -418,7 +418,7 @@ void SocketStream::OnReadCompleted(int result) { } void SocketStream::OnWriteCompleted(int result) { - if (result >= 0 && write_buf_) { + if (result > 0 && write_buf_) { result = DidSendData(result); } DoLoop(result); -- cgit v1.1