]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91498: socket: Add TCP_CONNECTION_INFO on macOS (#69256)
authorDavid CARLIER <devnexen@gmail.com>
Wed, 27 Apr 2022 12:47:17 +0000 (13:47 +0100)
committerGitHub <noreply@github.com>
Wed, 27 Apr 2022 12:47:17 +0000 (06:47 -0600)
Fixes GH-91498

Doc/library/socket.rst
Misc/NEWS.d/next/Library/2022-04-10-08-39-44.bpo-91498.8oII92.rst [new file with mode: 0644]
Modules/socketmodule.c

index cff5a32afb464d9db43a9fdeb86d20e9c24a463b..3b1912cff88a41ae583f91ae841049c2c296c317 100755 (executable)
@@ -388,6 +388,10 @@ Constants
        Added ``TCP_KEEPALIVE``. On MacOS this constant can be used in the same
        way that ``TCP_KEEPIDLE`` is used on Linux.
 
+   .. versionchanged:: 3.11
+      Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the
+      same way that ``TCP_INFO`` is used on Linux and BSD.
+
 .. data:: AF_CAN
           PF_CAN
           SOL_CAN_*
diff --git a/Misc/NEWS.d/next/Library/2022-04-10-08-39-44.bpo-91498.8oII92.rst b/Misc/NEWS.d/next/Library/2022-04-10-08-39-44.bpo-91498.8oII92.rst
new file mode 100644 (file)
index 0000000..df3b81f
--- /dev/null
@@ -0,0 +1 @@
+Add the ``TCP_CONNECTION_INFO`` option (available on macOS) to :mod:`socket`.
index c7bc10b5dbbbcda8c4b60b971a6d6ba395639502..9ecabaf973074477b5ba9d7eb788c9f736a09a7e 100644 (file)
@@ -8213,6 +8213,9 @@ PyInit__socket(void)
 #ifdef  TCP_INFO
     PyModule_AddIntMacro(m, TCP_INFO);
 #endif
+#ifdef  TCP_CONNECTION_INFO
+    PyModule_AddIntMacro(m, TCP_CONNECTION_INFO);
+#endif
 #ifdef  TCP_QUICKACK
     PyModule_AddIntMacro(m, TCP_QUICKACK);
 #endif