Commit e5aa3528 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

tls: disable the Nagle algorithm

Users of vlc_tls_t coalesce sends in user-space correctly. That being
the case, the Nagle algorithm just increases latency for no benefits.
parent 8338cca8
......@@ -817,7 +817,7 @@ AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
dnl BSD
AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
dnl GNU/Linux
AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
......
......@@ -39,6 +39,12 @@
#ifdef HAVE_SYS_UIO_H
# include <sys/uio.h>
#endif
#ifdef HAVE_NETINET_TCP_H
# include <netinet/tcp.h>
#endif
#ifndef SOL_TCP
# define SOL_TCP IPPROTO_TCP
#endif
#include <vlc_common.h>
#include "libvlc.h"
......@@ -434,6 +440,9 @@ static vlc_tls_t *vlc_tls_SocketAddrInfo(const struct addrinfo *restrict info)
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &(int){ 1 }, sizeof (int));
if (info->ai_socktype == SOCK_STREAM && info->ai_protocol == IPPROTO_TCP)
setsockopt(fd, SOL_TCP, TCP_NODELAY, &(int){ 1 }, sizeof (int));
vlc_tls_t *sk = vlc_tls_SocketAlloc(fd, info->ai_addr, info->ai_addrlen);
if (unlikely(sk == NULL))
net_Close(fd);
......
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