OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 } | 318 } |
319 | 319 |
320 // Once fake SSL handshake is finished pass the data to the login handler. | 320 // Once fake SSL handshake is finished pass the data to the login handler. |
321 if (!this.fakeSslHandshake_ && data.byteLength > 0) { | 321 if (!this.fakeSslHandshake_ && data.byteLength > 0) { |
322 this.loginHandler_.onDataReceived(data); | 322 this.loginHandler_.onDataReceived(data); |
323 } | 323 } |
324 } else if (this.state_ == remoting.SignalStrategy.State.CONNECTED) { | 324 } else if (this.state_ == remoting.SignalStrategy.State.CONNECTED) { |
325 this.streamParser_.appendData(readInfo.data); | 325 this.streamParser_.appendData(readInfo.data); |
326 } | 326 } |
327 | 327 |
328 if (!this.startTlsPending_) { | 328 if (!this.startTlsPending_ && |
| 329 this.state_ != remoting.SignalStrategy.State.CLOSED) { |
329 this.tryRead_(); | 330 this.tryRead_(); |
330 } | 331 } |
331 }; | 332 }; |
332 | 333 |
333 /** | 334 /** |
334 * @param {string} text | 335 * @param {string} text |
335 * @private | 336 * @private |
336 */ | 337 */ |
337 remoting.XmppConnection.prototype.sendString_ = function(text) { | 338 remoting.XmppConnection.prototype.sendString_ = function(text) { |
338 this.sendBuffer_(base.encodeUtf8(text)); | 339 this.sendBuffer_(base.encodeUtf8(text)); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 /** | 481 /** |
481 * @param {remoting.SignalStrategy.State} newState | 482 * @param {remoting.SignalStrategy.State} newState |
482 * @private | 483 * @private |
483 */ | 484 */ |
484 remoting.XmppConnection.prototype.setState_ = function(newState) { | 485 remoting.XmppConnection.prototype.setState_ = function(newState) { |
485 if (this.state_ != newState) { | 486 if (this.state_ != newState) { |
486 this.state_ = newState; | 487 this.state_ = newState; |
487 this.onStateChangedCallback_(this.state_); | 488 this.onStateChangedCallback_(this.state_); |
488 } | 489 } |
489 }; | 490 }; |
OLD | NEW |