change from deprecated Buf::put_*<E> to put_*_be (#267)
This commit is contained in:
committed by
Carl Lerche
parent
fadec67fdf
commit
e8fcd34476
@@ -1,6 +1,6 @@
|
||||
use frame::{self, Error, Head, Kind, Reason, StreamId};
|
||||
|
||||
use bytes::{BigEndian, BufMut};
|
||||
use bytes::{BufMut};
|
||||
|
||||
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
|
||||
pub struct GoAway {
|
||||
@@ -42,8 +42,8 @@ impl GoAway {
|
||||
trace!("encoding GO_AWAY; code={:?}", self.error_code);
|
||||
let head = Head::new(Kind::GoAway, 0, StreamId::zero());
|
||||
head.encode(8, dst);
|
||||
dst.put_u32::<BigEndian>(self.last_stream_id.into());
|
||||
dst.put_u32::<BigEndian>(self.error_code.into());
|
||||
dst.put_u32_be(self.last_stream_id.into());
|
||||
dst.put_u32_be(self.error_code.into());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::StreamId;
|
||||
|
||||
use bytes::{BigEndian, BufMut};
|
||||
use bytes::{BufMut};
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub struct Head {
|
||||
@@ -66,10 +66,10 @@ impl Head {
|
||||
pub fn encode<T: BufMut>(&self, payload_len: usize, dst: &mut T) {
|
||||
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.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()
|
||||
.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 bytes::{BigEndian, BufMut};
|
||||
use bytes::{BufMut};
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub struct Reset {
|
||||
@@ -45,7 +45,7 @@ impl Reset {
|
||||
);
|
||||
let head = Head::new(Kind::Reset, 0, self.stream_id);
|
||||
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};
|
||||
|
||||
#[derive(Debug, Clone, Default, Eq, PartialEq)]
|
||||
@@ -280,8 +280,8 @@ impl Setting {
|
||||
MaxHeaderListSize(v) => (6, v),
|
||||
};
|
||||
|
||||
dst.put_u16::<BigEndian>(kind);
|
||||
dst.put_u32::<BigEndian>(val);
|
||||
dst.put_u16_be(kind);
|
||||
dst.put_u32_be(val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use frame::{self, Error, Head, Kind, StreamId};
|
||||
|
||||
use bytes::{BigEndian, BufMut};
|
||||
use bytes::{BufMut};
|
||||
|
||||
const SIZE_INCREMENT_MASK: u32 = 1 << 31;
|
||||
|
||||
@@ -51,7 +51,7 @@ impl WindowUpdate {
|
||||
trace!("encoding WINDOW_UPDATE; id={:?}", self.stream_id);
|
||||
let head = Head::new(Kind::WindowUpdate, 0, self.stream_id);
|
||||
head.encode(4, dst);
|
||||
dst.put_u32::<BigEndian>(self.size_increment);
|
||||
dst.put_u32_be(self.size_increment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user