Ignoring ContentLength for legacy RTSP-over-HTTP implementation #36396
Replies: 1 comment
-
|
sorry, posted this in Docs discussion by accident. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm porting some code that implements RTSP-over-HTTP to run under Kestrel. Currently the code uses a custom web server.
I need to ignore ContentLength in the HTTP Request and keep reading forever, until the underlying socket closes.
I cannot find a way to change the ContentLength to MaxInt before the Http1ContentLengthMessageBody is created.
I tried with some Middleware but failed. It seems that by the time my Middleware was called, the Heades are parsed and the Request Body is already created with the original Content Length
Background
FFMPEG's RTSP client creates a long running POST request with a content length of 32767
There are other RTSP Headers in the POST to identify this is a RTSP-over-HTTP connection
Back in 1999, a length of 32767 was plenty for some RTSP DESCRIBE/SETUP/PLAY commands
But in current times RTSP clients like ffmpeg send RTSP Keepalive messages every 30 seconds up the POST connection
After about 20 minutes FFMPEG will have sent more than 32767 bytes and Kestrel closes the POST
FFmpeg handles the POST closing and continues receiving video but there could be other RTSP-over-HTTP clients that don't handle the POST closing properly so was looking for a way to make Kestrel read from the POST forever, until the socket closes.
Ultimately this would feed into the SharpRTSP project
Thanks
Roger
Beta Was this translation helpful? Give feedback.
All reactions