projects
/
rust-sip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
390496b
)
Fix AsyncRead::framed deprecation
author
Richard Whitehouse
<github@richardwhiuk.com>
Sun, 21 Oct 2018 22:23:13 +0000
(18:23 -0400)
committer
Richard Whitehouse
<github@richardwhiuk.com>
Sun, 21 Oct 2018 22:23:13 +0000
(18:23 -0400)
src/codec.rs
patch
|
blob
|
history
diff --git
a/src/codec.rs
b/src/codec.rs
index 266bf4fb63411694e49f76215f54d850ba18adaf..10360a5774fd14ba00d3183b5cb4e6ac6d9f8029 100644
(file)
--- a/
src/codec.rs
+++ b/
src/codec.rs
@@
-2,7
+2,6
@@
use bytes::BytesMut;
use futures::future;
use futures::{Future, Stream};
-use tokio_io::AsyncRead;
use tokio_core::reactor::Handle;
use tokio_core::net::TcpListener;
use tokio_io::codec::{Encoder, Decoder};
@@
-382,7
+381,9
@@
impl Sip {
let caller = caller.clone();
// Split up the read and write halves
- let (_sink, stream) = tcp.framed(SipCodec::new()).split();
+ let decoder = SipCodec::new();
+
+ let (_sink, stream) = decoder.framed(tcp).split();
let future = stream.for_each(move |message| caller(message));