Browse Source

[core] use IPPROTO_TCP instead of SOL_TCP for TCP_FASTOPEN (#3071)

Change-Id: I2b3b4a62c434c3a8b972d2e6bd09730e004514d0
personal/stbuehler/freebsd-3071
Stefan Bühler 3 months ago
parent
commit
ff500e9c8b
  1. 4
      src/angel/angel_plugin_core.c
  2. 2
      src/main/angel_fake.c

4
src/angel/angel_plugin_core.c

@ -628,7 +628,7 @@ static int do_listen(liServer *srv, liSocketAddress *addr, GString *str) {
}
#ifdef TCP_FASTOPEN
v = 1000;
setsockopt(s, SOL_TCP, TCP_FASTOPEN, &v, sizeof(v));
setsockopt(s, IPPROTO_TCP, TCP_FASTOPEN, &v, sizeof(v));
#endif
if (-1 == listen(s, 1000)) {
close(s);
@ -668,7 +668,7 @@ static int do_listen(liServer *srv, liSocketAddress *addr, GString *str) {
}
#ifdef TCP_FASTOPEN
v = 1000;
setsockopt(s, SOL_TCP, TCP_FASTOPEN, &v, sizeof(v));
setsockopt(s, IPPROTO_TCP, TCP_FASTOPEN, &v, sizeof(v));
#endif
if (-1 == listen(s, 1000)) {
close(s);

2
src/main/angel_fake.c

@ -76,7 +76,7 @@ int li_angel_fake_listen(liServer *srv, GString *str) {
}
#ifdef TCP_FASTOPEN
v = 1000;
setsockopt(s, SOL_TCP, TCP_FASTOPEN, &v, sizeof(v));
setsockopt(s, IPPROTO_TCP, TCP_FASTOPEN, &v, sizeof(v));
#endif
if (-1 == listen(s, 1000)) {
ERROR(srv, "Couldn't listen on '%s': %s", tmpstr->str, g_strerror(errno));

Loading…
Cancel
Save