diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-26 16:04:05 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-26 16:04:05 -0700 |
| commit | 651f5db4623526d416458e9f77632e7dd72f96a8 (patch) | |
| tree | 701656ee731f6e3353ba45e85a6a79886ee31194 /src/libstd/rt/io | |
| parent | dcdcd309fb9baf06f835831c83b94a5ad1cdd568 (diff) | |
| download | rust-651f5db4623526d416458e9f77632e7dd72f96a8.tar.gz rust-651f5db4623526d416458e9f77632e7dd72f96a8.zip | |
Implement another error code found on windows.
Closes #8811
Diffstat (limited to 'src/libstd/rt/io')
| -rw-r--r-- | src/libstd/rt/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/io/net/tcp.rs | 16 |
2 files changed, 12 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); |
