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

Unified Diff: pkg/mime/lib/src/bound_multipart_stream.dart

Issue 934763004: Fix bug in subscription handling in mime package (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/mime/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/mime/lib/src/bound_multipart_stream.dart
diff --git a/pkg/mime/lib/src/bound_multipart_stream.dart b/pkg/mime/lib/src/bound_multipart_stream.dart
index 7d16b965178875c4fc0c175dbdf6817edbff8df0..ab06dabeb74b610cc9ef73cb0cc664b2a282724e 100644
--- a/pkg/mime/lib/src/bound_multipart_stream.dart
+++ b/pkg/mime/lib/src/bound_multipart_stream.dart
@@ -105,7 +105,7 @@ class BoundMultipartStream {
_controller = new StreamController(
sync: true,
onPause: _pauseStream,
- onResume:_resumeStream,
+ onResume: _resumeStream,
onCancel: () {
_controllerState = _CONTROLLER_STATE_CANCELED;
_tryPropagateControllerState();
@@ -203,9 +203,6 @@ class BoundMultipartStream {
boundaryPrefix = _boundaryIndex;
while ((_index < _buffer.length) && _state != _FAIL && _state != _DONE) {
- if (_multipartController != null && _multipartController.isPaused) {
- return;
- }
int byte;
if (_index < 0) {
byte = _boundary[boundaryPrefix + _index];
@@ -315,11 +312,11 @@ class BoundMultipartStream {
_expectByteValue(byte, CharCode.LF);
_multipartController = new StreamController(
sync: true,
+ onListen: () {
+ if (_subscription.isPaused) _subscription.resume();
+ },
onPause: _subscription.pause,
- onResume: () {
- _subscription.resume();
- _parse();
- });
+ onResume: _subscription.resume);
_controller.add(
new _MimeMultipart(_headers, _multipartController.stream));
_headers = null;
« no previous file with comments | « no previous file | pkg/mime/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698