@@ -2,7 +2,6 @@ extern crate time;
2
2
3
3
use super :: super :: * ;
4
4
5
- use byteorder;
6
5
use byteorder:: { WriteBytesExt , BigEndian , ByteOrder } ;
7
6
8
7
use std:: collections:: BTreeMap ;
@@ -16,8 +15,6 @@ use std::io::{ErrorKind, Read, Write, BufReader, BufWriter};
16
15
use std:: sync:: { Mutex , Condvar } ;
17
16
use std:: time:: Duration ;
18
17
19
- const MAX_TAG : usize = ( 1 << 23 ) - 1 ;
20
-
21
18
// Really only used in one place...
22
19
enum Either < L , R > {
23
20
Left ( L ) ,
@@ -169,7 +166,7 @@ impl MuxSessionImpl {
169
166
frame : MessageFrame :: Tping ,
170
167
} ;
171
168
172
- codec:: encode_message ( & mut * write, & ping)
169
+ codec:: write_message ( & mut * write, & ping)
173
170
} ) ) ;
174
171
175
172
let msg = try!( self . dispatch_read ( id) ) ;
@@ -210,9 +207,8 @@ impl MuxSessionImpl {
210
207
fn dispatch_write ( & self , id : u32 , write : & mut Write , msg : & Tdispatch ) -> io:: Result < ( ) > {
211
208
let tag = Tag { end : true , id : id } ;
212
209
213
- tryb ! ( write. write_i32:: <BigEndian >( codec:: size:: tdispatch_size( msg) as i32 + 4 ) ) ;
214
- tryb ! ( write. write_i8( types:: TDISPATCH ) ) ;
215
-
210
+ try!( write. write_i32 :: < BigEndian > ( codec:: size:: tdispatch_size ( msg) as i32 + 4 ) ) ;
211
+ try!( write. write_i8 ( types:: TDISPATCH ) ) ;
216
212
try!( codec:: encode_tag ( & mut * write, & tag) ) ;
217
213
codec:: encode_tdispatch ( & mut * write, msg)
218
214
}
@@ -354,7 +350,7 @@ impl MuxSessionImpl {
354
350
} ;
355
351
356
352
let mut write = self . write . lock ( ) . unwrap ( ) ;
357
- try!( codec:: encode_message ( & mut * write, & ping) ) ;
353
+ try!( codec:: write_message ( & mut * write, & ping) ) ;
358
354
write. flush ( )
359
355
}
360
356
0 commit comments