From 57b667261ca9a3834ae68e0398b1d4cea3d61308 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 12 Dec 2012 22:24:47 -0500 Subject: [PATCH] expose TCP_FASTOPEN and MSG_FASTOPEN --- Misc/NEWS | 3 +++ Modules/socketmodule.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS b/Misc/NEWS index 2a9c00dde0c..93bb7c66e1d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -163,6 +163,9 @@ Core and Builtins Library ------- +- Expose the TCP_FASTOPEN and MSG_FASTOPEN flags in socket when they're + available. + - Issue #15701: Add a .headers attribute to urllib.error.HTTPError. Patch contributed by Berker Peksag. diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 1c3396fd53e..99c07cb3e5a 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -5971,6 +5971,9 @@ PyInit__socket(void) #ifdef MSG_MCAST PyModule_AddIntConstant(m, "MSG_MCAST", MSG_MCAST); #endif +#ifdef MSG_FASTOPEN + PyModule_AddIntConstant(m, "MSG_FASTOPEN", MSG_FASTOPEN); +#endif /* Protocol level and numbers, usable for [gs]etsockopt */ #ifdef SOL_SOCKET @@ -6401,7 +6404,9 @@ PyInit__socket(void) #ifdef TCP_QUICKACK PyModule_AddIntConstant(m, "TCP_QUICKACK", TCP_QUICKACK); #endif - +#ifdef TCP_FASTOPEN + PyModule_AddIntConstant(m, "TCP_FASTOPEN", TCP_FASTOPEN); +#endif /* IPX options */ #ifdef IPX_TYPE