Ignore empty data in DataChannel::Send to match FF's behavior.

BUG=crbug/395205
R=pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/16949004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6742 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
jiayl@webrtc.org
2014-07-18 23:57:50 +00:00
parent 99f6308a2d
commit 3edbaaf337
3 changed files with 22 additions and 1 deletions

View File

@ -195,6 +195,14 @@ bool DataChannel::Send(const DataBuffer& buffer) {
if (state_ != kOpen) {
return false;
}
// TODO(jiayl): the spec is unclear about if the remote side should get the
// onmessage event. We need to figure out the expected behavior and change the
// code accordingly.
if (buffer.size() == 0) {
return true;
}
// If the queue is non-empty, we're waiting for SignalReadyToSend,
// so just add to the end of the queue and keep waiting.
if (!queued_send_data_.Empty()) {