diff options
author | Jordan Bayles <jophba@chromium.org> | 2020-12-15 14:04:00 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-15 23:37:14 +0000 |
commit | f4d58e1468e4bb79ab5c9374cc4f800859643287 (patch) | |
tree | f6d81a93a8d2cc0c93aa11db338e6d19ab15df16 /cast | |
parent | 4dbefed1b3555883913cac604ac3ee42807ba204 (diff) | |
download | openscreen-f4d58e1468e4bb79ab5c9374cc4f800859643287.tar.gz |
Fix Android senders by accepting 0 sequence number.
This patch updates the libcast receiver to accept 0 as a valid sequence
number.
TBR=miu@chromium.org
Bug: b/175720188
Change-Id: I17ff6f8390b76d22ed39d756ffc2143ac7a039e8
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2594152
Reviewed-by: Jordan Bayles <jophba@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Commit-Queue: Jordan Bayles <jophba@chromium.org>
Diffstat (limited to 'cast')
-rw-r--r-- | cast/protocol/castv2/streaming_examples/offer.json | 2 | ||||
-rw-r--r-- | cast/streaming/receiver_session.cc | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/cast/protocol/castv2/streaming_examples/offer.json b/cast/protocol/castv2/streaming_examples/offer.json index 7b0d1c6e..339b6d15 100644 --- a/cast/protocol/castv2/streaming_examples/offer.json +++ b/cast/protocol/castv2/streaming_examples/offer.json @@ -40,6 +40,6 @@ } ] }, - "seqNum": 820263768, + "seqNum": 0, "type": "OFFER" }
\ No newline at end of file diff --git a/cast/streaming/receiver_session.cc b/cast/streaming/receiver_session.cc index edf685c2..7e4c70d3 100644 --- a/cast/streaming/receiver_session.cc +++ b/cast/streaming/receiver_session.cc @@ -98,8 +98,10 @@ ReceiverSession::~ReceiverSession() { } void ReceiverSession::OnOffer(SenderMessage message) { - // We just drop offers we can't respond to. - if (message.sequence_number <= 0) { + // We just drop offers we can't respond to. Note that libcast senders will + // always send a strictly positive sequence numbers, but zero is permitted + // by the spec. + if (message.sequence_number < 0) { OSP_DLOG_WARN << "Dropping offer with missing sequence number, can't respond"; return; |