rtsp: handle socket errors
gstrtspconnection.c:gst_rtsp_connection_receive() can hang when an error occured on a socekt. Fix this problem by checking for error on 'other' socket after poll return. Fixes #596159
This commit is contained in:
parent
5dbaccabca
commit
48a44f470b
@ -1337,6 +1337,10 @@ gst_rtsp_connection_write (GstRTSPConnection * conn, const guint8 * data,
|
|||||||
else
|
else
|
||||||
goto select_error;
|
goto select_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* could also be an error with read socket */
|
||||||
|
if (gst_poll_fd_has_error (conn->fdset, conn->readfd))
|
||||||
|
goto socket_error;
|
||||||
}
|
}
|
||||||
return GST_RTSP_OK;
|
return GST_RTSP_OK;
|
||||||
|
|
||||||
@ -1353,6 +1357,10 @@ stopped:
|
|||||||
{
|
{
|
||||||
return GST_RTSP_EINTR;
|
return GST_RTSP_EINTR;
|
||||||
}
|
}
|
||||||
|
socket_error:
|
||||||
|
{
|
||||||
|
return GST_RTSP_ENET;
|
||||||
|
}
|
||||||
write_error:
|
write_error:
|
||||||
{
|
{
|
||||||
return res;
|
return res;
|
||||||
@ -2050,6 +2058,11 @@ gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data, guint size,
|
|||||||
else
|
else
|
||||||
goto select_error;
|
goto select_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* could also be an error with write socket */
|
||||||
|
if (gst_poll_fd_has_error (conn->fdset, conn->writefd))
|
||||||
|
goto socket_error;
|
||||||
|
|
||||||
gst_poll_set_controllable (conn->fdset, FALSE);
|
gst_poll_set_controllable (conn->fdset, FALSE);
|
||||||
}
|
}
|
||||||
return GST_RTSP_OK;
|
return GST_RTSP_OK;
|
||||||
@ -2071,6 +2084,10 @@ eof:
|
|||||||
{
|
{
|
||||||
return GST_RTSP_EEOF;
|
return GST_RTSP_EEOF;
|
||||||
}
|
}
|
||||||
|
socket_error:
|
||||||
|
{
|
||||||
|
res = GST_RTSP_ENET;
|
||||||
|
}
|
||||||
read_error:
|
read_error:
|
||||||
{
|
{
|
||||||
return res;
|
return res;
|
||||||
@ -2204,6 +2221,11 @@ gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * message,
|
|||||||
else
|
else
|
||||||
goto select_error;
|
goto select_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* could also be an error with write socket */
|
||||||
|
if (gst_poll_fd_has_error (conn->fdset, conn->writefd))
|
||||||
|
goto socket_error;
|
||||||
|
|
||||||
gst_poll_set_controllable (conn->fdset, FALSE);
|
gst_poll_set_controllable (conn->fdset, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2233,6 +2255,11 @@ eof:
|
|||||||
res = GST_RTSP_EEOF;
|
res = GST_RTSP_EEOF;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
socket_error:
|
||||||
|
{
|
||||||
|
res = GST_RTSP_ENET;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
read_error:
|
read_error:
|
||||||
cleanup:
|
cleanup:
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user