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

Unified Diff: sdk/lib/io/http_impl.dart

Issue 11359101: Use Socket.read instead of Socket.readList in HTTP (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/io/http_server_socket_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index 440b635feaa658de76a6114336d35e374c35bfdb..15a920e674cc9f398394c22a1bb11cf568d87651 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1299,15 +1299,9 @@ abstract class _HttpConnectionBase {
}
void _onData() {
- int available = _socket.available();
- if (available == 0) {
- return;
- }
-
- List<int> buffer = new Uint8List(available);
- int bytesRead = _socket.readList(buffer, 0, available);
- if (bytesRead > 0) {
- _httpParser.writeList(buffer, 0, bytesRead);
+ List<int> buffer = _socket.read();
+ if (buffer != null) {
+ _httpParser.writeList(buffer, 0, buffer.length);
}
}
« no previous file with comments | « no previous file | tests/standalone/io/http_server_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698