change from deprecated Buf::put_*<E> to put_*_be (#267)
This commit is contained in:
		
				
					committed by
					
						 Carl Lerche
						Carl Lerche
					
				
			
			
				
	
			
			
			
						parent
						
							fadec67fdf
						
					
				
				
					commit
					e8fcd34476
				
			| @@ -32,7 +32,7 @@ unstable = [] | |||||||
| [dependencies] | [dependencies] | ||||||
| futures = "0.1" | futures = "0.1" | ||||||
| tokio-io = "0.1.4" | tokio-io = "0.1.4" | ||||||
| bytes = "0.4" | bytes = "0.4.7" | ||||||
| http = "0.1.3" | http = "0.1.3" | ||||||
| byteorder = "1.0" | byteorder = "1.0" | ||||||
| log = "0.4.1" | log = "0.4.1" | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| use frame::{self, Error, Head, Kind, Reason, StreamId}; | use frame::{self, Error, Head, Kind, Reason, StreamId}; | ||||||
|  |  | ||||||
| use bytes::{BigEndian, BufMut}; | use bytes::{BufMut}; | ||||||
|  |  | ||||||
| #[derive(Debug, Clone, Copy, Eq, PartialEq)] | #[derive(Debug, Clone, Copy, Eq, PartialEq)] | ||||||
| pub struct GoAway { | pub struct GoAway { | ||||||
| @@ -42,8 +42,8 @@ impl GoAway { | |||||||
|         trace!("encoding GO_AWAY; code={:?}", self.error_code); |         trace!("encoding GO_AWAY; code={:?}", self.error_code); | ||||||
|         let head = Head::new(Kind::GoAway, 0, StreamId::zero()); |         let head = Head::new(Kind::GoAway, 0, StreamId::zero()); | ||||||
|         head.encode(8, dst); |         head.encode(8, dst); | ||||||
|         dst.put_u32::<BigEndian>(self.last_stream_id.into()); |         dst.put_u32_be(self.last_stream_id.into()); | ||||||
|         dst.put_u32::<BigEndian>(self.error_code.into()); |         dst.put_u32_be(self.error_code.into()); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| use super::StreamId; | use super::StreamId; | ||||||
|  |  | ||||||
| use bytes::{BigEndian, BufMut}; | use bytes::{BufMut}; | ||||||
|  |  | ||||||
| #[derive(Debug, Copy, Clone, PartialEq, Eq)] | #[derive(Debug, Copy, Clone, PartialEq, Eq)] | ||||||
| pub struct Head { | pub struct Head { | ||||||
| @@ -66,10 +66,10 @@ impl Head { | |||||||
|     pub fn encode<T: BufMut>(&self, payload_len: usize, dst: &mut T) { |     pub fn encode<T: BufMut>(&self, payload_len: usize, dst: &mut T) { | ||||||
|         debug_assert!(self.encode_len() <= dst.remaining_mut()); |         debug_assert!(self.encode_len() <= dst.remaining_mut()); | ||||||
|  |  | ||||||
|         dst.put_uint::<BigEndian>(payload_len as u64, 3); |         dst.put_uint_be(payload_len as u64, 3); | ||||||
|         dst.put_u8(self.kind as u8); |         dst.put_u8(self.kind as u8); | ||||||
|         dst.put_u8(self.flag); |         dst.put_u8(self.flag); | ||||||
|         dst.put_u32::<BigEndian>(self.stream_id.into()); |         dst.put_u32_be(self.stream_id.into()); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -371,7 +371,7 @@ impl PushPromise { | |||||||
|  |  | ||||||
|         self.header_block.into_encoding() |         self.header_block.into_encoding() | ||||||
|             .encode(&head, encoder, dst, |dst| { |             .encode(&head, encoder, dst, |dst| { | ||||||
|                 dst.put_u32::<BigEndian>(promised_id.into()); |                 dst.put_u32_be(promised_id.into()); | ||||||
|             }) |             }) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| use frame::{self, Error, Head, Kind, Reason, StreamId}; | use frame::{self, Error, Head, Kind, Reason, StreamId}; | ||||||
|  |  | ||||||
| use bytes::{BigEndian, BufMut}; | use bytes::{BufMut}; | ||||||
|  |  | ||||||
| #[derive(Debug, Eq, PartialEq)] | #[derive(Debug, Eq, PartialEq)] | ||||||
| pub struct Reset { | pub struct Reset { | ||||||
| @@ -45,7 +45,7 @@ impl Reset { | |||||||
|         ); |         ); | ||||||
|         let head = Head::new(Kind::Reset, 0, self.stream_id); |         let head = Head::new(Kind::Reset, 0, self.stream_id); | ||||||
|         head.encode(4, dst); |         head.encode(4, dst); | ||||||
|         dst.put_u32::<BigEndian>(self.error_code.into()); |         dst.put_u32_be(self.error_code.into()); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| use bytes::{BigEndian, BufMut, BytesMut}; | use bytes::{BufMut, BytesMut}; | ||||||
| use frame::{Error, Frame, FrameSize, Head, Kind, StreamId}; | use frame::{Error, Frame, FrameSize, Head, Kind, StreamId}; | ||||||
|  |  | ||||||
| #[derive(Debug, Clone, Default, Eq, PartialEq)] | #[derive(Debug, Clone, Default, Eq, PartialEq)] | ||||||
| @@ -280,8 +280,8 @@ impl Setting { | |||||||
|             MaxHeaderListSize(v) => (6, v), |             MaxHeaderListSize(v) => (6, v), | ||||||
|         }; |         }; | ||||||
|  |  | ||||||
|         dst.put_u16::<BigEndian>(kind); |         dst.put_u16_be(kind); | ||||||
|         dst.put_u32::<BigEndian>(val); |         dst.put_u32_be(val); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| use frame::{self, Error, Head, Kind, StreamId}; | use frame::{self, Error, Head, Kind, StreamId}; | ||||||
|  |  | ||||||
| use bytes::{BigEndian, BufMut}; | use bytes::{BufMut}; | ||||||
|  |  | ||||||
| const SIZE_INCREMENT_MASK: u32 = 1 << 31; | const SIZE_INCREMENT_MASK: u32 = 1 << 31; | ||||||
|  |  | ||||||
| @@ -51,7 +51,7 @@ impl WindowUpdate { | |||||||
|         trace!("encoding WINDOW_UPDATE; id={:?}", self.stream_id); |         trace!("encoding WINDOW_UPDATE; id={:?}", self.stream_id); | ||||||
|         let head = Head::new(Kind::WindowUpdate, 0, self.stream_id); |         let head = Head::new(Kind::WindowUpdate, 0, self.stream_id); | ||||||
|         head.encode(4, dst); |         head.encode(4, dst); | ||||||
|         dst.put_u32::<BigEndian>(self.size_increment); |         dst.put_u32_be(self.size_increment); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,3 +1,4 @@ | |||||||
|  | #![deny(warnings)] | ||||||
| #[macro_use] | #[macro_use] | ||||||
| extern crate log; | extern crate log; | ||||||
|  |  | ||||||
| @@ -881,8 +882,6 @@ fn rst_while_closing() { | |||||||
|  |  | ||||||
| #[test] | #[test] | ||||||
| fn rst_with_buffered_data() { | fn rst_with_buffered_data() { | ||||||
|     use futures::future::lazy; |  | ||||||
|  |  | ||||||
|     // Data is buffered in `FramedWrite` and the stream is reset locally before |     // Data is buffered in `FramedWrite` and the stream is reset locally before | ||||||
|     // the data is fully flushed. Given that resetting a stream requires |     // the data is fully flushed. Given that resetting a stream requires | ||||||
|     // clearing all associated state for that stream, this test ensures that the |     // clearing all associated state for that stream, this test ensures that the | ||||||
| @@ -932,7 +931,7 @@ fn rst_with_buffered_data() { | |||||||
|             stream.send_data(body.into(), true).unwrap(); |             stream.send_data(body.into(), true).unwrap(); | ||||||
|  |  | ||||||
|             conn.drive({ |             conn.drive({ | ||||||
|                 resp.then(|res| { |                 resp.then(|_res| { | ||||||
|                     Ok::<_, ()>(()) |                     Ok::<_, ()>(()) | ||||||
|                 }) |                 }) | ||||||
|             }) |             }) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user