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

Side by Side Diff: runtime/bin/socket_patch.dart

Issue 12395017: dart:io | Fix a crash when read was called on a closed socket on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove intense test. Created 7 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/io/raw_secure_server_socket_intense_test.dart » ('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 patch class RawServerSocket { 5 patch class RawServerSocket {
6 /* patch */ static Future<RawServerSocket> bind([String address = "127.0.0.1", 6 /* patch */ static Future<RawServerSocket> bind([String address = "127.0.0.1",
7 int port = 0, 7 int port = 0,
8 int backlog = 0]) { 8 int backlog = 0]) {
9 return _RawServerSocket.bind(address, port, backlog); 9 return _RawServerSocket.bind(address, port, backlog);
10 } 10 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return 0; 145 return 0;
146 } else { 146 } else {
147 return result; 147 return result;
148 } 148 }
149 } 149 }
150 150
151 List<int> read(int len) { 151 List<int> read(int len) {
152 if (len != null && len <= 0) { 152 if (len != null && len <= 0) {
153 throw new ArgumentError("Illegal length $len"); 153 throw new ArgumentError("Illegal length $len");
154 } 154 }
155 if (isClosed) return null;
155 var result = nativeRead(len == null ? -1 : len); 156 var result = nativeRead(len == null ? -1 : len);
156 if (result is OSError) { 157 if (result is OSError) {
157 reportError(result, "Read failed"); 158 reportError(result, "Read failed");
158 return null; 159 return null;
159 } 160 }
160 return result; 161 return result;
161 } 162 }
162 163
163 int write(List<int> buffer, int offset, int bytes) { 164 int write(List<int> buffer, int offset, int bytes) {
164 if (buffer is! List) throw new ArgumentError(); 165 if (buffer is! List) throw new ArgumentError();
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 _raw.onBadCertificate = callback; 922 _raw.onBadCertificate = callback;
922 } 923 }
923 924
924 X509Certificate get peerCertificate { 925 X509Certificate get peerCertificate {
925 if (_raw == null) { 926 if (_raw == null) {
926 throw new StateError("peerCertificate called on destroyed SecureSocket"); 927 throw new StateError("peerCertificate called on destroyed SecureSocket");
927 } 928 }
928 return _raw.peerCertificate; 929 return _raw.peerCertificate;
929 } 930 }
930 } 931 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/raw_secure_server_socket_intense_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698