From d08cb33e9403f9692fb80721bfd4914d3ea1b9b4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: May 03 2018 22:34:02 +0000 Subject: Stop using deprecated APIs --- diff --git a/0001-Stop-using-deprecated-bytes-APIs-324.patch b/0001-Stop-using-deprecated-bytes-APIs-324.patch new file mode 100644 index 0000000..b7b2ae0 --- /dev/null +++ b/0001-Stop-using-deprecated-bytes-APIs-324.patch @@ -0,0 +1,50 @@ +From 9aaa8f06d1f03346fd682ab9d826b521d2efad5e Mon Sep 17 00:00:00 2001 +From: Carl Lerche +Date: Sat, 28 Apr 2018 12:25:22 -0700 +Subject: [PATCH] Stop using deprecated bytes APIs (#324) + +This also adds a filter for another treiber stack expected data race. The +race is expected as part of the algorithm. +--- + tokio-io/src/length_delimited.rs | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/tokio-io/src/length_delimited.rs b/tokio-io/src/length_delimited.rs +index 7e6635d1d9e9..b9f847622a37 100644 +--- a/tokio-io/src/length_delimited.rs ++++ b/tokio-io/src/length_delimited.rs +@@ -1,6 +1,6 @@ + use {codec, AsyncRead, AsyncWrite}; + +-use bytes::{Buf, BufMut, BytesMut, IntoBuf, BigEndian, LittleEndian}; ++use bytes::{Buf, BufMut, BytesMut, IntoBuf}; + use bytes::buf::Chain; + + use futures::{Async, AsyncSink, Stream, Sink, StartSend, Poll}; +@@ -291,9 +291,9 @@ impl Decoder { + + // match endianess + let n = if self.builder.length_field_is_big_endian { +- src.get_uint::(field_len) ++ src.get_uint_be(field_len) + } else { +- src.get_uint::(field_len) ++ src.get_uint_le(field_len) + }; + + if n > self.builder.max_frame_len as u64 { +@@ -479,9 +479,9 @@ impl FramedWrite { + }; + + if self.builder.length_field_is_big_endian { +- head.put_uint::(n as u64, self.builder.length_field_len); ++ head.put_uint_be(n as u64, self.builder.length_field_len); + } else { +- head.put_uint::(n as u64, self.builder.length_field_len); ++ head.put_uint_le(n as u64, self.builder.length_field_len); + } + + debug_assert!(self.frame.is_none()); +-- +2.17.0 + diff --git a/rust-tokio-io.spec b/rust-tokio-io.spec index 0522548..40f5a5e 100644 --- a/rust-tokio-io.spec +++ b/rust-tokio-io.spec @@ -6,13 +6,15 @@ Name: rust-%{crate} Version: 0.1.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Core I/O primitives for asynchronous I/O in Rust # https://github.com/tokio-rs/tokio/issues/202 License: MIT or ASL 2.0 URL: https://crates.io/crates/tokio-io Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +# https://github.com/tokio-rs/tokio/pull/324 +Patch1: 0001-Stop-using-deprecated-bytes-APIs-324.patch ExclusiveArch: %{rust_arches} @@ -36,7 +38,7 @@ This package contains library source intended for building other packages which use %{crate} from crates.io. %prep -%autosetup -n %{crate}-%{version} -p1 +%autosetup -n %{crate}-%{version} -p2 %cargo_prep %build @@ -55,6 +57,9 @@ which use %{crate} from crates.io. %{cargo_registry}/%{crate}-%{version}/ %changelog +* Thu May 03 2018 Josh Stone - 0.1.6-2 +- Stop using deprecated APIs + * Fri Mar 09 2018 Josh Stone - 0.1.6-1 - Update to 0.1.6