From 940f2c34311f9b6950360461634e36950c6da228 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Thu, 30 May 2019 14:33:55 -0400 Subject: [PATCH] Update tokio-trace-core to 0.2 (#1111) Also includes 1b498e8aa23b53528a5a2d6e6aad2fe41f37ff60 --- ci/azure-cross-compile.yml | 3 +++ tokio-tcp/Cargo.toml | 1 + tokio-tcp/tests/tcp.rs | 7 +++++-- tokio/Cargo.toml | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ci/azure-cross-compile.yml b/ci/azure-cross-compile.yml index 857aeb944..8c2553c72 100644 --- a/ci/azure-cross-compile.yml +++ b/ci/azure-cross-compile.yml @@ -8,6 +8,9 @@ jobs: parameters: rust_version: stable + - script: sudo apt-get update + displayName: "apt-get update" + - script: sudo apt-get install gcc-multilib displayName: "Install gcc-multilib" diff --git a/tokio-tcp/Cargo.toml b/tokio-tcp/Cargo.toml index 8a27250f7..cae0f5e5d 100644 --- a/tokio-tcp/Cargo.toml +++ b/tokio-tcp/Cargo.toml @@ -29,4 +29,5 @@ futures = "0.1.19" [dev-dependencies] env_logger = { version = "0.5", default-features = false } +net2 = "0.2" tokio = "0.1.13" diff --git a/tokio-tcp/tests/tcp.rs b/tokio-tcp/tests/tcp.rs index 0c1aca9ba..09b4478e2 100644 --- a/tokio-tcp/tests/tcp.rs +++ b/tokio-tcp/tests/tcp.rs @@ -1,6 +1,7 @@ extern crate env_logger; extern crate futures; extern crate mio; +extern crate net2; extern crate tokio_io; extern crate tokio_tcp; @@ -84,13 +85,14 @@ fn accept2() { t.join().unwrap(); } -#[cfg(unix)] -mod unix { +#[cfg(target_os = "linux")] +mod linux { use tokio_tcp::TcpStream; use env_logger; use futures::{future, Future}; use mio::unix::UnixReady; + use net2::TcpStreamExt; use tokio_io::AsyncRead; use std::io::Write; @@ -105,6 +107,7 @@ mod unix { let addr = t!(srv.local_addr()); let t = thread::spawn(move || { let mut client = t!(srv.accept()).0; + client.set_linger(Some(Duration::from_millis(0))).unwrap(); client.write(b"hello world").unwrap(); thread::sleep(Duration::from_millis(200)); }); diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 33d3f3d28..66f437e7a 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -73,7 +73,7 @@ tokio-threadpool = { version = "0.1.14", optional = true } tokio-tcp = { version = "0.1.0", optional = true } tokio-udp = { version = "0.1.0", optional = true } tokio-timer = { version = "0.2.8", optional = true } -tokio-trace-core = { version = "0.1", optional = true } +tokio-trace-core = { version = "0.2", optional = true } # Needed until `reactor` is removed from `tokio`. mio = { version = "0.6.14", optional = true }