]> git.lizzy.rs Git - rust.git/commit
Set uv's custom data before uv_read_start
authorAlex Crichton <alex@alexcrichton.com>
Mon, 25 Nov 2013 05:47:13 +0000 (21:47 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 25 Nov 2013 05:47:13 +0000 (21:47 -0800)
commit6acf227cc8db09ca25d274918f860849c41df19a
treebed69e4989a63e62a74c1c25f01175d08e7057e5
parent01b53817033ba3a3ec01685d30e4a8e7ce14ba0c
Set uv's custom data before uv_read_start

This is a behavioral difference in libuv between different platforms in
different situations. It turns out that libuv on windows will immediately
allocate a buffer instead of waiting for data to be ready. What this implies is
that we must have our custom data set on the handle before we call
uv_read_start.

I wish I knew of a way to test this, but this relies to being on the windows
platform *and* reading from a true TTY handle which only happens when this is
actually attached to a terminal. I have manually verified this works.

Closes #10645
src/librustuv/stream.rs