After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 788523 - Label 'no_connection:' not used to handle connection failure in function 'gst_rtsp_server_transfer_connection'
Label 'no_connection:' not used to handle connection failure in function 'gst...
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
1.12.3
Other All
: Normal minor
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-04 16:39 UTC by Ashish Kumar
Modified: 2018-05-07 16:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ashish Kumar 2017-10-04 16:39:30 UTC
In
File: rtsp-server.c
Function : gst_rtsp_server_transfer_connection 
Line No. : 1121

A goto statement should have been used to label 'no_connection:' to handle connection failure in case 
  gst_rtsp_client_set_connection (client, conn);
returns a false.

-----------------
gst_rtsp_server_transfer_connection (GstRTSPServer * server, GSocket * socket,
    const gchar * ip, gint port, const gchar * initial_buffer)
{
  GstRTSPClient *client = NULL;
  GstRTSPServerClass *klass;
  GstRTSPConnection *conn;
  GstRTSPResult res;

  klass = GST_RTSP_SERVER_GET_CLASS (server);

  if (klass->create_client)
    client = klass->create_client (server);
  if (client == NULL)
    goto client_failed;

  GST_RTSP_CHECK (gst_rtsp_connection_create_from_socket (socket, ip, port,
          initial_buffer, &conn), no_connection);
  g_object_unref (socket);

  /* set connection on the client now */
  gst_rtsp_client_set_connection (client, conn);
//-------------------------------------
//goto no_connection if gst_rtsp_client_set_connection is false
//-------------------------------
  /* manage the client connection */
  manage_client (server, client);

  return TRUE;

  /* ERRORS */
client_failed:
  {
    GST_ERROR_OBJECT (server, "failed to create a client");
    g_object_unref (socket);
    return FALSE;
  }
no_connection:
  {
    gchar *str = gst_rtsp_strresult (res);
    GST_ERROR ("could not create connection from socket %p: %s", socket, str);
    g_free (str);
    g_object_unref (socket);
    return FALSE;
  }
}
------------------------------------
Comment 1 Tim-Philipp Müller 2018-01-15 17:00:56 UTC
Please make a proper patch, thanks!
Comment 2 Sebastian Dröge (slomo) 2018-05-07 16:05:35 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!