Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: remoting/protocol/jingle_session.cc

Issue 1987163002: Add DOMAIN_MISMATCH message end to end (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep the order of ChromotingEvent list Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 10 #include <utility>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // Timeout for the transport-info messages. 47 // Timeout for the transport-info messages.
48 const int kTransportInfoTimeout = 10 * 60; 48 const int kTransportInfoTimeout = 10 * 60;
49 49
50 ErrorCode AuthRejectionReasonToErrorCode( 50 ErrorCode AuthRejectionReasonToErrorCode(
51 Authenticator::RejectionReason reason) { 51 Authenticator::RejectionReason reason) {
52 switch (reason) { 52 switch (reason) {
53 case Authenticator::INVALID_CREDENTIALS: 53 case Authenticator::INVALID_CREDENTIALS:
54 return AUTHENTICATION_FAILED; 54 return AUTHENTICATION_FAILED;
55 case Authenticator::PROTOCOL_ERROR: 55 case Authenticator::PROTOCOL_ERROR:
56 return INCOMPATIBLE_PROTOCOL; 56 return INCOMPATIBLE_PROTOCOL;
57 case Authenticator::DOMAIN_MISMATCH:
58 return DOMAIN_MISMATCH;
57 } 59 }
58 NOTREACHED(); 60 NOTREACHED();
59 return UNKNOWN_ERROR; 61 return UNKNOWN_ERROR;
60 } 62 }
61 63
62 } // namespace 64 } // namespace
63 65
64 JingleSession::JingleSession(JingleSessionManager* session_manager) 66 JingleSession::JingleSession(JingleSessionManager* session_manager)
65 : session_manager_(session_manager), 67 : session_manager_(session_manager),
66 event_handler_(nullptr), 68 event_handler_(nullptr),
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // Send session-terminate message with the appropriate error code. 240 // Send session-terminate message with the appropriate error code.
239 JingleMessage::Reason reason; 241 JingleMessage::Reason reason;
240 switch (error) { 242 switch (error) {
241 case OK: 243 case OK:
242 reason = JingleMessage::SUCCESS; 244 reason = JingleMessage::SUCCESS;
243 break; 245 break;
244 case SESSION_REJECTED: 246 case SESSION_REJECTED:
245 case AUTHENTICATION_FAILED: 247 case AUTHENTICATION_FAILED:
246 reason = JingleMessage::DECLINE; 248 reason = JingleMessage::DECLINE;
247 break; 249 break;
250 case DOMAIN_MISMATCH:
251 reason = JingleMessage::DOMAIN_MISMATCH;
252 break;
248 case INCOMPATIBLE_PROTOCOL: 253 case INCOMPATIBLE_PROTOCOL:
249 reason = JingleMessage::INCOMPATIBLE_PARAMETERS; 254 reason = JingleMessage::INCOMPATIBLE_PARAMETERS;
250 break; 255 break;
251 case HOST_OVERLOAD: 256 case HOST_OVERLOAD:
252 reason = JingleMessage::CANCEL; 257 reason = JingleMessage::CANCEL;
253 break; 258 break;
254 case MAX_SESSION_LENGTH: 259 case MAX_SESSION_LENGTH:
255 reason = JingleMessage::EXPIRED; 260 reason = JingleMessage::EXPIRED;
256 break; 261 break;
257 case HOST_CONFIGURATION_ERROR: 262 case HOST_CONFIGURATION_ERROR:
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 case JingleMessage::SUCCESS: 482 case JingleMessage::SUCCESS:
478 if (state_ == CONNECTING) { 483 if (state_ == CONNECTING) {
479 error_ = SESSION_REJECTED; 484 error_ = SESSION_REJECTED;
480 } else { 485 } else {
481 error_ = OK; 486 error_ = OK;
482 } 487 }
483 break; 488 break;
484 case JingleMessage::DECLINE: 489 case JingleMessage::DECLINE:
485 error_ = AUTHENTICATION_FAILED; 490 error_ = AUTHENTICATION_FAILED;
486 break; 491 break;
492 case JingleMessage::DOMAIN_MISMATCH:
493 error_ = DOMAIN_MISMATCH;
494 break;
487 case JingleMessage::CANCEL: 495 case JingleMessage::CANCEL:
488 error_ = HOST_OVERLOAD; 496 error_ = HOST_OVERLOAD;
489 break; 497 break;
490 case JingleMessage::EXPIRED: 498 case JingleMessage::EXPIRED:
491 error_ = MAX_SESSION_LENGTH; 499 error_ = MAX_SESSION_LENGTH;
492 break; 500 break;
493 case JingleMessage::INCOMPATIBLE_PARAMETERS: 501 case JingleMessage::INCOMPATIBLE_PARAMETERS:
494 error_ = INCOMPATIBLE_PROTOCOL; 502 error_ = INCOMPATIBLE_PROTOCOL;
495 break; 503 break;
496 case JingleMessage::FAILED_APPLICATION: 504 case JingleMessage::FAILED_APPLICATION:
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 } 597 }
590 } 598 }
591 599
592 bool JingleSession::is_session_active() { 600 bool JingleSession::is_session_active() {
593 return state_ == CONNECTING || state_ == ACCEPTING || state_ == ACCEPTED || 601 return state_ == CONNECTING || state_ == ACCEPTING || state_ == ACCEPTED ||
594 state_ == AUTHENTICATING || state_ == AUTHENTICATED; 602 state_ == AUTHENTICATING || state_ == AUTHENTICATED;
595 } 603 }
596 604
597 } // namespace protocol 605 } // namespace protocol
598 } // namespace remoting 606 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698