You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
27 lines
1.2 KiB
Diff
27 lines
1.2 KiB
Diff
# Enable TCP Fast Open on macOS
|
|
# See: https://github.com/folkertvanheusden/HTTPing/pull/48
|
|
|
|
--- tcp.c.orig 2024-05-08 01:54:44
|
|
+++ tcp.c 2024-05-10 16:16:28
|
|
@@ -161,15 +161,15 @@
|
|
/* connect to peer */
|
|
if (tfo && *tfo)
|
|
{
|
|
-#if defined(__FreeBSD__)
|
|
- int enable = 1;
|
|
- setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, &enable, sizeof(enable));
|
|
+#if defined(__FreeBSD__) || defined(__APPLE__)
|
|
+ int enable = 1;
|
|
+ setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, &enable, sizeof(enable));
|
|
|
|
- rc = sendto(fd, msg, msg_len, 0, ai->ai_addr, ai->ai_addrlen);
|
|
+ rc = sendto(fd, msg, msg_len, 0, ai->ai_addr, ai->ai_addrlen);
|
|
#else
|
|
rc = sendto(fd, msg, msg_len, MSG_FASTOPEN, ai -> ai_addr, ai -> ai_addrlen);
|
|
#endif
|
|
-
|
|
+
|
|
if (rc == msg_len)
|
|
*msg_accepted = 1;
|
|
if (errno == 0)
|