mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-05 10:49:40 +02:00
Merge branch 'master' into master
This commit is contained in:
commit
772591576a
29 changed files with 3473 additions and 9899 deletions
|
@ -2,7 +2,7 @@ use byteorder::{BigEndian, ByteOrder, WriteBytesExt};
|
|||
use hmac::{Hmac, Mac};
|
||||
use sha1::Sha1;
|
||||
use futures::{Async, Future, Poll};
|
||||
use protobuf::{self, Message, MessageStatic};
|
||||
use protobuf::{self, Message};
|
||||
use rand::thread_rng;
|
||||
use std::io::{self, Read};
|
||||
use std::marker::PhantomData;
|
||||
|
@ -125,7 +125,7 @@ fn client_response<T: AsyncWrite>(connection: T, challenge: Vec<u8>) -> WriteAll
|
|||
write_all(connection, buffer)
|
||||
}
|
||||
|
||||
enum RecvPacket<T, M: MessageStatic> {
|
||||
enum RecvPacket<T, M: Message> {
|
||||
Header(ReadExact<T, Window<Vec<u8>>>, PhantomData<M>),
|
||||
Body(ReadExact<T, Window<Vec<u8>>>, PhantomData<M>),
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ enum RecvPacket<T, M: MessageStatic> {
|
|||
fn recv_packet<T: AsyncRead, M>(connection: T, acc: Vec<u8>) -> RecvPacket<T, M>
|
||||
where
|
||||
T: Read,
|
||||
M: MessageStatic,
|
||||
M: Message,
|
||||
{
|
||||
RecvPacket::Header(read_into_accumulator(connection, 4, acc), PhantomData)
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ where
|
|||
impl<T: AsyncRead, M> Future for RecvPacket<T, M>
|
||||
where
|
||||
T: Read,
|
||||
M: MessageStatic,
|
||||
M: Message,
|
||||
{
|
||||
type Item = (T, M, Vec<u8>);
|
||||
type Error = io::Error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue