summaryrefslogtreecommitdiffstats
path: root/net/websockets
diff options
context:
space:
mode:
Diffstat (limited to 'net/websockets')
-rw-r--r--net/websockets/websocket_job.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/websockets/websocket_job.cc b/net/websockets/websocket_job.cc
index 72796b1..cbf7592 100644
--- a/net/websockets/websocket_job.cc
+++ b/net/websockets/websocket_job.cc
@@ -212,6 +212,7 @@ void WebSocketJob::OnConnected(
void WebSocketJob::OnSentData(SocketStream* socket, int amount_sent) {
DCHECK_NE(INITIALIZED, state_);
+ DCHECK_GT(amount_sent, 0);
if (state_ == CLOSED)
return;
if (state_ == CONNECTING) {
@@ -220,8 +221,10 @@ void WebSocketJob::OnSentData(SocketStream* socket, int amount_sent) {
}
if (delegate_) {
DCHECK(state_ == OPEN || state_ == CLOSING);
- DCHECK_GT(amount_sent, 0);
- DCHECK(current_buffer_);
+ if (current_buffer_ == NULL) {
+ VLOG(1) << "OnSentData current_buffer=NULL amount_sent=" << amount_sent;
+ return;
+ }
current_buffer_->DidConsume(amount_sent);
if (current_buffer_->BytesRemaining() > 0)
return;