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:
parent
bbc0d8c5e4
commit
944382a62e
1 changed files with 11 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue