Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Read 169mb video file program crash #60

Open
limin1314 opened this issue Oct 30, 2019 · 3 comments
Open

Read 169mb video file program crash #60

limin1314 opened this issue Oct 30, 2019 · 3 comments

Comments

@limin1314
Copy link

No description provided.

@limin1314
Copy link
Author

没有提供描述。

import 'dart:io';
import 'dart:async';
import 'package:http_server/http_server.dart';

void main() {
var staticFiles = new VirtualDirectory('.')
..allowDirectoryListing = true;

runZoned(() {
HttpServer.bind('0.0.0.0', 7777).then((server) {
print('Server running');
server.listen(staticFiles.serveRequest);
});
},
onError: (e, stackTrace) => print('Oh noes! $e $stackTrace'));

Browsing the virtual directory Web page, MP4 video is not displayed, and the program directly crashes

@thosakwe
Copy link
Contributor

thosakwe commented Dec 8, 2019

_VirtualDirectoryFileStream has a buffer property, which is initialized to []. _VirtualDirectoryFileStream.addStream checks if the buffer is null (in which case, it will directly write the buffer to the stream), but since the buffer is never null, files are always buffered, at least as far as I can tell.

Not sure what your stack trace is, though.

@cvbni
Copy link

cvbni commented Feb 20, 2020

I also met, what should I do? .
The same"Browsing the virtual directory Web page"
when i downloaded a very large file ,my app consumed a lot of memory,then crashed directly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants