OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/jingle_session.h" | 5 #include "remoting/protocol/jingle_session.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <memory> | 10 #include <memory> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 ErrorCode AuthRejectionReasonToErrorCode( | 60 ErrorCode AuthRejectionReasonToErrorCode( |
61 Authenticator::RejectionReason reason) { | 61 Authenticator::RejectionReason reason) { |
62 switch (reason) { | 62 switch (reason) { |
63 case Authenticator::INVALID_CREDENTIALS: | 63 case Authenticator::INVALID_CREDENTIALS: |
64 return AUTHENTICATION_FAILED; | 64 return AUTHENTICATION_FAILED; |
65 case Authenticator::PROTOCOL_ERROR: | 65 case Authenticator::PROTOCOL_ERROR: |
66 return INCOMPATIBLE_PROTOCOL; | 66 return INCOMPATIBLE_PROTOCOL; |
67 case Authenticator::INVALID_ACCOUNT: | 67 case Authenticator::INVALID_ACCOUNT: |
68 return INVALID_ACCOUNT; | 68 return INVALID_ACCOUNT; |
| 69 case Authenticator::TOO_MANY_CONNECTIONS: |
| 70 return SESSION_REJECTED; |
69 case Authenticator::REJECTED_BY_USER: | 71 case Authenticator::REJECTED_BY_USER: |
70 return SESSION_REJECTED; | 72 return SESSION_REJECTED; |
71 } | 73 } |
72 NOTREACHED(); | 74 NOTREACHED(); |
73 return UNKNOWN_ERROR; | 75 return UNKNOWN_ERROR; |
74 } | 76 } |
75 | 77 |
76 // Extracts a sequential id from the id attribute of the IQ stanza. | 78 // Extracts a sequential id from the id attribute of the IQ stanza. |
77 int GetSequentialId(const std::string& id) { | 79 int GetSequentialId(const std::string& id) { |
78 std::vector<std::string> tokens = | 80 std::vector<std::string> tokens = |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 authenticator_->GetNextMessage())); | 798 authenticator_->GetNextMessage())); |
797 SendMessage(std::move(message)); | 799 SendMessage(std::move(message)); |
798 } | 800 } |
799 | 801 |
800 std::string JingleSession::GetNextOutgoingId() { | 802 std::string JingleSession::GetNextOutgoingId() { |
801 return outgoing_id_prefix_ + "_" + base::IntToString(++next_outgoing_id_); | 803 return outgoing_id_prefix_ + "_" + base::IntToString(++next_outgoing_id_); |
802 } | 804 } |
803 | 805 |
804 } // namespace protocol | 806 } // namespace protocol |
805 } // namespace remoting | 807 } // namespace remoting |
OLD | NEW |