[php-src] master: ext/sockets: adding Linux's TCP_SYNCNT constant.
| From: | David Carlier | Date: | Fri, 29 Mar 2024 14:53:09 +0000 |
| Subject: | [php-src] master: ext/sockets: adding Linux's TCP_SYNCNT constant. | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-127875@lists.php.net to get a copy of this message | ||
Author: David Carlier (devnexen)
Date: 2024-03-29T14:52:53Z
Commit: https://github.com/php/php-src/commit/b82024b13c351afaf55d889dc1481a1669f41fb8
Raw diff: https://github.com/php/php-src/commit/b82024b13c351afaf55d889dc1481a1669f41fb8.diff
ext/sockets: adding Linux's TCP_SYNCNT constant.
Useful to control how many SYN packets the client will send to the
server before giving up establishing a connection if the server does
not respond (usually 5 or 6 by default).
Close GH-13816
Changed paths:
M NEWS
M UPGRADING
M ext/sockets/sockets.stub.php
M ext/sockets/sockets_arginfo.h
Diff:
diff --git a/NEWS b/NEWS
index 2d0ea8671a56..d2f9647bb9b3 100644
--- a/NEWS
+++ b/NEWS
@@ -180,6 +180,8 @@ PHP NEWS
- Sockets:
. Added multicast group support for ipv4 on FreeBSD. (jonathan@tangential.ca)
+ . Added the TCP_SYNCNT constant for Linux to set number of attempts to send
+ SYN packets from the client. (David Carlier)
- SNMP:
. Removed the deprecated inet_ntoa call support. (David Carlier)
diff --git a/UPGRADING b/UPGRADING
index ee8b6fcbea1b..395e02e15338 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -556,6 +556,7 @@ PHP 8.4 UPGRADE NOTES
. SO_EXCLUSIVEADDRUSE (Windows only).
. SOCK_CONN_DGRAM (NetBSD only).
. SOCK_DCCP (NetBSD only).
+ . TCP_SYNCNT (Linux only).
- Sodium:
. SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES
diff --git a/ext/sockets/sockets.stub.php b/ext/sockets/sockets.stub.php
index 846648d28f03..08e45eea8b5d 100644
--- a/ext/sockets/sockets.stub.php
+++ b/ext/sockets/sockets.stub.php
@@ -544,6 +544,13 @@
*/
const TCP_CONGESTION = UNKNOWN;
#endif
+#ifdef TCP_SYNCNT
+/**
+ * @var int
+ * @cvalue TCP_SYNCNT
+ */
+const TCP_SYNCNT = UNKNOWN;
+#endif
#ifdef SO_ZEROCOPY
/**
* @var int
diff --git a/ext/sockets/sockets_arginfo.h b/ext/sockets/sockets_arginfo.h
index 2d9f39b7cc2d..a26bd000af6f 100644
--- a/ext/sockets/sockets_arginfo.h
+++ b/ext/sockets/sockets_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a99144c7c83a3f06e54a01bc21c0d30c9a21be29 */
+ * Stub hash: c761db0839535812316a42200f68c7db22639d81 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1)
@@ -535,6 +535,9 @@ static void register_sockets_symbols(int module_number)
#if defined(TCP_CONGESTION)
REGISTER_LONG_CONSTANT("TCP_CONGESTION", TCP_CONGESTION, CONST_PERSISTENT);
#endif
+#if defined(TCP_SYNCNT)
+ REGISTER_LONG_CONSTANT("TCP_SYNCNT", TCP_SYNCNT, CONST_PERSISTENT);
+#endif
#if defined(SO_ZEROCOPY)
REGISTER_LONG_CONSTANT("SO_ZEROCOPY", SO_ZEROCOPY, CONST_PERSISTENT);
#endif