summaryrefslogtreecommitdiffstats
path: root/net/socket_stream
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 10:07:22 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 10:07:22 +0000
commit0920251cc2c173ce824064df8360f9af8dcdfcce (patch)
treeed134e58d17de188cfdf5fbd37912ff381bec532 /net/socket_stream
parent2592daa9bf0c5ed165ea1b648b8a50c94431187c (diff)
downloadchromium_src-0920251cc2c173ce824064df8360f9af8dcdfcce.zip
chromium_src-0920251cc2c173ce824064df8360f9af8dcdfcce.tar.gz
chromium_src-0920251cc2c173ce824064df8360f9af8dcdfcce.tar.bz2
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
Diffstat (limited to 'net/socket_stream')
-rw-r--r--net/socket_stream/socket_stream.cc2
1 files changed, 1 insertions, 1 deletions
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);