]> git.lizzy.rs Git - rust.git/commit
std: User a smaller stdin buffer on windows
authorAlex Crichton <alex@alexcrichton.com>
Mon, 7 Apr 2014 08:11:31 +0000 (01:11 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 8 Apr 2014 07:03:12 +0000 (00:03 -0700)
commit6ac34926a4f704ecab09167f07b94aa269df5b98
tree030910a0ace61dd622d10f0c27363f16b2a4d783
parent00cbda2d0af81a054ba61bd237f98e033ba7a2fa
std: User a smaller stdin buffer on windows

Apparently windows doesn't like reading from stdin with a large buffer size, and
it also apparently is ok with a smaller buffer size. This changes the reader
returned by stdin() to return an 8k buffered reader for stdin rather than a 64k
buffered reader.

Apparently libuv has run into this before, taking a peek at their code, with a
specific comment in their console code saying that "ReadConsole can't handle big
buffers", which I presume is related to invoking ReadFile as if it were a file
descriptor.

Closes #13304
src/libstd/io/stdio.rs
src/test/run-pass/issue-13304.rs [new file with mode: 0644]