Bug #4598
openSAT>IP: RTP-over-TCP reset the tuner when data is discarded
0%
Description
Hi,
With the current (and working) support for RTP-over-TCP still exists a problem. When the TCP socket is saturated and the write function fails, the data is discarded.. and this is correct. However, sometimes the connection will be closed by the client.
See this part of the log:
2017-09-15 16:19:03.239 satip: SAT>IP DVB-S Tuner #1 (192.168.1.22) - RTSP error -90 (Message too long) [5-0] 2017-09-15 16:19:03.721 subscription: 0009: service instance is bad, reason: Tuning failed
This is the log in the CLIENT side. The server is discarding data, but the client think that the "message" is too long.
I think that the correct behaviour in this case should be:
- If the write fails with TS data (188*N bytes) then discard data in chunks of aligned 188 bytes (no more, no less).
- If the write fails with RTCP data (small chunks of bytes), then retry the write one time or discard the complete message.
- If the write fails with RTSP data (high priority data), then retry the write.
- And only if the same write fails for some time, then close the socket.
The current code that discards the data is in the function http_extra_send_prealloc()@http.c:
http://github.com/tvheadend/tvheadend/blob/3391e1d99d2d9832fa165f01cdd5b0c44444319e/src/http.c#L901
You agree that this is a good strategy?
Regards.