@@ -77,6 +77,8 @@ impl StreamRequest {
77
77
impl StreamResponse {
78
78
pub fn to_frames ( self , hpack_context : & mut hpack_context:: Context ) -> Vec < Box < framing:: CompressibleHttpFrame > >
79
79
{
80
+ trace ! ( "Starting to convert stream response to frames [{:?}]" , self ) ;
81
+
80
82
let mut frames: Vec < Box < framing:: CompressibleHttpFrame > > = Vec :: new ( ) ;
81
83
82
84
for informational_header in & self . informational_headers {
@@ -102,6 +104,8 @@ impl StreamResponse {
102
104
frames. extend ( trailer_headers_frame) ;
103
105
}
104
106
107
+ trace ! ( "Converted to frames [{:?}]" , frames) ;
108
+
105
109
frames
106
110
}
107
111
@@ -722,10 +726,12 @@ impl Stream {
722
726
}
723
727
724
728
self . send_frames . extend ( temp_send_frames) ;
729
+
730
+ trace ! ( "Finished sending frames on stream [{:?}]" , self . send_frames) ;
725
731
}
726
732
727
733
pub fn fetch_send_frames ( & mut self ) -> Vec < Vec < u8 > > {
728
- self . send_frames . drain ( 1 ..) . collect ( )
734
+ self . send_frames . drain ( 0 ..) . collect ( )
729
735
}
730
736
731
737
fn should_headers_frame_end_stream ( & self ) -> bool {
@@ -755,8 +761,10 @@ impl Stream {
755
761
let mut new_request = StreamRequest :: new ( ) ;
756
762
mem:: swap ( & mut self . request , & mut new_request) ;
757
763
764
+ trace ! ( "Passing request to the application [{:?}]" , new_request) ;
758
765
// TODO should the application be allowed to error?
759
766
let response: StreamResponse = app. process ( new_request. into ( ) ) . into ( ) ;
767
+ trace ! ( "Got response from the application [{:?}]" , response) ;
760
768
761
769
self . send ( response. to_frames ( hpack_send_context) ) ;
762
770
} ,
0 commit comments