Telegraph icon indicating copy to clipboard operation
Telegraph copied to clipboard

How to change HTTPConfig.readTimeout dynamically?

Open blackpill opened this issue 2 years ago • 1 comments

My iOS application provides a long mjpeg stream on web server. Because of HTTPConfig.readTimeout, the stream will stop when the time reaches HTTPConfig.readTimeout.

Currently, I have to change HTTPConfig.readTimeout to -1 in Telegraph's code. How can I change HTTPConfig.readTimeout dynamically?

Thank you.

blackpill avatar Oct 10 '23 21:10 blackpill

That is definitely tricky and unfortunately a scenario that Telegraph doesn't support. The readTimeout gets applied to the entire HTTPConnection. There isn't currently a separate timeout for reading the headers of a request versus reading the body of a request. Therefor you can't really specify a different timeout for each endpoint. That is going to require some bigger changes to Telegraph.

yvbeek avatar Mar 31 '24 23:03 yvbeek