File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -49,13 +49,18 @@ impl Encoder {
4949}
5050
5151/// Send an HTTP request over a stream.
52- pub async fn connect < RW > ( stream : RW , req : Request ) -> Result < Response , std :: io :: Error >
52+ pub async fn connect < RW > ( mut stream : RW , req : Request ) -> Result < Response , Error >
5353where
54- RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
54+ RW : Read + Write + Send + Sync + Unpin + ' static ,
5555{
5656 let mut req = encode ( req) . await ?;
57- io:: copy ( & mut req, & mut stream. clone ( ) ) . await ?;
58- let res = decode ( stream. clone ( ) ) . await . unwrap ( ) ; // todo: convert to http_types::Error
57+ log:: trace!( "> {:?}" , & req) ;
58+
59+ io:: copy ( & mut req, & mut stream) . await ?;
60+
61+ let res = decode ( stream) . await ?;
62+ log:: trace!( "< {:?}" , & res) ;
63+
5964 Ok ( res)
6065}
6166
You can’t perform that action at this time.
0 commit comments