File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
pingora-core/src/protocols/http Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 1- 34337970fa1741f4348d98c4fcbb96f306f475fb
1+ b1bf525ad94e2b8043250550bb0ae041c7b0a9bd
Original file line number Diff line number Diff line change @@ -188,8 +188,19 @@ impl Session {
188188 }
189189 }
190190
191+ /// Sets the downstream read timeout. This will trigger if we're unable
192+ /// to read from the stream after `timeout`.
193+ ///
194+ /// This is a noop for h2.
195+ pub fn set_read_timeout ( & mut self , timeout : Duration ) {
196+ match self {
197+ Self :: H1 ( s) => s. set_read_timeout ( timeout) ,
198+ Self :: H2 ( _) => { }
199+ }
200+ }
201+
191202 /// Sets the downstream write timeout. This will trigger if we're unable
192- /// to write to the stream after `duration `. If a `min_send_rate` is
203+ /// to write to the stream after `timeout `. If a `min_send_rate` is
193204 /// configured then the `min_send_rate` calculated timeout has higher priority.
194205 ///
195206 /// This is a noop for h2.
@@ -207,7 +218,7 @@ impl Session {
207218 /// rate must be greater than zero.
208219 ///
209220 /// Calculated write timeout is guaranteed to be at least 1s if `min_send_rate`
210- /// is greater than zero, a send rate of zero is a noop.
221+ /// is greater than zero, a send rate of zero is a noop.x
211222 ///
212223 /// This is a noop for h2.
213224 pub fn set_min_send_rate ( & mut self , rate : usize ) {
Original file line number Diff line number Diff line change @@ -837,8 +837,14 @@ impl HttpSession {
837837 }
838838 }
839839
840+ /// Sets the downstream read timeout. This will trigger if we're unable
841+ /// to read from the stream after `timeout`.
842+ pub fn set_read_timeout ( & mut self , timeout : Duration ) {
843+ self . read_timeout = Some ( timeout) ;
844+ }
845+
840846 /// Sets the downstream write timeout. This will trigger if we're unable
841- /// to write to the stream after `duration `. If a `min_send_rate` is
847+ /// to write to the stream after `timeout `. If a `min_send_rate` is
842848 /// configured then the `min_send_rate` calculated timeout has higher priority.
843849 pub fn set_write_timeout ( & mut self , timeout : Duration ) {
844850 self . write_timeout = Some ( timeout) ;
You can’t perform that action at this time.
0 commit comments