Index: remoting/protocol/jingle_session.cc |
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc |
index dc77271e587768205feb7d08d36e69ec41fd4f12..ae6917b373ea6b98bd01903d46f0fbe3a6c52bdb 100644 |
--- a/remoting/protocol/jingle_session.cc |
+++ b/remoting/protocol/jingle_session.cc |
@@ -115,6 +115,9 @@ class JingleSession::OrderedMessageQueue { |
const std::string& id, |
PendingMessage&& pending_message); |
+ // Sets the initial ID of the session initiate message. |
+ void setInitialId(const std::string& id); |
Sergey Ulanov
2017/07/05 18:00:14
SetInitialiId() please
kelvinp
2017/07/05 22:29:40
Done.
|
+ |
private: |
// Implements an ordered list by using map with the |sequence_id| as the key, |
// so that |queue_| is always sorted by |sequence_id|. |
@@ -125,6 +128,12 @@ class JingleSession::OrderedMessageQueue { |
DISALLOW_COPY_AND_ASSIGN(OrderedMessageQueue); |
}; |
+void JingleSession::OrderedMessageQueue::setInitialId(const std::string& id) { |
Sergey Ulanov
2017/07/05 18:00:14
Put this after OnIncomingMessage() so the order ma
kelvinp
2017/07/05 22:29:41
Done.
|
+ int current = GetSequentialId(id); |
+ if (current != kInvalid) |
+ next_incoming_ = current + 1; |
+} |
+ |
std::vector<JingleSession::PendingMessage> |
JingleSession::OrderedMessageQueue::OnIncomingMessage( |
const std::string& id, |
@@ -224,6 +233,7 @@ void JingleSession::StartConnection( |
} |
void JingleSession::InitializeIncomingConnection( |
+ const std::string& id, |
Sergey Ulanov
2017/07/05 18:00:14
call it message_id.
kelvinp
2017/07/05 22:29:40
Done.
|
const JingleMessage& initiate_message, |
std::unique_ptr<Authenticator> authenticator) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
@@ -234,6 +244,7 @@ void JingleSession::InitializeIncomingConnection( |
peer_address_ = initiate_message.from; |
authenticator_ = std::move(authenticator); |
session_id_ = initiate_message.sid; |
+ message_queue_->setInitialId(id); |
SetState(ACCEPTING); |