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

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

Issue 16131003: Reapply "Active stream subscriptions". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Patch from sgjesse fixing file descriptor error. Created 7 years, 6 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 | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/mime_multipart_parser.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 part of dart.io; 5 part of dart.io;
6 6
7 // Global constants. 7 // Global constants.
8 class _Const { 8 class _Const {
9 // Bytes for "HTTP". 9 // Bytes for "HTTP".
10 static const HTTP = const [72, 84, 84, 80]; 10 static const HTTP = const [72, 84, 84, 80];
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 _incoming = null; 923 _incoming = null;
924 if (_bodyController != null) { 924 if (_bodyController != null) {
925 _bodyController.close(); 925 _bodyController.close();
926 _bodyController = null; 926 _bodyController = null;
927 } 927 }
928 _bodyPaused = false; 928 _bodyPaused = false;
929 _pauseStateChanged(); 929 _pauseStateChanged();
930 } 930 }
931 931
932 void _pauseStateChanged() { 932 void _pauseStateChanged() {
933 void update(bool pause) {
934 if (pause && !_socketSubscription.isPaused) {
935 _socketSubscription.pause();
936 } else if (!pause && _socketSubscription.isPaused) {
937 _socketSubscription.resume();
938 }
939 }
940
941 if (_incoming != null) { 933 if (_incoming != null) {
942 if (!_bodyPaused && !_parserCalled) { 934 if (!_bodyPaused && !_parserCalled) {
943 _parse(); 935 _parse();
944 } 936 }
945 } else { 937 } else {
946 if (!_paused && !_parserCalled) { 938 if (!_paused && !_parserCalled) {
947 _parse(); 939 _parse();
948 } 940 }
949 } 941 }
950 } 942 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 StreamController<_HttpIncoming> _controller; 985 StreamController<_HttpIncoming> _controller;
994 StreamController<List<int>> _bodyController; 986 StreamController<List<int>> _bodyController;
995 } 987 }
996 988
997 989
998 class HttpParserException implements Exception { 990 class HttpParserException implements Exception {
999 const HttpParserException([String this.message = ""]); 991 const HttpParserException([String this.message = ""]);
1000 String toString() => "HttpParserException: $message"; 992 String toString() => "HttpParserException: $message";
1001 final String message; 993 final String message;
1002 } 994 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/mime_multipart_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698