From 4f5801494d7ea3e8ef0df545404cb45a4a0558b6 Mon Sep 17 00:00:00 2001 From: "jiayl@webrtc.org" Date: Wed, 14 May 2014 20:32:35 +0000 Subject: Drop the DataChannel message if it's received when the channel is not open. It may happen when the JS has closed the channel on the signaling thread while messages are received on the worker thread and posted before the state change is pushed to the worker thread. BUG=crbug/363005 R=mallinath@webrtc.org Review URL: https://webrtc-codereview.appspot.com/19469005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6161 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/app/webrtc/datachannel.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'talk/app/webrtc/datachannel.cc') diff --git a/talk/app/webrtc/datachannel.cc b/talk/app/webrtc/datachannel.cc index 048e89a505..db3e1575e0 100644 --- a/talk/app/webrtc/datachannel.cc +++ b/talk/app/webrtc/datachannel.cc @@ -284,6 +284,10 @@ void DataChannel::OnDataEngineClose() { void DataChannel::OnDataReceived(cricket::DataChannel* channel, const cricket::ReceiveDataParams& params, const talk_base::Buffer& payload) { + if (state_ != kOpen) { + return; + } + uint32 expected_ssrc = (data_channel_type_ == cricket::DCT_RTP) ? receive_ssrc_ : config_.id; if (params.ssrc != expected_ssrc) { -- cgit v1.2.3