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 {
49
49
}
50
50
51
51
/// 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 >
53
53
where
54
- RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
54
+ RW : Read + Write + Send + Sync + Unpin + ' static ,
55
55
{
56
56
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
+
59
64
Ok ( res)
60
65
}
61
66
You can’t perform that action at this time.
0 commit comments