diff options
author | jiayl@webrtc.org <jiayl@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-05-14 20:32:35 +0000 |
---|---|---|
committer | jiayl@webrtc.org <jiayl@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-05-14 20:32:35 +0000 |
commit | 4f5801494d7ea3e8ef0df545404cb45a4a0558b6 (patch) | |
tree | 8233a0cbcedb9e3cd5d2c96a9e52db4a6301c1c5 /talk/app/webrtc/datachannel.cc | |
parent | 372701a8728cad7cffbd59403eb21d76352c1151 (diff) | |
download | webrtc-4f5801494d7ea3e8ef0df545404cb45a4a0558b6.tar.gz |
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
Diffstat (limited to 'talk/app/webrtc/datachannel.cc')
-rw-r--r-- | talk/app/webrtc/datachannel.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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) { |