http_server icon indicating copy to clipboard operation
http_server copied to clipboard

Read 169mb video file program crash

Open limin1314 opened this issue 6 years ago • 3 comments

limin1314 avatar Oct 30 '19 09:10 limin1314

没有提供描述。

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

limin1314 avatar Oct 30 '19 09:10 limin1314

_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.

thosakwe avatar Dec 08 '19 17:12 thosakwe

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

cvbni avatar Feb 20 '20 19:02 cvbni