1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-30 19:46:56 +00:00

Add TCP_FASTOPEN support

Should make transmission slightly faster.
This commit is contained in:
neheb 2017-02-17 16:47:11 -08:00 committed by Mike Gelfand
parent bbc0d8c5e4
commit 944382a62e

View file

@ -384,6 +384,17 @@ tr_netBindTCPImpl (const tr_address * addr,
if (!suppressMsgs)
tr_logAddDebug ("Bound socket %" PRIdMAX " to port %d on %s", (intmax_t) fd, port, tr_address_to_string (addr));
#ifdef TCP_FASTOPEN
#ifndef SOL_TCP
#define SOL_TCP IPPROTO_TCP
#endif
optval = 5;
setsockopt (fd, SOL_TCP, TCP_FASTOPEN, (const void *) &optval, sizeof (optval));
#endif
if (listen (fd, 128) == -1) {
*errOut = sockerrno;
tr_netCloseSocket (fd);