diff options
| author | bors <bors@rust-lang.org> | 2013-10-28 05:36:31 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-28 05:36:31 -0700 |
| commit | 672edb21d9d422486230fe7dcba60100bc077c4c (patch) | |
| tree | 425c1ed29dea8cdde64ed66cd089f25331a0d9f7 /src/libstd | |
| parent | de3d36a763a09032a68aa9d47071840c8b4dd5a7 (diff) | |
| parent | 651f5db4623526d416458e9f77632e7dd72f96a8 (diff) | |
| download | rust-672edb21d9d422486230fe7dcba60100bc077c4c.tar.gz rust-672edb21d9d422486230fe7dcba60100bc077c4c.zip | |
auto merge of #10093 : alexcrichton/rust/issue-8811, r=pcwalton
Closes #8811
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/rt/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/io/net/tcp.rs | 16 | ||||
| -rw-r--r-- | src/libstd/rt/uv/mod.rs | 1 | ||||
| -rw-r--r-- | src/libstd/rt/uv/uvll.rs | 2 |
4 files changed, 15 insertions, 6 deletions
diff --git a/src/libstd/rt/io/mod.rs b/src/libstd/rt/io/mod.rs index decf801d592..dc69c8486da 100644 --- a/src/libstd/rt/io/mod.rs +++ b/src/libstd/rt/io/mod.rs @@ -368,6 +368,7 @@ pub enum IoErrorKind { Closed, ConnectionRefused, ConnectionReset, + ConnectionAborted, NotConnected, BrokenPipe, PathAlreadyExists, @@ -397,6 +398,7 @@ impl ToStr for IoErrorKind { MismatchedFileTypeForOperation => ~"MismatchedFileTypeForOperation", IoUnavailable => ~"IoUnavailable", ResourceUnavailable => ~"ResourceUnavailable", + ConnectionAborted => ~"ConnectionAborted", } } } diff --git a/src/libstd/rt/io/net/tcp.rs b/src/libstd/rt/io/net/tcp.rs index 4e841b36a5d..6314c0755a0 100644 --- a/src/libstd/rt/io/net/tcp.rs +++ b/src/libstd/rt/io/net/tcp.rs @@ -364,7 +364,6 @@ mod test { } #[test] - #[ignore(cfg(windows))] // FIXME #8811 fn write_close_ip4() { do run_in_mt_newsched_task { let addr = next_test_ip4(); @@ -380,8 +379,11 @@ mod test { loop { let mut stop = false; do io_error::cond.trap(|e| { - // NB: ECONNRESET on linux, EPIPE on mac - assert!(e.kind == ConnectionReset || e.kind == BrokenPipe); + // NB: ECONNRESET on linux, EPIPE on mac, ECONNABORTED + // on windows + assert!(e.kind == ConnectionReset || + e.kind == BrokenPipe || + e.kind == ConnectionAborted); stop = true; }).inside { stream.write(buf); @@ -399,7 +401,6 @@ mod test { } #[test] - #[ignore(cfg(windows))] // FIXME #8811 fn write_close_ip6() { do run_in_mt_newsched_task { let addr = next_test_ip6(); @@ -415,8 +416,11 @@ mod test { loop { let mut stop = false; do io_error::cond.trap(|e| { - // NB: ECONNRESET on linux, EPIPE on mac - assert!(e.kind == ConnectionReset || e.kind == BrokenPipe); + // NB: ECONNRESET on linux, EPIPE on mac, ECONNABORTED + // on windows + assert!(e.kind == ConnectionReset || + e.kind == BrokenPipe || + e.kind == ConnectionAborted); stop = true; }).inside { stream.write(buf); diff --git a/src/libstd/rt/uv/mod.rs b/src/libstd/rt/uv/mod.rs index c92a54425bf..b611c6a5c5d 100644 --- a/src/libstd/rt/uv/mod.rs +++ b/src/libstd/rt/uv/mod.rs @@ -314,6 +314,7 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError { ECONNRESET => ConnectionReset, ENOTCONN => NotConnected, EPIPE => BrokenPipe, + ECONNABORTED => ConnectionAborted, err => { rtdebug!("uverr.code {}", err as int); // XXX: Need to map remaining uv error types diff --git a/src/libstd/rt/uv/uvll.rs b/src/libstd/rt/uv/uvll.rs index 18e95c8966e..2964eb9c58b 100644 --- a/src/libstd/rt/uv/uvll.rs +++ b/src/libstd/rt/uv/uvll.rs @@ -55,6 +55,7 @@ pub mod errors { pub static ECONNRESET: c_int = -4078; pub static ENOTCONN: c_int = -4054; pub static EPIPE: c_int = -4048; + pub static ECONNABORTED: c_int = -4080; } #[cfg(not(windows))] pub mod errors { @@ -66,6 +67,7 @@ pub mod errors { pub static ECONNRESET: c_int = -libc::ECONNRESET; pub static ENOTCONN: c_int = -libc::ENOTCONN; pub static EPIPE: c_int = -libc::EPIPE; + pub static ECONNABORTED: c_int = -libc::ECONNABORTED; } pub static PROCESS_SETUID: c_int = 1 << 0; |
