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

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

Issue 18500006: dart:io | Pass errors from multithreaded encryption back to Dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Compile libssl_dart without DEBUG defined. Created 7 years, 5 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 | « runtime/bin/secure_socket.cc ('k') | sdk/lib/io/secure_socket.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(address, 6 /* patch */ static Future<RawServerSocket> bind(address,
7 int port, 7 int port,
8 {int backlog: 0, 8 {int backlog: 0,
9 bool v6Only: false}) { 9 bool v6Only: false}) {
10 return _RawServerSocket.bind(address, port, backlog, v6Only); 10 return _RawServerSocket.bind(address, port, backlog, v6Only);
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 if (result is OSError) { 386 if (result is OSError) {
387 reportError(result, "Read failed"); 387 reportError(result, "Read failed");
388 return null; 388 return null;
389 } 389 }
390 return result; 390 return result;
391 } 391 }
392 392
393 int write(List<int> buffer, int offset, int bytes) { 393 int write(List<int> buffer, int offset, int bytes) {
394 if (buffer is! List) throw new ArgumentError(); 394 if (buffer is! List) throw new ArgumentError();
395 if (offset == null) offset = 0; 395 if (offset == null) offset = 0;
396 if (bytes == null) bytes = buffer.length; 396 if (bytes == null) {
397 if (offset > buffer.length) {
398 throw new RangeError.value(offset);
399 }
400 bytes = buffer.length - offset;
401 }
397 if (offset < 0) throw new RangeError.value(offset); 402 if (offset < 0) throw new RangeError.value(offset);
398 if (bytes < 0) throw new RangeError.value(bytes); 403 if (bytes < 0) throw new RangeError.value(bytes);
399 if ((offset + bytes) > buffer.length) { 404 if ((offset + bytes) > buffer.length) {
400 throw new RangeError.value(offset + bytes); 405 throw new RangeError.value(offset + bytes);
401 } 406 }
402 if (offset is! int || bytes is! int) { 407 if (offset is! int || bytes is! int) {
403 throw new ArgumentError("Invalid arguments to write on Socket"); 408 throw new ArgumentError("Invalid arguments to write on Socket");
404 } 409 }
405 if (isClosed) return 0; 410 if (isClosed) return 0;
406 if (bytes == 0) return 0; 411 if (bytes == 0) return 0;
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 if (_detachReady != null) { 1197 if (_detachReady != null) {
1193 _detachReady.complete(null); 1198 _detachReady.complete(null);
1194 } else { 1199 } else {
1195 if (_raw != null) { 1200 if (_raw != null) {
1196 _raw.shutdown(SocketDirection.SEND); 1201 _raw.shutdown(SocketDirection.SEND);
1197 _disableWriteEvent(); 1202 _disableWriteEvent();
1198 } 1203 }
1199 } 1204 }
1200 } 1205 }
1201 } 1206 }
OLDNEW
« no previous file with comments | « runtime/bin/secure_socket.cc ('k') | sdk/lib/io/secure_socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698