Commit d1c9972e authored by Vivia Nikolaidou's avatar Vivia Nikolaidou 🦆 Committed by Tim-Philipp Müller

tcpclientsrc: Fix compilation on FreeBSD

The members of the tcp_info struct are prefixed with a double
underscore, as reported in
!584 (comment 423487)
parent 40773e9c
......@@ -585,6 +585,16 @@ gst_tcp_client_src_get_stats (GstTCPClientSrc * src)
fd = g_socket_get_fd (src->socket);
if (getsockopt (fd, IPPROTO_TCP, TCP_INFO, &info, &info_len) == 0) {
/* this is system-specific */
#ifdef HAVE_BSD_TCP_INFO
gst_structure_set (s,
"reordering", G_TYPE_UINT, info.__tcpi_reordering,
"unacked", G_TYPE_UINT, info.__tcpi_unacked,
"sacked", G_TYPE_UINT, info.__tcpi_sacked,
"lost", G_TYPE_UINT, info.__tcpi_lost,
"retrans", G_TYPE_UINT, info.__tcpi_retrans,
"fackets", G_TYPE_UINT, info.__tcpi_fackets, NULL);
#elif defined(HAVE_LINUX_TCP_INFO)
gst_structure_set (s,
"reordering", G_TYPE_UINT, info.tcpi_reordering,
"unacked", G_TYPE_UINT, info.tcpi_unacked,
......@@ -592,6 +602,7 @@ gst_tcp_client_src_get_stats (GstTCPClientSrc * src)
"lost", G_TYPE_UINT, info.tcpi_lost,
"retrans", G_TYPE_UINT, info.tcpi_retrans,
"fackets", G_TYPE_UINT, info.tcpi_fackets, NULL);
#endif
}
}
#endif
......
......@@ -375,6 +375,14 @@ else
endif
endif
if cc.has_member('struct tcp_info', '__tcpi_reordering', prefix: '#include <netinet/tcp.h>')
core_conf.set('HAVE_BSD_TCP_INFO', true)
endif
if cc.has_member('struct tcp_info', 'tcpi_reordering', prefix: '#include <netinet/tcp.h>')
core_conf.set('HAVE_LINUX_TCP_INFO', true)
endif
gir = find_program('g-ir-scanner', required : get_option('introspection'))
gnome = import('gnome')
build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment