mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
rtspsrc: Avoid stack overflow recursing waiting for response
Instead of recursing, simply implement a loop with gotos, the same
way it was done before 8121752887
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/710
This commit is contained in:
parent
cf3fbf57bf
commit
00539e1277
1 changed files with 7 additions and 4 deletions
|
@ -6325,7 +6325,10 @@ gst_rtsp_src_receive_response (GstRTSPSrc * src, GstRTSPConnInfo * conninfo,
|
|||
{
|
||||
GstRTSPStatusCode thecode;
|
||||
gchar *content_base = NULL;
|
||||
GstRTSPResult res = gst_rtspsrc_connection_receive (src, conninfo, response,
|
||||
GstRTSPResult res;
|
||||
|
||||
next:
|
||||
res = gst_rtspsrc_connection_receive (src, conninfo, response,
|
||||
src->tcp_timeout);
|
||||
|
||||
if (res < 0)
|
||||
|
@ -6342,7 +6345,7 @@ gst_rtsp_src_receive_response (GstRTSPSrc * src, GstRTSPConnInfo * conninfo,
|
|||
goto handle_request_failed;
|
||||
|
||||
/* Not a response, receive next message */
|
||||
return gst_rtsp_src_receive_response (src, conninfo, response, code);
|
||||
goto next;
|
||||
case GST_RTSP_MESSAGE_RESPONSE:
|
||||
/* ok, a response is good */
|
||||
GST_DEBUG_OBJECT (src, "received response message");
|
||||
|
@ -6353,13 +6356,13 @@ gst_rtsp_src_receive_response (GstRTSPSrc * src, GstRTSPConnInfo * conninfo,
|
|||
gst_rtspsrc_handle_data (src, response);
|
||||
|
||||
/* Not a response, receive next message */
|
||||
return gst_rtsp_src_receive_response (src, conninfo, response, code);
|
||||
goto next;
|
||||
default:
|
||||
GST_WARNING_OBJECT (src, "ignoring unknown message type %d",
|
||||
response->type);
|
||||
|
||||
/* Not a response, receive next message */
|
||||
return gst_rtsp_src_receive_response (src, conninfo, response, code);
|
||||
goto next;
|
||||
}
|
||||
|
||||
thecode = response->type_data.response.code;
|
||||
|
|
Loading…
Reference in a new issue