-
Notifications
You must be signed in to change notification settings - Fork 382
Closed
Labels
package:cupertino_httpIssues related to package:cupertino_httpIssues related to package:cupertino_httptype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
In cupertino_http, cancelling the stream on a StreamedResponse does not close the underlying connection.
final client = CupertinoClient.fromSessionConfiguration(URLSessionConfiguration.ephemeralSessionConfiguration());
final request = Request('GET', Uri.parse('https://cachefly.cachefly.net/100mb.test'));
final streamedResponse = await client.send(request);
final streamSubscription = streamedResponse.stream.listen(null);
await Future.delayed(const Duration(seconds: 5));
await streamSubscription.cancel();
After cancelling the stream subscription, the connection remains open until the full body is received:
In contrast, the standard IOClient closes the connection when the stream subscription is cancelled. Notice the "Timespan":
I opened the same issue for cronet_http here.
Metadata
Metadata
Assignees
Labels
package:cupertino_httpIssues related to package:cupertino_httpIssues related to package:cupertino_httptype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)