From 71d4ab367af2d8c852600910733173dfcd0fcb5b Mon Sep 17 00:00:00 2001 From: Romain Chardiny Date: Wed, 8 Nov 2023 19:07:24 +0100 Subject: [PATCH] Ports/python3: Add support for TCP_NODELAY --- ...around-for-unsupported-socket-option.patch | 26 ------------------- Ports/python3/patches/ReadMe.md | 10 ------- 2 files changed, 36 deletions(-) delete mode 100644 Ports/python3/patches/0004-Workaround-for-unsupported-socket-option.patch diff --git a/Ports/python3/patches/0004-Workaround-for-unsupported-socket-option.patch b/Ports/python3/patches/0004-Workaround-for-unsupported-socket-option.patch deleted file mode 100644 index 479983fcc9..0000000000 --- a/Ports/python3/patches/0004-Workaround-for-unsupported-socket-option.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Humberto Alves -Date: Fri, 2 Sep 2022 03:31:42 +0100 -Subject: [PATCH] Workaround for unsupported socket option - -This is a workaround for ignoring the result of `setsockopt` call when -given `TCP_NODELAY` as an argument. This TCP socket option is used in -many applications (like pip and requests) for optimization purposes. -For now, it can be safely ignored until it's supported in the kernel. ---- - Modules/socketmodule.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index 9fa20cd95b41bea51ae9ccadc24ec74bf222b695..76160293f9d831b8516d0094bd3ea4039c059eca 100644 ---- a/Modules/socketmodule.c -+++ b/Modules/socketmodule.c -@@ -3209,6 +3209,8 @@ sock_setsockopt(PySocketSockObject *s, PyObject *args) - PyBuffer_Release(&optval); - - done: -+ if (res < 0 && level == IPPROTO_TCP && optname == TCP_NODELAY && errno == ENOPROTOOPT) -+ res = 0; - if (res < 0) { - return s->errorhandler(); - } diff --git a/Ports/python3/patches/ReadMe.md b/Ports/python3/patches/ReadMe.md index 5f79875de7..4a738aa25f 100644 --- a/Ports/python3/patches/ReadMe.md +++ b/Ports/python3/patches/ReadMe.md @@ -21,13 +21,3 @@ Include `sys/uio.h` in `socketmodule.c` This is to ensure that `struct iovec` is defined, which is required by the `socket` module. - -## `0004-Workaround-for-unsupported-socket-option.patch` - -Workaround for unsupported socket option - -This is a workaround for ignoring the result of `setsockopt` call when -given `TCP_NODELAY` as an argument. This TCP socket option is used in -many applications (like pip and requests) for optimization purposes. -For now, it can be safely ignored until it's supported in the kernel. -