mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 20:55:35 +03:00
Ports/python3: Add support for TCP_NODELAY
This commit is contained in:
parent
eb71950c8b
commit
71d4ab367a
Notes:
sideshowbarker
2024-07-17 06:35:16 +09:00
Author: https://github.com/romch007 Commit: https://github.com/SerenityOS/serenity/commit/71d4ab367a Pull-request: https://github.com/SerenityOS/serenity/pull/21843 Reviewed-by: https://github.com/timschumi ✅
@ -1,26 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Humberto Alves <hjalves@live.com>
|
||||
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();
|
||||
}
|
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user