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

Side by Side Diff: lib/src/streams/stream_handler.dart

Issue 1578753002: Try to send EndStreamFlag together with headers (if possible) (Closed) Base URL: git@github.com:dart-lang/http2.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | test/client_websites_test.dart » ('j') | test/client_websites_test.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library http2.src.stream_handler; 5 library http2.src.stream_handler;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:math'; 8 import 'dart:math';
9 9
10 import '../../transport.dart'; 10 import '../../transport.dart';
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 bool _isPeerInitiatedStream(int streamId) { 191 bool _isPeerInitiatedStream(int streamId) {
192 bool isServerStreamId = streamId.isEven; 192 bool isServerStreamId = streamId.isEven;
193 bool isLocalStream = isServerStreamId == isServer; 193 bool isLocalStream = isServerStreamId == isServer;
194 return !isLocalStream; 194 return !isLocalStream;
195 } 195 }
196 196
197 TransportStream newStream(List<Header> headers, {bool endStream: false}) { 197 TransportStream newStream(List<Header> headers, {bool endStream: false}) {
198 return ensureNotTerminatedSync(() { 198 return ensureNotTerminatedSync(() {
199 var stream = newLocalStream(); 199 var stream = newLocalStream();
200 _sendHeaders(stream, headers); 200 _sendHeaders(stream, headers, endStream: endStream);
201 if (endStream) {
202 _handleOutgoingClose(stream);
203 }
204 return stream; 201 return stream;
205 }); 202 });
206 } 203 }
207 204
208 TransportStream newLocalStream() { 205 TransportStream newLocalStream() {
209 return ensureNotTerminatedSync(() { 206 return ensureNotTerminatedSync(() {
210 assert(_canCreateNewStream()); 207 assert(_canCreateNewStream());
211 208
212 if (MAX_STREAM_ID < nextStreamId) { 209 if (MAX_STREAM_ID < nextStreamId) {
213 throw new StateError( 210 throw new StateError(
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 } 791 }
795 stream.state = to; 792 stream.state = to;
796 } 793 }
797 794
798 bool _didInitiateStream(Http2StreamImpl stream) { 795 bool _didInitiateStream(Http2StreamImpl stream) {
799 int id = stream.id; 796 int id = stream.id;
800 return (isServer && id.isEven) || (!isServer && id.isOdd); 797 return (isServer && id.isEven) || (!isServer && id.isOdd);
801 } 798 }
802 } 799 }
803 800
OLDNEW
« no previous file with comments | « no previous file | test/client_websites_test.dart » ('j') | test/client_websites_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698