@@ -10,9 +10,9 @@ use tokio_io::{AsyncRead, AsyncWrite};
10
10
#[ cfg( feature = "tokio-proto" ) ]
11
11
use tokio_proto:: streaming:: pipeline:: { Frame , Transport } ;
12
12
13
- use proto:: Http1Transaction ;
13
+ use proto:: { Chunk , Http1Transaction , MessageHead } ;
14
14
use super :: io:: { Cursor , Buffered } ;
15
- use super :: h1 :: { EncodedBuf , Encoder , Decoder } ;
15
+ use super :: { EncodedBuf , Encoder , Decoder } ;
16
16
use method:: Method ;
17
17
use version:: HttpVersion ;
18
18
@@ -63,7 +63,7 @@ where I: AsyncRead + AsyncWrite,
63
63
}
64
64
65
65
#[ cfg( feature = "tokio-proto" ) ]
66
- fn poll_incoming ( & mut self ) -> Poll < Option < Frame < super :: MessageHead < T :: Incoming > , super :: Chunk , :: Error > > , io:: Error > {
66
+ fn poll_incoming ( & mut self ) -> Poll < Option < Frame < MessageHead < T :: Incoming > , Chunk , :: Error > > , io:: Error > {
67
67
trace ! ( "Conn::poll_incoming()" ) ;
68
68
69
69
#[ derive( Debug ) ]
@@ -163,7 +163,7 @@ where I: AsyncRead + AsyncWrite,
163
163
T :: should_error_on_parse_eof ( ) && !self . state . is_idle ( )
164
164
}
165
165
166
- pub fn read_head ( & mut self ) -> Poll < Option < ( super :: MessageHead < T :: Incoming > , bool ) > , :: Error > {
166
+ pub fn read_head ( & mut self ) -> Poll < Option < ( MessageHead < T :: Incoming > , bool ) > , :: Error > {
167
167
debug_assert ! ( self . can_read_head( ) ) ;
168
168
trace ! ( "Conn::read_head" ) ;
169
169
@@ -236,7 +236,7 @@ where I: AsyncRead + AsyncWrite,
236
236
}
237
237
}
238
238
239
- pub fn read_body ( & mut self ) -> Poll < Option < super :: Chunk > , io:: Error > {
239
+ pub fn read_body ( & mut self ) -> Poll < Option < Chunk > , io:: Error > {
240
240
debug_assert ! ( self . can_read_body( ) ) ;
241
241
242
242
trace ! ( "Conn::read_body" ) ;
@@ -246,7 +246,7 @@ where I: AsyncRead + AsyncWrite,
246
246
match decoder. decode ( & mut self . io ) {
247
247
Ok ( Async :: Ready ( slice) ) => {
248
248
let ( reading, chunk) = if !slice. is_empty ( ) {
249
- return Ok ( Async :: Ready ( Some ( super :: Chunk :: from ( slice) ) ) ) ;
249
+ return Ok ( Async :: Ready ( Some ( Chunk :: from ( slice) ) ) ) ;
250
250
} else if decoder. is_eof ( ) {
251
251
debug ! ( "incoming body completed" ) ;
252
252
( Reading :: KeepAlive , None )
@@ -415,7 +415,7 @@ where I: AsyncRead + AsyncWrite,
415
415
self . io . can_buffer ( )
416
416
}
417
417
418
- pub fn write_head ( & mut self , mut head : super :: MessageHead < T :: Outgoing > , body : bool ) {
418
+ pub fn write_head ( & mut self , mut head : MessageHead < T :: Outgoing > , body : bool ) {
419
419
debug_assert ! ( self . can_write_head( ) ) ;
420
420
421
421
self . enforce_version ( & mut head) ;
@@ -438,7 +438,7 @@ where I: AsyncRead + AsyncWrite,
438
438
439
439
// If we know the remote speaks an older version, we try to fix up any messages
440
440
// to work with our older peer.
441
- fn enforce_version ( & mut self , head : & mut super :: MessageHead < T :: Outgoing > ) {
441
+ fn enforce_version ( & mut self , head : & mut MessageHead < T :: Outgoing > ) {
442
442
use header:: Connection ;
443
443
444
444
let wants_keep_alive = if self . state . wants_keep_alive ( ) {
@@ -591,7 +591,7 @@ where I: AsyncRead + AsyncWrite,
591
591
T : Http1Transaction ,
592
592
K : KeepAlive ,
593
593
T :: Outgoing : fmt:: Debug {
594
- type Item = Frame < super :: MessageHead < T :: Incoming > , super :: Chunk , :: Error > ;
594
+ type Item = Frame < MessageHead < T :: Incoming > , Chunk , :: Error > ;
595
595
type Error = io:: Error ;
596
596
597
597
#[ inline]
@@ -610,7 +610,7 @@ where I: AsyncRead + AsyncWrite,
610
610
T : Http1Transaction ,
611
611
K : KeepAlive ,
612
612
T :: Outgoing : fmt:: Debug {
613
- type SinkItem = Frame < super :: MessageHead < T :: Outgoing > , B , :: Error > ;
613
+ type SinkItem = Frame < MessageHead < T :: Outgoing > , B , :: Error > ;
614
614
type SinkError = io:: Error ;
615
615
616
616
#[ inline]
@@ -886,7 +886,7 @@ enum Version {
886
886
// The DebugFrame and DebugChunk are simple Debug implementations that allow
887
887
// us to dump the frame into logs, without logging the entirety of the bytes.
888
888
#[ cfg( feature = "tokio-proto" ) ]
889
- struct DebugFrame < ' a , T : fmt:: Debug + ' a , B : AsRef < [ u8 ] > + ' a > ( & ' a Frame < super :: MessageHead < T > , B , :: Error > ) ;
889
+ struct DebugFrame < ' a , T : fmt:: Debug + ' a , B : AsRef < [ u8 ] > + ' a > ( & ' a Frame < MessageHead < T > , B , :: Error > ) ;
890
890
891
891
#[ cfg( feature = "tokio-proto" ) ]
892
892
impl < ' a , T : fmt:: Debug + ' a , B : AsRef < [ u8 ] > + ' a > fmt:: Debug for DebugFrame < ' a , T , B > {
@@ -925,7 +925,7 @@ mod tests {
925
925
use tokio_proto:: streaming:: pipeline:: Frame ;
926
926
927
927
use proto:: { self , ClientTransaction , MessageHead , ServerTransaction } ;
928
- use super :: super :: h1 :: Encoder ;
928
+ use super :: super :: Encoder ;
929
929
use mock:: AsyncIo ;
930
930
931
931
use super :: { Conn , Decoder , Reading , Writing } ;
@@ -1118,7 +1118,7 @@ mod tests {
1118
1118
let _: Result < ( ) , ( ) > = future:: lazy ( || {
1119
1119
let io = AsyncIo :: new_buf ( vec ! [ ] , 0 ) ;
1120
1120
let mut conn = Conn :: < _ , proto:: Chunk , ServerTransaction > :: new ( io, Default :: default ( ) ) ;
1121
- let max = :: proto :: io:: DEFAULT_MAX_BUFFER_SIZE + 4096 ;
1121
+ let max = super :: super :: io:: DEFAULT_MAX_BUFFER_SIZE + 4096 ;
1122
1122
conn. state . writing = Writing :: Body ( Encoder :: length ( ( max * 2 ) as u64 ) ) ;
1123
1123
1124
1124
assert ! ( conn. start_send( Frame :: Body { chunk: Some ( vec![ b'a' ; max] . into( ) ) } ) . unwrap( ) . is_ready( ) ) ;
0 commit comments