<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 22/09/14 15:42, Ross Finlayson
wrote:<br>
</div>
<blockquote
cite="mid:EFF0437B-A064-4E00-BF2F-AF1460DB7F24@live555.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div>
<blockquote type="cite">It is possible to restart an origin
server quickly enough that a live 555 proxy server does not
notice.<br>
<br>
As a test this can be done by modifying one of the live 555
test programs (I was using testH264VideoStreamer) to enable
SO_REUSEADDR/SO_REUSEPORT, then the process could be quickly
killed and restarted without waiting for the socket to
timeout. </blockquote>
<div><br>
</div>
And that's precisely why you shouldn't make such a change to the
server's code :-)</div>
</blockquote>
Its not that I'm making a change to the server code. It was actually
a third party embedded server that is capable of restarting fast
enough that the proxy server never notices. The change to the
server code suggested is just a quick way of reproducing the problem
on the same machine.<br>
<blockquote
cite="mid:EFF0437B-A064-4E00-BF2F-AF1460DB7F24@live555.com"
type="cite">
<div><br>
</div>
<div>But anyway, the proxy server sends periodic RTSP "OPTIONS"
commands to the 'back-end' server, to test whether its still
alive. If any of these "OPTIONS" commands fails (or if the RTSP
(TCP) connection to the back-end server fails), then the proxy
server will notice this, and establish a new connection (with a
new "DESCRIBE" command) to the back-end server.<br>
</div>
</blockquote>
<blockquote
cite="mid:EFF0437B-A064-4E00-BF2F-AF1460DB7F24@live555.com"
type="cite">
<div><br>
</div>
<div>You should be able to see this by running the proxy server
with the -V (uppercase "V") option.</div>
<div><br>
</div>
<div>But (getting back to the first point) if your server is able
to restart in such a way that a previously-set-up TCP connection
can get misinterpreted as still being valid, then that's a
serious security flaw in your server OS; that's the real bug
that you should be fixing.</div>
<br>
</blockquote>
I can indeed see this running the proxy server with -V. It is not
the case of a TCP connection being misinterpreted as valid. It is
the case of when the proxy server retries an OPTIONS command, it
sees the TCP connection has gone away, reconnects and receives a
valid response, it doesn't realise this is because the server has
restarted. Perhaps rather than using OPTIONS something that sends a
session id should be sent and error responses checked for?<br>
<br>
Sending request: PLAY <a class="moz-txt-link-freetext" href="rtsp://127.0.0.1:8554/testStream/">rtsp://127.0.0.1:8554/testStream/</a> RTSP/1.0<br>
CSeq: 4<br>
User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2014.09.11)<br>
Session: 29A64580<br>
<br>
<br>
Received 186 new bytes of response data.<br>
Received a complete PLAY response:<br>
RTSP/1.0 200 OK<br>
CSeq: 4<br>
Date: Mon, Sep 22 2014 15:07:50 GMT<br>
Range: npt=29.767-<br>
Session: 29A64580<br>
RTP-Info:
url=<a class="moz-txt-link-freetext" href="rtsp://127.0.0.1:8554/testStream/track1;seq=24127;rtptime=32393928">rtsp://127.0.0.1:8554/testStream/track1;seq=24127;rtptime=32393928</a><br>
<br>
==================<br>
I restart the origin server here<br>
==================<br>
<br>
<br>
Opening connection to 127.0.0.1, port 8554...<br>
...remote connection opened<br>
Sending request: OPTIONS <a class="moz-txt-link-freetext" href="rtsp://127.0.0.1:8554/testStream/">rtsp://127.0.0.1:8554/testStream/</a> RTSP/1.0<br>
CSeq: 6<br>
User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2014.09.11)<br>
Session: 29A64580<br>
<br>
<br>
Received 152 new bytes of response data.<br>
Received a complete OPTIONS response:<br>
RTSP/1.0 200 OK<br>
CSeq: 6<br>
Date: Mon, Sep 22 2014 15:08:47 GMT<br>
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE,
GET_PARAMETER, SET_PARAMETER<br>
<br>
=============<br>
I close my client here<br>
=============<br>
<br>
ProxyServerMediaSubsession["H264"]::closeStreamSource()<br>
Sending request: PAUSE <a class="moz-txt-link-freetext" href="rtsp://127.0.0.1:8554/testStream/">rtsp://127.0.0.1:8554/testStream/</a> RTSP/1.0<br>
CSeq: 7<br>
User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2014.09.11)<br>
Session: 29A64580<br>
<br>
<br>
Received 80 new bytes of response data.<br>
Received a complete PAUSE response:<br>
RTSP/1.0 454 Session Not Found<br>
CSeq: 7<br>
Date: Mon, Sep 22 2014 15:08:54 GMT<br>
<br>
<br>
Regards,<br>
Jonathan<br>
</body>
</html>