Revert r6161 "Drop the DataChannel message if it's received when the channel is not open."
The spec does not say the DataChannel has to be open to receive a message. TBR=pthatcher@google.com BUG=crbug/363005 Review URL: https://webrtc-codereview.appspot.com/16569004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6264 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
f15c14be22
commit
b364016cbb
@ -284,10 +284,6 @@ 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) {
|
||||
|
@ -302,16 +302,3 @@ TEST_F(SctpDataChannelTest, OpenAckRoleInitialization) {
|
||||
webrtc::InternalDataChannelInit init2(base);
|
||||
EXPECT_EQ(webrtc::InternalDataChannelInit::kNone, init2.open_handshake_role);
|
||||
}
|
||||
|
||||
// Tests that message is dropped if the channel is not open.
|
||||
TEST_F(SctpDataChannelTest, ReceivedDataDroppedIfNotOpen) {
|
||||
AddObserver();
|
||||
EXPECT_CALL(*(observer_.get()), OnMessage(testing::_)).Times(0);
|
||||
|
||||
webrtc_data_channel_->SetSctpSid(1);
|
||||
|
||||
cricket::ReceiveDataParams params;
|
||||
params.ssrc = 1;
|
||||
webrtc::DataBuffer buffer("abcd");
|
||||
webrtc_data_channel_->OnDataReceived(NULL, params, buffer.data);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user