[Bug 770935] RTP/RTSP/TCP transport RTSP TIMEOUT should start at once when tcpi_ca_state is TCP_CA_Loss
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Thu Sep 14 17:39:34 UTC 2017
https://bugzilla.gnome.org/show_bug.cgi?id=770935
Tim-Philipp Müller <t.i.m at zen.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #345606|none |reviewed
status| |
--- Comment #21 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
Comment on attachment 345606
--> https://bugzilla.gnome.org/attachment.cgi?id=345606
Due to change to 770934 this patch change too.
Was this patch supposed to be attached to bug #770934 instead?
>+#ifdef G_OS_UNIX
>+static gboolean
>+check_tcp_ca_state_loss (GSocket * sock)
>+{
>+ gboolean res;
>+ struct tcp_info tcp_info;
>+ socklen_t optlen = sizeof (tcp_info);
>+
>+ getsockopt (g_socket_get_fd (sock),
>+ IPPROTO_TCP, TCP_INFO, &tcp_info, &optlen);
>+ res = (tcp_info.tcpi_ca_state == TCP_CA_Loss);
>+
>+ GST_DEBUG ("tcpi_ca_state=%u, check_tcp_ca_state_loss=%d",
>+ tcp_info.tcpi_ca_state, res);
>+
>+ return res;
>+}
>+#endif
Will this work on all common Unices? macOS? *BSD? If not, then we need to check
what's available.
Also, the includes needed for this are the other patch in the other bug
(although not needed there I think).
> static void
> connloss_status (GstRTSPWatch * watch, GstRTSPResult result,
> GSocket * write_socket, gpointer user_data)
> {
> GstRTSPClient *client = GST_RTSP_CLIENT (user_data);
> GstRTSPClientPrivate *priv = client->priv;
>+ gboolean is_eintr = (result == GST_RTSP_EINTR);
>
>- priv->connloss = (result == GST_RTSP_EINTR);
>+ priv->connloss = is_eintr;
>+
>+#ifdef G_OS_UNIX
>+ /* If TCP stack state indicate loss, don't reset session TIMEOUT.
>+ * Need this to avoid delay. Return generic error.
>+ */
This comment sounds like it belongs elsewhere in the other patch that makes use
of priv->connloss to skip the timeout reset. I don't understand the bit about
'Return generic error', what does it mean here? The comment here should be more
descriptive as to what we're trying to do here and then why, e.g. 'Indicate
potential connection loss as soon as we detect a write backlog, so that we stop
resetting the timout from the moment any backlog is building up. This makes
sure we can honour the actually requested timeout more accurately.' or
somesuch.
>+ if (!is_eintr && write_socket)
>+ priv->connloss = check_tcp_ca_state_loss (write_socket);
>+#endif
>
> GST_LOG ("client %p: connloss_status %s", client,
> (priv->connloss ? "CONNECTION LOST" : "OK"));
>--
>2.1.4
>
--
You are receiving this mail because:
You are the QA Contact for the bug.
More information about the gstreamer-bugs
mailing list