Skip to content

Commit a7f5fc3

Browse files
committed
---
yaml --- r: 82907 b: refs/heads/auto c: a402fb2 h: refs/heads/master i: 82905: c4f6e16 82903: 9df5758 v: v3
1 parent 7386f15 commit a7f5fc3

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: c5295f9c4713e77dbb8dfc76bc91e10fceaabbb2
16+
refs/heads/auto: a402fb27faabbe33f03d461d6684af4501db5ac4
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libstd/rt/uv/net.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rt::uv::uvll;
1414
use rt::uv::uvll::*;
1515
use rt::uv::{AllocCallback, ConnectionCallback, ReadCallback, UdpReceiveCallback, UdpSendCallback};
1616
use rt::uv::{Loop, Watcher, Request, UvError, Buf, NativeHandle, NullCallback,
17-
status_to_maybe_uv_error};
17+
status_to_maybe_uv_error, vec_to_uv_buf};
1818
use rt::io::net::ip::{SocketAddr, Ipv4Addr, Ipv6Addr};
1919
use vec;
2020
use str;
@@ -147,7 +147,18 @@ impl StreamWatcher {
147147
data.read_cb = Some(cb);
148148
}
149149

150-
unsafe { uvll::read_start(self.native_handle(), alloc_cb, read_cb); }
150+
let ret = unsafe { uvll::read_start(self.native_handle(), alloc_cb, read_cb) };
151+
152+
if ret != 0 {
153+
// uvll::read_start failed, so read_cb will not be called.
154+
// Call it manually for scheduling.
155+
call_read_cb(self.native_handle(), ret as ssize_t);
156+
}
157+
158+
fn call_read_cb(stream: *uvll::uv_stream_t, errno: ssize_t) {
159+
#[fixed_stack_segment]; #[inline(never)];
160+
read_cb(stream, errno, vec_to_uv_buf(~[]));
161+
}
151162

152163
extern fn alloc_cb(stream: *uvll::uv_stream_t, suggested_size: size_t) -> Buf {
153164
let mut stream_watcher: StreamWatcher = NativeHandle::from_native_handle(stream);

0 commit comments

Comments
 (0)