mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
client: don't crash when tunnelid is missing
When a clients tries to open an HTTP tunnel but fails to provide a tunnelid, don't crash but return an error response to the client. Fixes #589489
This commit is contained in:
parent
748290b888
commit
daccf6bc99
1 changed files with 15 additions and 1 deletions
|
@ -1359,6 +1359,8 @@ tunnel_start (GstRTSPWatch * watch, gpointer user_data)
|
||||||
|
|
||||||
/* store client in the pending tunnels */
|
/* store client in the pending tunnels */
|
||||||
tunnelid = gst_rtsp_connection_get_tunnelid (client->connection);
|
tunnelid = gst_rtsp_connection_get_tunnelid (client->connection);
|
||||||
|
if (tunnelid == NULL)
|
||||||
|
goto no_tunnelid;
|
||||||
|
|
||||||
g_message ("client %p: inserting %s", client, tunnelid);
|
g_message ("client %p: inserting %s", client, tunnelid);
|
||||||
|
|
||||||
|
@ -1373,6 +1375,11 @@ tunnel_start (GstRTSPWatch * watch, gpointer user_data)
|
||||||
return GST_RTSP_STS_OK;
|
return GST_RTSP_STS_OK;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
no_tunnelid:
|
||||||
|
{
|
||||||
|
g_message ("client %p: no tunnelid provided", client);
|
||||||
|
return GST_RTSP_STS_SERVICE_UNAVAILABLE;
|
||||||
|
}
|
||||||
tunnel_existed:
|
tunnel_existed:
|
||||||
{
|
{
|
||||||
g_mutex_unlock (tunnels_lock);
|
g_mutex_unlock (tunnels_lock);
|
||||||
|
@ -1392,6 +1399,8 @@ tunnel_complete (GstRTSPWatch * watch, gpointer user_data)
|
||||||
|
|
||||||
/* find previous tunnel */
|
/* find previous tunnel */
|
||||||
tunnelid = gst_rtsp_connection_get_tunnelid (client->connection);
|
tunnelid = gst_rtsp_connection_get_tunnelid (client->connection);
|
||||||
|
if (tunnelid == NULL)
|
||||||
|
goto no_tunnelid;
|
||||||
|
|
||||||
g_mutex_lock (tunnels_lock);
|
g_mutex_lock (tunnels_lock);
|
||||||
if (!(oclient = g_hash_table_lookup (tunnels, tunnelid)))
|
if (!(oclient = g_hash_table_lookup (tunnels, tunnelid)))
|
||||||
|
@ -1417,11 +1426,16 @@ tunnel_complete (GstRTSPWatch * watch, gpointer user_data)
|
||||||
return GST_RTSP_OK;
|
return GST_RTSP_OK;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
no_tunnelid:
|
||||||
|
{
|
||||||
|
g_message ("client %p: no tunnelid provided", client);
|
||||||
|
return GST_RTSP_STS_SERVICE_UNAVAILABLE;
|
||||||
|
}
|
||||||
no_tunnel:
|
no_tunnel:
|
||||||
{
|
{
|
||||||
g_mutex_unlock (tunnels_lock);
|
g_mutex_unlock (tunnels_lock);
|
||||||
g_message ("client %p: tunnel session %s not found", client, tunnelid);
|
g_message ("client %p: tunnel session %s not found", client, tunnelid);
|
||||||
return GST_RTSP_OK;
|
return GST_RTSP_STS_SERVICE_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue