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

Side by Side Diff: sdk/lib/io/secure_socket.dart

Issue 990893002: Fix error where upgrading a closed socket to secure will hang. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * A high-level class for communicating securely over a TCP socket, using 8 * A high-level class for communicating securely over a TCP socket, using
9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an 9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an
10 * [IOSink] interface, making it ideal for using together with 10 * [IOSink] interface, making it ideal for using together with
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 // create a new one. 551 // create a new one.
552 _socketSubscription = _socket.listen(_eventDispatcher, 552 _socketSubscription = _socket.listen(_eventDispatcher,
553 onError: _reportError, 553 onError: _reportError,
554 onDone: _doneHandler); 554 onDone: _doneHandler);
555 } else { 555 } else {
556 if (_socketSubscription.isPaused) { 556 if (_socketSubscription.isPaused) {
557 _socket.close(); 557 _socket.close();
558 throw new ArgumentError( 558 throw new ArgumentError(
559 "Subscription passed to TLS upgrade is paused"); 559 "Subscription passed to TLS upgrade is paused");
560 } 560 }
561 // If we are upgrading a socket that is already closed for read,
562 // report an error as if we received READ_CLOSED during the handshake.
563 if (_socket._socket.closedReadEventSent) {
564 _eventDispatcher(RawSocketEvent.READ_CLOSED);
565 }
561 _socketSubscription 566 _socketSubscription
562 ..onData(_eventDispatcher) 567 ..onData(_eventDispatcher)
563 ..onError(_reportError) 568 ..onError(_reportError)
564 ..onDone(_doneHandler); 569 ..onDone(_doneHandler);
565 } 570 }
566 try { 571 try {
567 _secureFilter.connect(address.host, 572 _secureFilter.connect(address.host,
568 (address as dynamic)._in_addr, 573 (address as dynamic)._in_addr,
569 port, 574 port,
570 is_server, 575 is_server,
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 /** 1428 /**
1424 * An exception that happens in the handshake phase of establishing 1429 * An exception that happens in the handshake phase of establishing
1425 * a secure network connection, when looking up or verifying a 1430 * a secure network connection, when looking up or verifying a
1426 * certificate. 1431 * certificate.
1427 */ 1432 */
1428 class CertificateException extends TlsException { 1433 class CertificateException extends TlsException {
1429 const CertificateException([String message = "", 1434 const CertificateException([String message = "",
1430 OSError osError = null]) 1435 OSError osError = null])
1431 : super._("CertificateException", message, osError); 1436 : super._("CertificateException", message, osError);
1432 } 1437 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698